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

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

CVS commit by goffioul: 

[Backport] 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.25.2.1


--- kdebase/kdeprint/kdeprintfax/faxctrl.cpp  #1.25:1.25.2.1
@@ -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+]" ), "" );
+}
+
 FaxCtrl::FaxCtrl(QObject *parent, const char *name)
 : QObject(parent, name)
@@ -208,5 +215,5 @@ bool FaxCtrl::send(KdeprintFax *f)
                         // arguments
                         else if (match=="%number")
-                                v = quote(f->number());
+                                v = quote(stripNumber(f->number()));
                         else if (match=="%name")
                                 v = quote(f->name());


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

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