]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
copyright 2020
authorgaby <gaby@nothing2do.fr>
Wed, 17 Jun 2020 13:27:59 +0000 (15:27 +0200)
committergaby <gaby@nothing2do.fr>
Wed, 17 Jun 2020 13:27:59 +0000 (15:27 +0200)
diary-mobile.pro
mainwindow.cpp

index 2ce2f039d173cb64d4660e9086186feae7829fe8..c85e13e592ff4f0ef79fe82bd2141b24bca391d4 100644 (file)
@@ -27,7 +27,7 @@ CONFIG += mobility c++11
 MOBILITY =
 QMAKE_CXXFLAGS += -fpermissive -Wswitch
 TRANSLATIONS = diary-mobile_fr_FR.ts diary-mobile_en_EN.ts
-# ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
+#ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
 
 OTHER_FILES += \
     android/AndroidManifest.xml \
index 0e1f5626bcbc19766eb21eaf2a027d59b3d6c897..26b20477554e3177d21ae20431060e364e27e253 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2019, PIOT Gabriel
+// Copyright (c) 2014-2020, PIOT Gabriel
 // All rights reserved.
 
 // Redistribution and use in source and binary forms, with or without modification,
@@ -48,11 +48,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
         qDebug()<<"first";
         d.lock();
         firstrun();
-        download(QString("http://www.nothing2do.eu/diary-mobile_")+ QLocale::system().name()+QString(".qm"));
+        download(QString("http://www.nothing2do.fr/diary-mobile_")+ QLocale::system().name()+QString(".qm"));
         connect(m, SIGNAL(downloaded()), SLOT(writeTr()));
 
         conf->setValue(QString("first"), 1);
-    };
+    }
     deb=0;
     page=0;
     np=0;
@@ -61,7 +61,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
     screen->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
     grid=new QGridLayout(screen);
     grid->setSizeConstraint(QLayout::SetMinAndMaxSize);
-    signalmap=new QSignalMapper(this);
+    //signalmap=new QSignalMapper(this);
     //shell=new QProcess(this);a desperated attempt to get the output of my cmd, i've try Qprocess (but don't get it)
     valeur=new QMap<QString, QString>;
     qDebug()<<"1' connect : "<<connect(signalmap, SIGNAL(mapped(const QString &)), this, SLOT(action(const QString &)));
@@ -81,7 +81,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
         conf->setValue(QString("init"), ser);
         downSQL(ser);
         conf->setValue(QString("first"), 2);
-    };
+    }
     statusBar()->addPermanentWidget(label);
     menuBar()->setVisible(conf->value(QString("menu")).toBool());
     //menuBar()->setVisible(true);
@@ -118,7 +118,7 @@ void MainWindow::setOrientation(ScreenOrientation orientation)
     }
 #endif // Q_OS_SYMBIAN
 
-    Qt::WidgetAttribute attribute;
+    //Qt::WidgetAttribute attribute;
     switch (orientation) {
 #if QT_VERSION < 0x040702
     // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
@@ -139,12 +139,11 @@ void MainWindow::setOrientation(ScreenOrientation orientation)
     case ScreenOrientationLockLandscape:
         //attribute = Qt::WA_LockLandscapeOrientation;
         break;
-    default:
     case ScreenOrientationAuto:
         //attribute = Qt::WA_AutoOrientation;
         break;
 #endif // QT_VERSION > 0x040702
-    };
+    }
     //setAttribute(attribute, true);
 }
 void MainWindow::showExpanded()
@@ -294,7 +293,7 @@ void MainWindow::action(const QString &a){
     else if(b[0]==QString("prevpage")){
         qDebug()<<"page="<<--page;
         bool tmp;
-        int t=grid->count();
+        //int t=grid->count();
         flush();
         int max=conf->value(QString("maxcolumn")).toInt()*conf->value(QString("maxline")).toInt();
         if(!page)tmp=q->seek(0);
@@ -375,7 +374,7 @@ void MainWindow::action(const QString &a){
             qDebug()<<"but : "<<c;
         }else{
             downloadData();
-        };
+        }
         connect(m, SIGNAL(downloaded()), SLOT(writeData()));
     }
     else if(b[0]==QString("down")){
@@ -750,7 +749,7 @@ void MainWindow::entry(const QString &a){
             qDebug()<<"way["<<b<<"]="<<way[b];
             context.append(way[b]);
             context.append(" ");
-        };
+        }
     //};
     context.append(way.last());
 
