]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
try qdom ... (but fail)
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sun, 4 May 2014 21:14:27 +0000 (23:14 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Sun, 4 May 2014 21:14:27 +0000 (23:14 +0200)
diary-mobile-android.pro
mainwindow.cpp
mainwindow.h

index 70f019aaf0527281976167bfb7f5ca829d6384e2..8979512cec5fbb126662dcaac6e6c380eeee96da 100644 (file)
@@ -4,7 +4,7 @@
 #
 #-------------------------------------------------
 
-QT       += core gui network sql
+QT       += core gui network sql xml
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
index e68e442f9c13b678c818ee29e226d9c09b0ab295..2ad62326c1021ba9e448394da74ed44b13a46bea 100644 (file)
@@ -154,7 +154,7 @@ void MainWindow::action(const QString &a){
         entry(c);
     }
     else if(b[0]=="back"){
-        if(way.size()>2){
+        if(way.size()>=2){
             way.removeLast();
             getButtons(way.takeLast());
         }
@@ -524,6 +524,7 @@ QByteArray FileDownloader::downloadedData() const
     return m_DownloadedData;
 }
 void MainWindow::readButtons(const QByteArray &in){
+    qDebug()<<"readButtons";
     int a=in.count('\n');
     QString d=in.split('\n').at(0);
     conf->setValue(QString("firstline"), d);
@@ -539,10 +540,30 @@ void MainWindow::readButtons(const QByteArray &in){
         qDebug()<<"q->exec() : "<<q->exec()<<" lastError()="<<q->lastError();
 
     };
-    /*bool ok = xml.parse(*in);
-    if (!ok)qDebug() << "Parsing failed.\n";*/
     db.commit();
     flush();
+
+    /*QDomDocument a("buttons");
+    if (!a.setContent(in)){
+            qDebug()<<"a.setcontent failed";
+            return;
+    }
+    QDomElement root = a.documentElement();
+    QDomNode n = root.firstChildElement();
+    QList<QString> cmd;
+    while(!n.isNull()) {
+        QDomNode e = n.firstChildElement();
+        if((cmd.size()<1)&&(n.isText()))e.toText().nodeValue();
+        qDebug()<<"n.nodeName()="<<n.nodeName()<<" n.nodevalue="<<n.nodeValue();
+        while(!e.isNull()){
+            qDebug()<<"e.nodeName = "<<e.nodeName()<<" e.nodevalue="<<e.nodeValue();
+            e.nextSiblingElement();
+
+            }
+        n.nextSiblingElement();
+        }*/
+
+
     emit datafilled();
 }
 void MainWindow::datasent(){
index ad528b18a07dfc30486f6f6aace01b69633143e8..97daecb46ba40ebc0633ad3c16948e626f611eca 100644 (file)
@@ -4,7 +4,7 @@
 #include <QMainWindow>
 //#include <QtGui> don't work since 5.1 (or 5.2)
 #include <QtNetwork/QtNetwork>
-
+//#include <QtXml/QDomDocument>
 #include <QGridLayout>
 #include <QLabel>
 #include <QLineEdit>