[Tkabber-dev] r1477 - in trunk/tkabber: . ifacetk

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Jul 16 21:04:46 MSD 2008


Author: sergei
Date: 2008-07-16 21:04:45 +0400 (Wed, 16 Jul 2008)
New Revision: 1477

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/ifacetk/iroster.tcl
   trunk/tkabber/roster.tcl
   trunk/tkabber/utils.tcl
Log:
	* utils.tcl, roster.tcl, ifacetk/iroster.tcl: Fixed bug in splitting
	  roster group by a delimiter, now correctly treating delimiter as a
	  string and not as a regexp (thanks to Konstantin Khomoutov).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2008-07-12 14:25:51 UTC (rev 1476)
+++ trunk/tkabber/ChangeLog	2008-07-16 17:04:45 UTC (rev 1477)
@@ -1,3 +1,9 @@
+2008-07-16  Sergei Golovan  <sgolovan at nes.ru>
+
+	* utils.tcl, roster.tcl, ifacetk/iroster.tcl: Fixed bug in splitting
+	  roster group by a delimiter, now correctly treating delimiter as a
+	  string and not as a regexp (thanks to Konstantin Khomoutov).
+
 2008-07-12  Sergei Golovan  <sgolovan at nes.ru>
 
 	* msgs/de.msg: Updated German translation (thanks to Roger Sondermann).

Modified: trunk/tkabber/ifacetk/iroster.tcl
===================================================================
--- trunk/tkabber/ifacetk/iroster.tcl	2008-07-12 14:25:51 UTC (rev 1476)
+++ trunk/tkabber/ifacetk/iroster.tcl	2008-07-16 17:04:45 UTC (rev 1477)
@@ -178,7 +178,7 @@
 	if {$options(nested)} {
 	    set tmp {}
 	    foreach group $groups {
-		set tmp1 [::textutil::splitx $group $options(nested_delimiter)]
+		set tmp1 [msplit $group $options(nested_delimiter)]
 		for {set i 0} {$i < [llength $tmp1]} {incr i} {
 		    lappend tmp [lrange $tmp1 0 $i]
 		}
@@ -388,7 +388,7 @@
 	    if {![lempty $jid_groups]} {
 		foreach group $jid_groups {
 		    if {$options(nested)} {
-			set sgroup [::textutil::splitx $group $options(nested_delimiter)]
+			set sgroup [msplit $group $options(nested_delimiter)]
 		    } else {
 			set sgroup [list $group]
 		    }
@@ -1764,7 +1764,7 @@
 	destroy $m
     }
     if {$options(nested)} {
-	set oname [::textutil::splitx $name $options(nested_delimiter)]
+	set oname [msplit $name $options(nested_delimiter)]
     } else {
 	set oname $name
     }

Modified: trunk/tkabber/roster.tcl
===================================================================
--- trunk/tkabber/roster.tcl	2008-07-12 14:25:51 UTC (rev 1476)
+++ trunk/tkabber/roster.tcl	2008-07-16 17:04:45 UTC (rev 1477)
@@ -159,7 +159,7 @@
 	if {![lempty $jid_groups]} {
 	    foreach group $jid_groups {
 		if {$nested} {
-		    set sgroup [::textutil::splitx $group $delimiter]
+		    set sgroup [msplit $group $delimiter]
 		} else {
 		    set sgroup [list $group]
 		}

Modified: trunk/tkabber/utils.tcl
===================================================================
--- trunk/tkabber/utils.tcl	2008-07-12 14:25:51 UTC (rev 1476)
+++ trunk/tkabber/utils.tcl	2008-07-16 17:04:45 UTC (rev 1477)
@@ -543,6 +543,15 @@
     }
 }
 
+# Splits a string given in $s at each occurence of
+# substring given in $by.
+# $sep contains a Unicode character used to replace
+# found substrings before actual splitting;
+# this character MUST NOT occur in $s.
+proc msplit {s by {sep \u001F}} {
+    split [string map [list $by $sep] $s] $sep
+}
+
 ##################################################################
 
 proc reverse_scroll {w} {



More information about the Tkabber-dev mailing list