[Tkabber-dev] r1874 - in trunk/tkabber-plugins: . spy

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Jan 16 19:04:19 MSK 2010


Author: sergei
Date: 2010-01-16 19:04:18 +0300 (Sat, 16 Jan 2010)
New Revision: 1874

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/spy/spy.tcl
Log:
	* spy/spy.tcl: Fixed adding new spy watch if some of them were added
	  and removed already.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2010-01-16 13:56:48 UTC (rev 1873)
+++ trunk/tkabber-plugins/ChangeLog	2010-01-16 16:04:18 UTC (rev 1874)
@@ -1,3 +1,8 @@
+2010-01-16  Sergei Golovan <sgolovan at nes.ru>
+
+	* spy/spy.tcl: Fixed adding new spy watch if some of them were added
+	  and removed already.
+
 2010-01-14  Sergei Golovan <sgolovan at nes.ru>
 
 	* latex/latex.tcl: Use -output-directory latex option instead of

Modified: trunk/tkabber-plugins/spy/spy.tcl
===================================================================
--- trunk/tkabber-plugins/spy/spy.tcl	2010-01-16 13:56:48 UTC (rev 1873)
+++ trunk/tkabber-plugins/spy/spy.tcl	2010-01-16 16:04:18 UTC (rev 1874)
@@ -150,7 +150,6 @@
     if { $regex == "" } return
 
     # Add new watch if there is no such already present
-    set next_watch [expr [llength $watches] + 1]
     foreach watch $watches {
 	set r [lindex $watch 1]
 	set idx [lindex $watch 0]
@@ -167,6 +166,10 @@
     } else {
 	$entr configure -fg [option get $entr foreground Entry]
     }
+    set next_watch 0
+    while {[winfo exists $w.watches.$next_watch]} {
+	incr next_watch
+    }
     lappend watches [list $next_watch $regex]
     add_watch_frame $next_watch $regex
 }



More information about the Tkabber-dev mailing list