• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

開発に使用するリポジトリ


Commit MetaInfo

Revisiónee331fec437a21e0ec3eee636d6e818fd9ce2c99 (tree)
Tiempo2012-12-21 16:03:14
AutorKimura Youichi <kim.upsilon@bucy...>
CommiterKimura Youichi

Log Message

PostClassのクローンが不完全である問題を修正

Cambiar Resumen

Diferencia incremental

--- a/OpenTween/StatusDictionary.cs
+++ b/OpenTween/StatusDictionary.cs
@@ -5,6 +5,7 @@
55 // (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
66 // (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
77 // (c) 2011 Egtra (@egtra) <http://dev.activebasic.com/egtra/>
8+// (c) 2012 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
89 // All rights reserved.
910 //
1011 // This file is part of OpenTween.
@@ -42,6 +43,17 @@ namespace OpenTween
4243 {
4344 public double Lng { get; set; }
4445 public double Lat { get; set; }
46+
47+ public override bool Equals(object obj)
48+ {
49+ var geo = obj as StatusGeo;
50+ return geo != null && geo.Lng == this.Lng && geo.Lat == this.Lng;
51+ }
52+
53+ public override int GetHashCode()
54+ {
55+ return this.Lng.GetHashCode() ^ this.Lat.GetHashCode();
56+ }
4557 }
4658 private string _Nick;
4759 private string _textFromApi;
@@ -587,7 +599,7 @@ namespace OpenTween
587599 (this.InReplyToStatusId == other.InReplyToStatusId) &&
588600 (this.Source == other.Source) &&
589601 (this.SourceHtml == other.SourceHtml) &&
590- (this.ReplyToList.Equals(other.ReplyToList)) &&
602+ (this.ReplyToList.SequenceEqual(other.ReplyToList)) &&
591603 (this.IsMe == other.IsMe) &&
592604 (this.IsDm == other.IsDm) &&
593605 (this.UserId == other.UserId) &&
@@ -608,7 +620,12 @@ namespace OpenTween
608620 #region "IClonable.Clone"
609621 object ICloneable.Clone()
610622 {
611- return this.MemberwiseClone();
623+ var clone = (PostClass)this.MemberwiseClone();
624+ clone.ReplyToList = new List<string>(this.ReplyToList);
625+ clone.PostGeo = new StatusGeo { Lng = this.PostGeo.Lng, Lat = this.PostGeo.Lat };
626+ clone.Media = new Dictionary<string, string>(this.Media);
627+
628+ return clone;
612629 }
613630 #endregion
614631 }