[Tkabber-dev] r1710 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Mar 11 09:28:16 MSK 2009


Author: sergei
Date: 2009-03-11 09:28:16 +0300 (Wed, 11 Mar 2009)
New Revision: 1710

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/custom.tcl
Log:
	* custom.tcl: Also, don't set trace on a custom variable if it's
	  set already.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-11 06:14:50 UTC (rev 1709)
+++ trunk/tkabber/ChangeLog	2009-03-11 06:28:16 UTC (rev 1710)
@@ -2,7 +2,8 @@
 
 	* custom.tcl: Fixed duplicates in customization groups. This is useful
 	  if a config variable could be added several times on plugins
-	  loading/unloading.
+	  loading/unloading. Also, don't set trace on a custom variable if it's
+	  set already.
 
 2009-03-09  Sergei Golovan  <sgolovan at nes.ru>
 

Modified: trunk/tkabber/custom.tcl
===================================================================
--- trunk/tkabber/custom.tcl	2009-03-11 06:14:50 UTC (rev 1709)
+++ trunk/tkabber/custom.tcl	2009-03-11 06:28:16 UTC (rev 1710)
@@ -53,11 +53,15 @@
 
     if {![info exists $fullname]} {
 	set $fullname $value
-    } else {
+
+	trace variable $fullname w \
+	    [list [namespace current]::on_var_change $fullname]
+    } elseif {![info exists var(default,$fullname)]} {
 	set var(config,$fullname) $value
+
+	trace variable $fullname w \
+	    [list [namespace current]::on_var_change $fullname]
     }
-    trace variable $fullname w \
-	[list [namespace current]::on_var_change $fullname]
 
     set var(default,$fullname) $value
     set var(doc,$fullname) $doc



More information about the Tkabber-dev mailing list