From bec1a68247162bc61a00a1f90133e0b751a79d42 Mon Sep 17 00:00:00 2001 From: gaby Date: Wed, 17 Jun 2020 15:27:59 +0200 Subject: [PATCH] copyright 2020 --- diary-mobile.pro | 2 +- mainwindow.cpp | 45 ++++++++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/diary-mobile.pro b/diary-mobile.pro index 2ce2f03..c85e13e 100644 --- a/diary-mobile.pro +++ b/diary-mobile.pro @@ -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 \ diff --git a/mainwindow.cpp b/mainwindow.cpp index 0e1f562..26b2047 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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; qDebug()<<"1' connect : "<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 : "<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() : "<exec()<<" lastError()="<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({conf->value(QString("add")+type).toString(), key, label, action})); else{exec(QList({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); -- 2.45.1