Skip to content

Commit

Permalink
Fix PINN for QT5 & latest buildroot
Browse files Browse the repository at this point in the history
Use QT5 features, fix include paths, ...
  • Loading branch information
AaronDewes committed Aug 22, 2020
1 parent 97e9d79 commit 48124dc
Show file tree
Hide file tree
Showing 30 changed files with 48 additions and 183 deletions.
6 changes: 3 additions & 3 deletions recovery/bootselectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <QSettings>
#include <QDesktopWidget>
#include <QScreen>
#include <QWSServer>
// #include <QWSServer>
#include <QRegExp>
#include <QDebug>
#include <QMouseEvent>
Expand All @@ -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);
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions recovery/confeditdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include <QDir>
#include <QFile>
#include <QtGui/QPlainTextEdit>
#include <QPlainTextEdit>
#include <QProcess>
#include <QMessageBox>
#include <unistd.h>
Expand Down Expand Up @@ -48,7 +48,7 @@ class ConfEditDialogTab : public QWidget

void save()
{
QByteArray txt = _textEdit->toPlainText().toAscii();
QByteArray txt = _textEdit->toPlainText().toLatin1();

if (!_ro && txt != _origData)
{
Expand Down
6 changes: 3 additions & 3 deletions recovery/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <linux/input.h>
#include <linux/uinput.h>

#include <QWSServer>
// #include <QWSServer>
#include <QTimer>
#include <QApplication>
#include <QDesktopWidget>
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions recovery/json.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "json.h"
#include <qjson/parser.h>
#include <qjson/serializer.h>
#include <qjson-qt5/parser.h>
#include <qjson-qt5/serializer.h>
#include <QDebug>
#include <QFile>

Expand Down
4 changes: 2 additions & 2 deletions recovery/languagedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include <QDir>
#include <QLocale>
#include <QKeyEvent>
#include <QWSServer>
#include <QKbdDriverFactory>
// #include <QWSServer>
// #include <QKbdDriverFactory>
#include <QProcess>
#include <QSettings>

Expand Down
8 changes: 4 additions & 4 deletions recovery/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1737,15 +1737,15 @@ 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 "<<fontsize;
}
if (keyEvent->key() == Qt::Key_Minus && fontsize >11)
{
fontsize--;
QString stylesheet = "* {font-size: "+QString::number(fontsize)+"pt }";
gApp->setStyleSheet(stylesheet);
QWSServer::instance()->refresh();
// QWSServer::instance()->refresh();
//qDebug() << "Using fontsize "<<fontsize;
}

Expand Down Expand Up @@ -2800,7 +2800,7 @@ void MainWindow::downloadMetaComplete()
QString path = finfo.path() + QString("/error.log");
QFile f(path);
f.open(f.Append);
f.write(error.toAscii());
f.write(error.toLatin1());
f.close();
}
else
Expand Down
4 changes: 2 additions & 2 deletions recovery/multiimagewritethread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ QByteArray MultiImageWriteThread::makeLabelUnique(QByteArray label, int maxLabel
{
if (label.size() > maxLabelLen)
{ //restrict to maximum size
label = shorten(label, maxLabelLen).toAscii();
label = shorten(label, maxLabelLen).toLatin1();
}

if (!isLabelAvailable(label, device))
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion recovery/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion recovery/passwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 3 additions & 5 deletions recovery/recovery.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_ca.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="ca_ES">
<TS version="2.1" language="ca_ES">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -651,13 +651,6 @@ WARNING: This will erase all data on your SD card</oldsource>
<source>Clone (c)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_de.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de" sourcelanguage="en">
<TS version="2.1" language="de" sourcelanguage="en">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -652,13 +652,6 @@ Achtung: Dies löscht alle Ihre Daten auf der SD-Karte</translation>
<source>Clone (c)</source>
<translation>Klonen (c)</translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation>C</translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_en.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
<TS version="2.1" language="en_US">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -704,13 +704,6 @@ WARNING: This will erase all data on your SD card</oldsource>
<source>Clone (c)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="293"/>
<source>Setting up SD card</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_es.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="es_ES" sourcelanguage="en">
<TS version="2.1" language="es_ES" sourcelanguage="en">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -672,13 +672,6 @@ ADVERTENCIA: Esto borrará todos los datos de tu tarjeta SD</translation>
<source>Clone (c)</source>
<translation>Clonar (c)</translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation>C</translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_eu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="eu_ES">
<TS version="2.1" language="eu_ES">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -656,13 +656,6 @@ KONTUZ: Honek zure SD txarteleko datu guztiak ezabatuko ditu</translation>
<source>Clone (c)</source>
<translation>Klonatu (c)</translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation>C</translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_fi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fi_FI" sourcelanguage="en">
<TS version="2.1" language="fi_FI" sourcelanguage="en">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -651,13 +651,6 @@ WARNING: This will erase all data on your SD card</oldsource>
<source>Clone (c)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_fr.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr" sourcelanguage="en">
<TS version="2.1" language="fr" sourcelanguage="en">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -652,13 +652,6 @@ WARNING: This will erase all data on your SD card</oldsource>
<source>Clone (c)</source>
<translation>Cloner (c)</translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_hu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="hu" sourcelanguage="en">
<TS version="2.1" language="hu" sourcelanguage="en">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -652,13 +652,6 @@ FIGYELEM: ez letörli az SD kártyát lévő összes adatot</translation>
<source>Clone (c)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
9 changes: 1 addition & 8 deletions recovery/translation_it.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="it" sourcelanguage="en">
<TS version="2.1" language="it" sourcelanguage="en">
<context>
<name>BackupThread</name>
<message>
Expand Down Expand Up @@ -655,13 +655,6 @@ Riformattala usando il programma della SD Association e riprova.</translation>
<source>Clone (c)</source>
<translation>Clona (c)</translation>
</message>
<message>
<location filename="mainwindow.ui" line="583"/>
<location filename="mainwindow.ui" line="649"/>
<location filename="mainwindow.ui" line="694"/>
<source>C</source>
<translation>C</translation>
</message>
<message>
<location filename="mainwindow.ui" line="338"/>
<source>Advanced</source>
Expand Down
Loading

0 comments on commit 48124dc

Please sign in to comment.