blam r673 - trunk/src



Author: cmartin
Date: Sun Mar  8 23:03:22 2009
New Revision: 673
URL: http://svn.gnome.org/viewvc/blam?rev=673&view=rev

Log:
Don't allow a group to be inside another group.

Until we add the whole proper logic for it, it's just not possible.

Modified:
   trunk/src/ChannelCollection.cs
   trunk/src/ChannelList.cs

Modified: trunk/src/ChannelCollection.cs
==============================================================================
--- trunk/src/ChannelCollection.cs	(original)
+++ trunk/src/ChannelCollection.cs	Sun Mar  8 23:03:22 2009
@@ -271,7 +271,7 @@
         foreach(ChannelGroup group in Groups){
             if(group.Channels.Count == 0)
                     continue;
-            foreach(IChannel channel in group.Channels){
+            foreach(Channel channel in group.Channels){
                 TimeSpan span = DateTime.Now.Subtract(channel.LastRefreshed);
                 if(span.TotalSeconds >= refreshRate * 60){
                     QueueChannelRefresh(channel);

Modified: trunk/src/ChannelList.cs
==============================================================================
--- trunk/src/ChannelList.cs	(original)
+++ trunk/src/ChannelList.cs	Sun Mar  8 23:03:22 2009
@@ -121,8 +121,13 @@
 			Model.GetIter(out iter, path);
 			ChannelGroup group = Model.GetValue(iter, 0) as ChannelGroup;
 
-			if(Model.GetValue(iter, 0) is Channel){
-				return; // A channel can't become a group.
+			/*
+			 * A channel can't become a group and a group can't be
+			 * inside another group.
+			 * FIXME: Make it possible for a group to be inside another group.
+			 */
+			if(Model.GetValue(iter, 0) is Channel || GetSelected() is ChannelGroup){
+				return;
 			}
 
 			chan.Iter = (Model as TreeStore).AppendValues(iter, chan);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]