]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
few tweak (with destructor)
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 7 Aug 2014 18:29:42 +0000 (20:29 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Thu, 7 Aug 2014 18:29:42 +0000 (20:29 +0200)
mainwindow.cpp

index 72709c934a4465c340743d3e6ffa6798ef076015..46a581bb9c0da2980540c532c3ae8f4cacc8882f 100644 (file)
@@ -78,11 +78,20 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
     //start();
 }
 void MainWindow::start(){
+    QString a=conf->value(QString("currenttype")).toString();
     way=conf->value(QString("start")).toStringList();
-    if(!way.isEmpty())get(conf->value(QString("currenttype")).toString(), way.takeLast());
+    QString b=way.last();
+    qDebug()<<"a="<<a<<" b="<<b;
+    get(a, b);
 }
 MainWindow::~MainWindow()
 {
+    conf->setValue(QString("start"), way);
+    //savButtons();
+    db.commit();
+    db.close();
+    qApp->quit();
+
 }
 void MainWindow::setOrientation(ScreenOrientation orientation)
 {
@@ -137,12 +146,8 @@ void MainWindow::showExpanded()
 #endif
 }
 void MainWindow::quit(){
-    qDebug()<<"quit()";
-    conf->setValue(QString("start"), way);
-    //savButtons();
-    db.commit();
-    db.close();
-    qApp->quit();
+    qDebug()<<"quit() way.last()="<<way.last();
+    this->~MainWindow();
 }
 const CLabel* MainWindow::addWidget(const QString &key, const CLabel *a){
     qDebug()<<"addWidget("<<key<<")";
@@ -429,14 +434,13 @@ void MainWindow::flush(){
 }
 CLabel::CLabel( const QString& text, const QSettings & set, QWidget * parent ) : QLabel(parent)
 {
-    //m_style=set.value(QString("buttons")).toString();
     QString a=set.value(QString("currenttype")).toString();
     m_style=set.value(a).toString();
     setText(text);
     setWordWrap(true);
     setLineWidth(5);
     setStyleSheet(m_style);
-    setScaledContents(1);
+    setScaledContents(true);
     setting=&set;
 }
 CLabel::~CLabel()
@@ -867,7 +871,7 @@ void MainWindow::sav(const QString & a){
 }
 void MainWindow::Uisent(){
     qDebug()<<"Uisent";
-    QMessageBox::information(this, trUtf8("Uisent", "pop-up title when buttons has been sent"), trUtf8("sav finish", "pop-up text when buttons has been sent"));
+    QMessageBox::information(this, trUtf8("Uisent", "pop-up title when data has been sent"), trUtf8("sav finish", "pop-up text when data has been sent"));
 }
 void MainWindow::resetRAW(){
     exec(QList<QString>({"delete from raw;"}));
@@ -1013,7 +1017,7 @@ void MainWindow::mass(const QString & type, const QString & column, const QStrin
             exec2(tmp);
         }
     }
-    get(conf->value(QString("currenttype").toString(), lastprint);
+    get(conf->value(QString("currenttype")).toString(), lastprint);
 }
 void MainWindow::addDB(){
     addDB(conf->value(QString("currenttype")).toString());