[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: API documentation of kstringhandler
From:       Richard Moore <rich () xmelegance ! org>
Date:       2004-03-07 1:15:02
Message-ID: 200403070115.02734.rich () xmelegance ! org
[Download RAW message or body]

Here is a patch

Rich.

["kstringhandler.patch" (text/x-diff)]

Index: kstringhandler.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kstringhandler.h,v
retrieving revision 1.28
diff -u -3 -u -r1.28 kstringhandler.h
--- kstringhandler.h	29 Jan 2004 10:23:51 -0000	1.28
+++ kstringhandler.h	7 Mar 2004 01:04:12 -0000
@@ -438,5 +438,6 @@
         return matchFileName (filename, pattern);
     };
 
+    static QStringList split( const QString &s, bool allowEmpty = false );
 };
 #endif
Index: kstringhandler.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kstringhandler.cpp,v
retrieving revision 1.38
diff -u -3 -u -r1.38 kstringhandler.cpp
--- kstringhandler.cpp	29 Feb 2004 10:30:54 -0000	1.38
+++ kstringhandler.cpp	7 Mar 2004 01:04:12 -0000
@@ -52,7 +52,7 @@
     //
     // 0:        first word to end
     // 1:3        second to fourth words
-    QStringList list = QStringList::split( " ", text , true );
+    QStringList list = split( text , true );
     QString tmp = "";
     QString r = range;
 
@@ -90,7 +90,7 @@
         return text;
 
     // Split words and add into list
-    QStringList list = QStringList::split( " ", text, true );
+    QStringList list = split( text, true );
 
     if ( pos >= list.count() )
         list.append( word );
@@ -110,7 +110,7 @@
         return text;
 
     // Split words and add into list
-    QStringList list = QStringList::split( " ", text, true );
+    QStringList list = split( text, true );
 
     if ( pos >= list.count() )
         list.append( word );
@@ -130,7 +130,7 @@
     //
     // 0:        first word to end
     // 1:3        second to fourth words
-    QStringList list = QStringList::split( " ", text , true );
+    QStringList list = split( text , true );
     QString tmp = "";
     QString r = range;
 
@@ -160,7 +160,7 @@
         return tmp;
 
     // Split words and add into list
-    QStringList list = QStringList::split( " ", text, true );
+    QStringList list = split( text, true );
 
     if ( pos < list.count() )
         list.remove( list.at( pos ) );
@@ -180,7 +180,7 @@
         return text;
 
     // Split words and add into list
-    QStringList list = QStringList::split( " ", text, true );
+    QStringList list = split( text, true );
 
     QStringList::Iterator it = list.find(word);
 
@@ -201,7 +201,7 @@
     }
 
     const QString strippedText = text.stripWhiteSpace();
-    const QStringList words = capwords( QStringList::split( ' ', strippedText ) );
+    const QStringList words = capwords( split( strippedText ) );
 
     QString result = text;
     result.replace( strippedText, words.join( " " ) );
@@ -228,7 +228,7 @@
         return tmp;
 
     QStringList list;
-    list = QStringList::split( " ", text, true );
+    list = split( text, true );
     list = reverse( list );
 
     return list.join( " " );
@@ -662,3 +662,9 @@
              QString::fromUtf8( str ) : 
              QString::fromLocal8Bit( str );
 }
+
+QStringList KStringHandler::split( const QString &s, bool allowEmpty )
+{
+    QRegExp re( " \n\t" );
+    return QStringList::split( re, s, allowEmpty );
+}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic