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

List:       kde-commits
Subject:    extragear/pim/ksig
From:       Pino Toscano <pino () kde ! org>
Date:       2012-09-22 16:09:54
Message-ID: 20120922160954.80EF0AC7E8 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1317359 by pino:

SigModel: move nodeToText and signatureString as really internal

move them as static functions inside the SigModel implementation file,
as they don't even need to be exposed in the class definition


 M  +25 -24    sigmodel.cpp  
 M  +0 -2      sigmodel.h  


--- trunk/extragear/pim/ksig/sigmodel.cpp #1317358:1317359
@@ -18,6 +18,31 @@
 #include <klocale.h>
 #include <kstandarddirs.h>
 
+static void nodeToText(const QDomNode &n, QString &s)
+{
+    QDomNodeList children = n.childNodes();
+
+    for(int i = 0; i < children.count(); i++) {
+	if(children.item(i).isText())
+	    s.append(children.item(i).toText().data());
+	else {
+	    nodeToText(children.item(i), s);
+	    if(children.item(i).isElement() && children.item(i).toElement().tagName() == "p") {
+		s.append("\n");
+	    }
+	}
+    }
+}
+
+static QString signatureString(const QDomNode &n)
+{
+    QString text;
+    nodeToText(n, text);
+    text.replace(QRegExp("\n$"), "");
+    return text;
+}
+
+
 SigModel::SigModel(QObject *parent) : QAbstractItemModel(parent)
 {
     QString dir = KGlobal::dirs()->saveLocation("appdata");
@@ -157,30 +182,6 @@
     }
 }
 
-QString SigModel::signatureString(const QDomNode &n)
-{
-    QString text;
-    nodeToText(n, text);
-    text.replace(QRegExp("\n$"), "");
-    return text;
-}
-
-void SigModel::nodeToText(const QDomNode &n, QString &s)
-{
-    QDomNodeList children = n.childNodes();
-
-    for(int i = 0; i < children.count(); i++) {
-	if(children.item(i).isText())
-	    s.append(children.item(i).toText().data());
-	else {
-	    nodeToText(children.item(i), s);
-	    if(children.item(i).isElement() && children.item(i).toElement().tagName() == "p") {
-		s.append("\n");
-	    }
-	}
-    }
-}
-
 QString SigModel::emptySignatureString() const
 {
     if(m_emptySigString.isEmpty())
--- trunk/extragear/pim/ksig/sigmodel.h #1317358:1317359
@@ -38,8 +38,6 @@
     void save();
 
 private:
-    static QString signatureString(const QDomNode &n);
-    static void nodeToText(const QDomNode &n, QString &s);
     QString emptySignatureString() const;
     void load(const QString &fileName);
     void updateNode(QDomNode element, const QString &text);
[prev in list] [next in list] [prev in thread] [next in thread] 

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