[Tkabber-dev] r1701 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Mar 5 21:40:55 MSK 2009


Author: sergei
Date: 2009-03-05 21:40:54 +0300 (Thu, 05 Mar 2009)
New Revision: 1701

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/hooks.tcl
Log:
	* hooks.tcl: Added a procedure which checks if a hook is empty.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-03-02 06:04:25 UTC (rev 1700)
+++ trunk/tkabber/ChangeLog	2009-03-05 18:40:54 UTC (rev 1701)
@@ -1,3 +1,7 @@
+2009-03-05  Sergei Golovan  <sgolovan at nes.ru>
+
+	* hooks.tcl: Added a procedure which checks if a hook is empty.
+
 2009-03-02  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/richtext/emoticons.tcl: Reload images on theme change

Modified: trunk/tkabber/hooks.tcl
===================================================================
--- trunk/tkabber/hooks.tcl	2009-03-02 06:04:25 UTC (rev 1700)
+++ trunk/tkabber/hooks.tcl	2009-03-05 18:40:54 UTC (rev 1701)
@@ -16,6 +16,16 @@
     set $hook [lreplace [set $hook] $idx $idx]
 }
 
+proc hook::is_empty {hook} {
+    variable $hook
+
+    if {![info exists $hook] || [llength [set $hook]] == 0} {
+	return 1
+    } else {
+	return 0
+    }
+}
+
 proc hook::set_flag {hook flag} {
     variable F
     set idx [lsearch -exact $F(flags,$hook) $flag]



More information about the Tkabber-dev mailing list