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

List:       kde-commits
Subject:    kdebase/kdeprint/kdeprintfax
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2004-03-12 13:57:56
Message-ID: 20040312135756.A038499AC () office ! kde ! org
[Download RAW message or body]

CVS commit by goffioul: 

Strip any non-numeric character from fax number, except "+". I hope this is supported \
by most faxing tools. This allows to use various characters in fax numbers like \
-,/,<blank>... (bug #59623)


  M +8 -1      faxctrl.cpp   1.28


--- kdebase/kdeprint/kdeprintfax/faxctrl.cpp  #1.27:1.28
@@ -55,4 +55,11 @@
 #define quote(x) KProcess::quote(x)
 
+static QString stripNumber( const QString& s )
+{
+        // removes any non-numeric character, except '+' (hope it's supported by \
faxing tools) +        QString strip_s = s;
+        return strip_s.replace( QRegExp( "[^\\d+]" ), "" );
+}
+
 static QString replaceTags( const QString& s, const QString& tags, KdeprintFax *fax \
= NULL, const KdeprintFax::FaxItem& item = KdeprintFax::FaxItem() )  {
@@ -191,5 +198,5 @@ static QString replaceTags( const QStrin
                         // arguments
                         else if (match=="%number")
-                                v = quote(item.number);
+                                v = quote( stripNumber( item.number) );
                         else if (match=="%name")
                                 v = quote(item.name);


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

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