From 48124dc3d67b5e95c41be0d94d768940de3bdf54 Mon Sep 17 00:00:00 2001 From: Aaron Dewes Date: Sat, 22 Aug 2020 11:39:29 +0200 Subject: [PATCH] Fix PINN for QT5 & latest buildroot Use QT5 features, fix include paths, ... --- recovery/bootselectiondialog.cpp | 6 +++--- recovery/confeditdialog.cpp | 4 ++-- recovery/input.cpp | 6 +++--- recovery/json.cpp | 4 ++-- recovery/languagedialog.cpp | 4 ++-- recovery/mainwindow.cpp | 8 ++++---- recovery/multiimagewritethread.cpp | 4 ++-- recovery/optionsdialog.cpp | 2 +- recovery/passwd.cpp | 2 +- recovery/recovery.pro | 8 +++----- recovery/translation_ca.ts | 9 +-------- recovery/translation_de.ts | 9 +-------- recovery/translation_en.ts | 9 +-------- recovery/translation_es.ts | 9 +-------- recovery/translation_eu.ts | 9 +-------- recovery/translation_fi.ts | 9 +-------- recovery/translation_fr.ts | 9 +-------- recovery/translation_hu.ts | 9 +-------- recovery/translation_it.ts | 9 +-------- recovery/translation_ja.ts | 9 +-------- recovery/translation_ko.ts | 9 +-------- recovery/translation_nl.ts | 9 +-------- recovery/translation_no.ts | 9 +-------- recovery/translation_pl.ts | 9 +-------- recovery/translation_pt.ts | 9 +-------- recovery/translation_ru.ts | 9 +-------- recovery/translation_sv.ts | 9 +-------- recovery/translation_tr.ts | 9 +-------- recovery/translation_zh_TW.ts | 13 +++---------- recovery/util.cpp | 8 ++++---- 30 files changed, 48 insertions(+), 183 deletions(-) diff --git a/recovery/bootselectiondialog.cpp b/recovery/bootselectiondialog.cpp index da192a25f..cdbad4333 100644 --- a/recovery/bootselectiondialog.cpp +++ b/recovery/bootselectiondialog.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +// #include #include #include #include @@ -56,7 +56,7 @@ BootSelectionDialog::BootSelectionDialog( _dsi(dsi), ui(new Ui::BootSelectionDialog), _inSelection(false), - _drive(drive.toAscii()) + _drive(drive.toLatin1()) { setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint); ui->setupUi(this); @@ -391,7 +391,7 @@ void BootSelectionDialog::updateConfig4dsi(QByteArray partition) update->setProcessChannelMode(QProcess::MergedChannels); bool bHDMI=true; QString status = update->readAll(); - QByteArray qba = status.toAscii(); + QByteArray qba = status.toLatin1(); const char * result= qba.constData(); if (status.length()) diff --git a/recovery/confeditdialog.cpp b/recovery/confeditdialog.cpp index 2cffe73dd..253be6310 100644 --- a/recovery/confeditdialog.cpp +++ b/recovery/confeditdialog.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ class ConfEditDialogTab : public QWidget void save() { - QByteArray txt = _textEdit->toPlainText().toAscii(); + QByteArray txt = _textEdit->toPlainText().toLatin1(); if (!_ro && txt != _origData) { diff --git a/recovery/input.cpp b/recovery/input.cpp index 51cd20f44..8b258a17f 100644 --- a/recovery/input.cpp +++ b/recovery/input.cpp @@ -30,7 +30,7 @@ #include #include -#include +// #include #include #include #include @@ -407,7 +407,7 @@ void Kinput::key_repeat() // key press //sim->inject(EV_KEY, key, 1); //sim->inject(EV_SYN, SYN_REPORT, 0); - QWSServer::sendKeyEvent(0, currentKey, modifiers, true, false); + // QWSServer::sendKeyEvent(0, currentKey, modifiers, true, false); } //QTimer::singleShot( (keyState==1) ? 400 : 100, this, SLOT(key_repeat())); keytimer.start( (keyState==1) ? 400:100); @@ -427,7 +427,7 @@ void Kinput::key_repeat() // key release //sim->inject(EV_KEY, key, 0); //sim->inject(EV_SYN, SYN_REPORT, 0); - QWSServer::sendKeyEvent(0, currentKey, modifiers, false, false); + // QWSServer::sendKeyEvent(0, currentKey, modifiers, false, false); } currentKey=0; } diff --git a/recovery/json.cpp b/recovery/json.cpp index 3e9fc1ba5..c18109dfa 100644 --- a/recovery/json.cpp +++ b/recovery/json.cpp @@ -1,6 +1,6 @@ #include "json.h" -#include -#include +#include +#include #include #include diff --git a/recovery/languagedialog.cpp b/recovery/languagedialog.cpp index c93b70abd..a895bfe9d 100644 --- a/recovery/languagedialog.cpp +++ b/recovery/languagedialog.cpp @@ -16,8 +16,8 @@ #include #include #include -#include -#include +// #include +// #include #include #include diff --git a/recovery/mainwindow.cpp b/recovery/mainwindow.cpp index 643343629..5ce975d9e 100644 --- a/recovery/mainwindow.cpp +++ b/recovery/mainwindow.cpp @@ -1659,7 +1659,7 @@ void MainWindow::displayMode(int modenr, bool silent) // Refresh screen qApp->processEvents(); - QWSServer::instance()->refresh(); + // QWSServer::instance()->refresh(); // In case they can't see the message box, inform that mode change // is occurring by turning on the LED during the change @@ -1737,7 +1737,7 @@ bool MainWindow::eventFilter(QObject *, QEvent *event) fontsize++; QString stylesheet = "* {font-size: "+QString::number(fontsize)+"pt }"; gApp->setStyleSheet(stylesheet); - QWSServer::instance()->refresh(); + // QWSServer::instance()->refresh(); //qDebug() << "Using fontsize "<key() == Qt::Key_Minus && fontsize >11) @@ -1745,7 +1745,7 @@ bool MainWindow::eventFilter(QObject *, QEvent *event) fontsize--; QString stylesheet = "* {font-size: "+QString::number(fontsize)+"pt }"; gApp->setStyleSheet(stylesheet); - QWSServer::instance()->refresh(); + // QWSServer::instance()->refresh(); //qDebug() << "Using fontsize "< maxLabelLen) { //restrict to maximum size - label = shorten(label, maxLabelLen).toAscii(); + label = shorten(label, maxLabelLen).toLatin1(); } if (!isLabelAvailable(label, device)) @@ -1114,7 +1114,7 @@ QStringList MultiImageWriteThread::parseQuotedString(const QString &tarfile, int int inc=0; QChar c = tarfile.at(pos); - switch(c.toAscii()) + switch(c.toLatin1()) { case '\"': inQuote = 1-inQuote; diff --git a/recovery/optionsdialog.cpp b/recovery/optionsdialog.cpp index 2eb909b6c..3c339093d 100644 --- a/recovery/optionsdialog.cpp +++ b/recovery/optionsdialog.cpp @@ -276,7 +276,7 @@ void OptionsDialog::write() QFile f("/mnt/recovery.cmdline"); if (f.open(QIODevice::WriteOnly)) { - f.write(contents.toAscii()); + f.write(contents.toLatin1()); f.close(); } } diff --git a/recovery/passwd.cpp b/recovery/passwd.cpp index 1b23d85bf..02bf30869 100644 --- a/recovery/passwd.cpp +++ b/recovery/passwd.cpp @@ -31,7 +31,7 @@ void Passwd::on_passwordEdit_textChanged(const QString &pass) QString Passwd::strReverse(QString str) { - QByteArray ba = str.toAscii(); + QByteArray ba = str.toLatin1(); char *d = ba.data(); std::reverse(d, d+str.length()); return QString(d); diff --git a/recovery/recovery.pro b/recovery/recovery.pro index 3703c5076..ac5c686fe 100644 --- a/recovery/recovery.pro +++ b/recovery/recovery.pro @@ -4,11 +4,9 @@ # #------------------------------------------------- -QT += core gui network dbus +QT += core gui network dbus widgets multimedia -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -RPI_USERLAND_DIR=../../staging/usr +RPI_USERLAND_DIR=../../host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr exists($${RPI_USERLAND_DIR}/include/interface/vmcs_host/vc_cecservice.h) { INCLUDEPATH += $${RPI_USERLAND_DIR}/include $${RPI_USERLAND_DIR}/include/interface/vcos/pthreads LIBS += -lbcm_host -lvcos -lvchiq_arm -lvchostif -L$${RPI_USERLAND_DIR}/lib -lrt -ldl @@ -20,7 +18,7 @@ exists($${RPI_USERLAND_DIR}/include/interface/vmcs_host/vc_cecservice.h) { TARGET = recovery TEMPLATE = app -LIBS += -lqjson +LIBS += -lqjson-qt5 system(sh updateqm.sh 2>/dev/null) diff --git a/recovery/translation_ca.ts b/recovery/translation_ca.ts index f11dce78b..01bd25079 100644 --- a/recovery/translation_ca.ts +++ b/recovery/translation_ca.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -651,13 +651,6 @@ WARNING: This will erase all data on your SD card Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_de.ts b/recovery/translation_de.ts index fdad1c17d..b1afcb5a9 100644 --- a/recovery/translation_de.ts +++ b/recovery/translation_de.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ Achtung: Dies löscht alle Ihre Daten auf der SD-Karte Clone (c) Klonen (c) - - - - - C - C - Advanced diff --git a/recovery/translation_en.ts b/recovery/translation_en.ts index c53e2b0c9..14f6adc03 100644 --- a/recovery/translation_en.ts +++ b/recovery/translation_en.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -704,13 +704,6 @@ WARNING: This will erase all data on your SD card Clone (c) - - - - - C - - Setting up SD card diff --git a/recovery/translation_es.ts b/recovery/translation_es.ts index b6d23f907..c380f8428 100644 --- a/recovery/translation_es.ts +++ b/recovery/translation_es.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -672,13 +672,6 @@ ADVERTENCIA: Esto borrará todos los datos de tu tarjeta SD Clone (c) Clonar (c) - - - - - C - C - Advanced diff --git a/recovery/translation_eu.ts b/recovery/translation_eu.ts index 08ed4128d..b7290a995 100644 --- a/recovery/translation_eu.ts +++ b/recovery/translation_eu.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -656,13 +656,6 @@ KONTUZ: Honek zure SD txarteleko datu guztiak ezabatuko ditu Clone (c) Klonatu (c) - - - - - C - C - Advanced diff --git a/recovery/translation_fi.ts b/recovery/translation_fi.ts index 4f8a1efb3..b3cda4912 100644 --- a/recovery/translation_fi.ts +++ b/recovery/translation_fi.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -651,13 +651,6 @@ WARNING: This will erase all data on your SD card Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_fr.ts b/recovery/translation_fr.ts index 6fd6a999e..7867cefa0 100644 --- a/recovery/translation_fr.ts +++ b/recovery/translation_fr.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ WARNING: This will erase all data on your SD card Clone (c) Cloner (c) - - - - - C - - Advanced diff --git a/recovery/translation_hu.ts b/recovery/translation_hu.ts index d0ac253c2..af37c39eb 100644 --- a/recovery/translation_hu.ts +++ b/recovery/translation_hu.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ FIGYELEM: ez letörli az SD kártyát lévő összes adatot Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_it.ts b/recovery/translation_it.ts index 97c326aef..75819b807 100644 --- a/recovery/translation_it.ts +++ b/recovery/translation_it.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -655,13 +655,6 @@ Riformattala usando il programma della SD Association e riprova. Clone (c) Clona (c) - - - - - C - C - Advanced diff --git a/recovery/translation_ja.ts b/recovery/translation_ja.ts index c7501d76b..613ad5c33 100644 --- a/recovery/translation_ja.ts +++ b/recovery/translation_ja.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ WARNING: This will erase all data on your SD card Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_ko.ts b/recovery/translation_ko.ts index 06b63d35b..1e2f721f6 100644 --- a/recovery/translation_ko.ts +++ b/recovery/translation_ko.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -702,13 +702,6 @@ WARNING: This will erase all data on your SD card Clone (c) 복제 (C) - - - - - C - C - Setting up SD card diff --git a/recovery/translation_nl.ts b/recovery/translation_nl.ts index 484782519..50c7b5250 100644 --- a/recovery/translation_nl.ts +++ b/recovery/translation_nl.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ WAARSCHUWING: Dit verwijdert alle bestaande bestanden op de SD kaartClone (c) - - - - - C - - Advanced diff --git a/recovery/translation_no.ts b/recovery/translation_no.ts index a632c6f9d..535f7351a 100644 --- a/recovery/translation_no.ts +++ b/recovery/translation_no.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -651,13 +651,6 @@ WARNING: This will erase all data on your SD card Clone (c) Klon (c) - - - - - C - C - Advanced diff --git a/recovery/translation_pl.ts b/recovery/translation_pl.ts index 0cc1a6708..f3b1f9bfd 100644 --- a/recovery/translation_pl.ts +++ b/recovery/translation_pl.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ UWAGA: To usunie wszystkie dane zapisane na karcie SD Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_pt.ts b/recovery/translation_pt.ts index 86ccdb9d0..2bbc9cb1a 100644 --- a/recovery/translation_pt.ts +++ b/recovery/translation_pt.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ AVISO: Isto irá apagar todos os dados do seu cartão SD Clone (c) Clonar (c) - - - - - C - C - Advanced diff --git a/recovery/translation_ru.ts b/recovery/translation_ru.ts index 6678ed829..ede5d3d01 100644 --- a/recovery/translation_ru.ts +++ b/recovery/translation_ru.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ WARNING: This will erase all data on your SD card Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_sv.ts b/recovery/translation_sv.ts index 1085095ef..8411c4da8 100644 --- a/recovery/translation_sv.ts +++ b/recovery/translation_sv.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ VARNING: Detta kommer radera all data på ditt SD-kort Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_tr.ts b/recovery/translation_tr.ts index 618198e26..b1fb60593 100644 --- a/recovery/translation_tr.ts +++ b/recovery/translation_tr.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ UYARI: Bu işlem SD kartınızdaki tüm verileri silecektir Clone (c) - - - - - C - - Advanced diff --git a/recovery/translation_zh_TW.ts b/recovery/translation_zh_TW.ts index e81aaebd3..ef90c2b21 100644 --- a/recovery/translation_zh_TW.ts +++ b/recovery/translation_zh_TW.ts @@ -1,6 +1,6 @@ - + BackupThread @@ -652,13 +652,6 @@ WARNING: This will erase all data on your SD card Clone (c) 再製 (c) - - - - - C - C - Advanced @@ -1747,7 +1740,7 @@ Partition not big enough for new image. When used in conjunction with forcetrigger it sets a maximum timeout period in seconds for the recovery menu to be displayed before continuing to the boot selection dialog and potentially selecting a default OS to boot. - When used in conjunction with forcetrigger it sets a maximum timeout period in seconds for the recovery menu to be displayed before continuing to the boot selection dialog and potentially selecting a default OS to boot. + When used in conjunction with forcetrigger it sets a maximum timeout period in seconds for the recovery menu to be displayed before continuing to the boot selection dialog and potentially selecting a default OS to boot. 當與 forcetrigger 一起使用時,它會設定一個最大逾時(以秒為單位),以便在繼續開機選取對話框前顯示復原選單,並可以選取要開機的預設作業系統。 @@ -1785,7 +1778,7 @@ Partition not big enough for new image. Uses a VNC network connection to control PINN. However, unlike vncinstall, any locally attached keyboard and mouse will still be active and the display will be duplicated to the local screen and the VNC connection. - Uses a VNC network connection to control PINN. However, unlike vncinstall, any locally attached keyboard and mouse will still be active and the display will be duplicated to the local screen and the VNC connection. + Uses a VNC network connection to control PINN. However, unlike vncinstall, any locally attached keyboard and mouse will still be active and the display will be duplicated to the local screen and the VNC connection. 使用 VNC 網路連線控制 PINN。但不像 vncinstall,任何本機連線的鍵盤與滑鼠都還是可以使用,而顯示畫面也會在本機螢幕與 VNC 連線上同步顯示。 diff --git a/recovery/util.cpp b/recovery/util.cpp index 59a8fba10..764eca29e 100644 --- a/recovery/util.cpp +++ b/recovery/util.cpp @@ -220,9 +220,9 @@ void reboot() QByteArray partdev(const QString &drivedev, int nr) { if (drivedev.right(1).at(0).isDigit()) - return drivedev.toAscii()+"p"+QByteArray::number(nr); + return drivedev.toLatin1()+"p"+QByteArray::number(nr); else - return drivedev.toAscii()+QByteArray::number(nr); + return drivedev.toLatin1()+QByteArray::number(nr); } /* Returns /sys/class/block path for given drive and optional partition number */ @@ -231,7 +231,7 @@ QByteArray sysclassblock(const QString &drivedev, int partnr) QByteArray b; if (partnr == -1) - b = drivedev.toAscii(); + b = drivedev.toLatin1(); else b = partdev(drivedev, partnr); @@ -312,7 +312,7 @@ QByteArray getDevice(const QString & partuuid) QByteArray device; if (partuuid.left(4)=="/dev") - device = partuuid.toAscii(); + device = partuuid.toLatin1(); else { QProcess p;