[blam: 2/5] ChannelList: fix path comparison
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam: 2/5] ChannelList: fix path comparison
- Date: Thu, 20 Jun 2013 23:43:32 +0000 (UTC)
commit 9148e521ac54cd17bbdc6bdbb4b16ddcc03883d9
Author: Carlos Martín Nieto <cmn dwim me>
Date: Tue Jun 18 19:30:54 2013 +0200
ChannelList: fix path comparison
Use Path.Equals() instead of '==' to check if two paths are the
same. This stops us from removing and re-adding a channel that's
dropped at the level where it already was.
src/ChannelList.cs | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/ChannelList.cs b/src/ChannelList.cs
index a89449c..1851991 100644
--- a/src/ChannelList.cs
+++ b/src/ChannelList.cs
@@ -164,10 +164,9 @@ namespace Imendio.Blam {
tmp_path.Up();
TreePath tmp_path_src = Model.GetPath(src.Iter).Copy();
tmp_path_src.Up();
- if(tmp_path == tmp_path_src){ // Same parent.
- System.Console.WriteLine("return!");
+ // if they have the same parent, we don't do anything
+ if (tmp_path.Equals(tmp_path_src))
return;
- }
Collection.Remove(src);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]