@@ -788,7 +787,7 @@ void MainWindow::addDB(const QString & tmp, const QString & cur){
     if(a.contains(QString("!file!"))){
         tmpfile=QFileDialog::getOpenFileName();
         a.replace(QString("!file!"),tmpfile);
-    };
+    }
     /*if(a.contains(QString("!label"))){
         a.replace(QString("!label!"), label->text());
     };*/
@@ -844,7 +843,7 @@ void MainWindow::chooseDB(const QString & a,const QString & b){
     }
 }
 void MainWindow::editDB(const QString & a, const QString & b){
-    QString tmp=conf->value(QString("edit")+a).toString(), txt="type="+a+" id="+b;;
+    QString tmp=conf->value(QString("edit")+a).toString(), txt="type="+a+" id="+b;
 
     if(deb)QMessageBox::information(this, tr("EditDB", "box title to debug editDB"), txt);
 
@@ -870,7 +869,7 @@ void MainWindow::editDB(const QString & a, const QString & b){
     if(tmpaction.contains(QString("!file!"))){
         tmpfile=QFileDialog::getOpenFileName();
         tmpaction.replace(QString("!file!"),tmpfile);
-    };
+    }
 
 
     if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){
@@ -946,7 +945,7 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
             action(a);
         }else{
             action(QString("-"+beforekey));
-        };
+        }
     }else if(k==Qt::Key_Back){
         const QString a=conf->value(QString("menuback"), QString("")).toString();
         if((a=="")&&(accepted))accepted=0;
@@ -956,7 +955,7 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
             action(a);
         }else{
             action(QString("-"+beforekey));
-        };
+        }
     }else if(k==Qt::Key_VolumeDown){
         qDebug()<<"keyvolumdown";
         const QString a=conf->value(QString("volumdown"), QString("")).toString();
@@ -967,7 +966,7 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
             action(a);
         }else{
             action(QString("-"+beforekey));
-        };
+        }
     }else if(k==Qt::Key_VolumeUp){
         const QString a=conf->value(QString("volumup"), QString("")).toString();
         if((a=="")&&(accepted))accepted=0;
@@ -977,8 +976,8 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event)
             action(a);
         }else{
             action(QString("-"+beforekey));
-        };
-    };
+        }
+    }
     event->setAccepted(accepted);
 }
 void CLabel::SetTextToLabel(const QString& text)
@@ -1033,7 +1032,7 @@ void MainWindow::read(const QString &a, const QByteArray &in){
         }
         qDebug()<<"q->exec() : "<<q->exec()<<" lastError()="<<q->lastError();
 
-    };
+    }
     db.commit();
     emit datafilled();
 }
@@ -1141,7 +1140,7 @@ void MainWindow::insert(const QString & type, const QString & keyword, const QSt
     if(deb)QMessageBox::information(this, tr("action", "box title to debug insert"), tr("insert : key="+key.toLocal8Bit()+" label="+label.toLocal8Bit()+" action="+action.toLocal8Bit(), "label to debug insert"));
     if(!id.isValid())exec(QList<QString>({conf->value(QString("add")+type).toString(), key, label, action}));
     else{exec(QList<QString>({conf->value(QString("update")+type).toString(), key, label, action, id.toString()}));
-    };
+    }
 
 }
 void MainWindow::remove(const QString & type, const QString & keyword, const QString & label, const QString & action){
@@ -1318,7 +1317,7 @@ bool MainWindow::printItem(QSqlQuery & a){
         QString tmp("prevpage");
         addWidget(tmp, new CLabel(tr("Prev"), *conf));
 
-    };
+    }
     bool t;
     do{
         int tmp=0;
@@ -1328,7 +1327,7 @@ bool MainWindow::printItem(QSqlQuery & a){
             QString tmp3("nextpage");
             addWidget(tmp3, new CLabel(tr("Next"), *conf));
             return 1;
-        };
+        }
         i++;
         t=a.next();
     }while(t);