qtadb/qtadb-0.8.1.20160727git-revert-to-qt4.patch

847 lines
31 KiB
Diff

From ccbb0c86c9eb9362a378db9f6c2a6b48b5d72c07 Mon Sep 17 00:00:00 2001
From: ryba <7ymekk@gmail.com>
Date: Sat, 22 Nov 2014 12:44:42 +0100
Subject: [PATCH] Qt5.3
---
classes/animation.h | 3 +-
classes/models/contactmodel.cpp | 6 ++-
classes/models/contactmodel.h | 2 +
classes/models/messagemodel.cpp | 6 ++-
classes/models/messagemodel.h | 2 +
classes/models/messagethreadmodel.cpp | 7 ++-
classes/models/messagethreadmodel.h | 2 +
classes/mytableview.cpp | 2 +
classes/phone.cpp | 12 +++--
dialogs/connectWifi.cpp | 4 +-
dialogs/connectWifi.h | 2 +-
dialogs/logcatdialog.cpp | 4 ++
dialogs/mainwindow.cpp | 22 +++++----
dialogs/mainwindow.h | 3 +-
dialogs/registerdialog.cpp | 2 +-
main.cpp | 87 ++++++++++++++++++++++++-----------
threads/screenshotthread.cpp | 2 +-
widgets/appwidget.cpp | 25 +++++-----
widgets/contactwidget.cpp | 2 +-
widgets/fastbootwidget.cpp | 3 ++
widgets/fastbootwidget.h | 2 +-
widgets/filewidget.cpp | 22 +++++----
widgets/messagewidget.cpp | 1 +
widgets/recoverywidget.cpp | 2 +
widgets/screenshotwidget.cpp | 3 ++
widgets/screenshotwidget.h | 2 +-
widgets/settingswidget.cpp | 8 +++-
widgets/shellwidget.cpp | 15 ++++--
widgets/shellwidget.h | 3 +-
29 files changed, 175 insertions(+), 81 deletions(-)
diff --git a/classes/animation.h b/classes/animation.h
index c57ea26..b13f046 100644
--- a/classes/animation.h
+++ b/classes/animation.h
@@ -21,7 +21,8 @@
#ifndef ANIMATION_H
#define ANIMATION_H
-#include <QtGui>
+#include <QWidget>
+#include <QPropertyAnimation>
#define UP_TO_DOWN 0
#define DOWN_TO_UP 1
diff --git a/classes/models/contactmodel.cpp b/classes/models/contactmodel.cpp
index 8e1f928..9130629 100644
--- a/classes/models/contactmodel.cpp
+++ b/classes/models/contactmodel.cpp
@@ -80,11 +80,15 @@ bool ContactModel::clear()
ContactModel::ContactModel(QObject *parent)
: QAbstractListModel(parent)
{
+}
+
+QHash<int, QByteArray> ContactModel::roleNames()
+{
QHash<int, QByteArray> roles;
roles[IdRole] = "threadId";
roles[NumberRole] = "number";
roles[NameRole] = "name";
- setRoleNames(roles);
+ return roles;
}
void ContactModel::addContact(const Contact &contact)
diff --git a/classes/models/contactmodel.h b/classes/models/contactmodel.h
index 16073dd..0fb88c7 100644
--- a/classes/models/contactmodel.h
+++ b/classes/models/contactmodel.h
@@ -53,6 +53,8 @@ public:
QString getNumber(QString name);
QString getName(QString number);
+ QHash<int, QByteArray> roleNames();
+
private:
QList<Contact> contacts;
};
diff --git a/classes/models/messagemodel.cpp b/classes/models/messagemodel.cpp
index b587803..3b770e5 100644
--- a/classes/models/messagemodel.cpp
+++ b/classes/models/messagemodel.cpp
@@ -116,6 +116,10 @@ bool MessageModel::clear()
MessageModel::MessageModel(QObject *parent)
: QAbstractListModel(parent)
{
+}
+
+QHash<int, QByteArray> MessageModel::roleNames()
+{
QHash<int, QByteArray> roles;
roles[ThreadIdRole] = "threadId";
roles[MessageIdRole] = "messageId";
@@ -125,7 +129,7 @@ MessageModel::MessageModel(QObject *parent)
roles[ReadRole] = "read";
roles[ToaRole] = "toa";
roles[ContactNameRole] = "contactName";
- setRoleNames(roles);
+ return roles;
}
void MessageModel::addMessage(const Message &message)
diff --git a/classes/models/messagemodel.h b/classes/models/messagemodel.h
index 1a1c2f7..d95a425 100644
--- a/classes/models/messagemodel.h
+++ b/classes/models/messagemodel.h
@@ -64,6 +64,8 @@ public:
void markThreadAsRead(QString id);
bool clear();
+ QHash<int, QByteArray> roleNames();
+
private:
QList<Message> messages;
};
diff --git a/classes/models/messagethreadmodel.cpp b/classes/models/messagethreadmodel.cpp
index 927a8db..0cc0c05 100644
--- a/classes/models/messagethreadmodel.cpp
+++ b/classes/models/messagethreadmodel.cpp
@@ -173,6 +173,11 @@ bool MessageThreadModel::clear()
MessageThreadModel::MessageThreadModel(QObject *parent)
: QAbstractListModel(parent)
{
+
+}
+
+QHash<int, QByteArray> MessageThreadModel::roleNames()
+{
QHash<int, QByteArray> roles;
roles[ThreadIdRole] = "threadId";
roles[MessageCountRole] = "messageCount";
@@ -181,7 +186,7 @@ MessageThreadModel::MessageThreadModel(QObject *parent)
roles[LastBodyRole] = "lastBody";
roles[ReadRole] = "read";
roles[ContactNameRole] = "contactName";
- setRoleNames(roles);
+ return roles;
}
void MessageThreadModel::addThread(const MessageThread &thread)
diff --git a/classes/models/messagethreadmodel.h b/classes/models/messagethreadmodel.h
index a53fef1..8b3515c 100644
--- a/classes/models/messagethreadmodel.h
+++ b/classes/models/messagethreadmodel.h
@@ -65,6 +65,8 @@ public:
void addThread(const MessageThread &thread);
bool clear();
+ QHash<int, QByteArray> roleNames();
+
private:
QList<MessageThread> threads;
};
diff --git a/classes/mytableview.cpp b/classes/mytableview.cpp
index 23f9a04..8116903 100644
--- a/classes/mytableview.cpp
+++ b/classes/mytableview.cpp
@@ -20,6 +20,8 @@
#include "mytableview.h"
+#include <QHeaderView>
+
MyTableView::MyTableView(QWidget *parent) :
QTableView(parent)
{
diff --git a/classes/phone.cpp b/classes/phone.cpp
index 217f984..d072285 100644
--- a/classes/phone.cpp
+++ b/classes/phone.cpp
@@ -21,7 +21,9 @@
#include "phone.h"
#include <QSettings>
#include <QTextCodec>
-
+#include <QFileIconProvider>
+#include <QApplication>
+#include <QStyle>
void ConnectionThread::run()
{
@@ -324,7 +326,7 @@ QList<File> *Phone::getFileList()
tmpFile.fileColor = QColor(Qt::black);
name.remove(QRegExp("\\[\\d;\\d+m"));
- tmpFile.fileName = QString::fromUtf8(name.toAscii());
+ tmpFile.fileName = QString::fromUtf8(name.toLatin1());
tmpFile.filePath = this->getPath() + tmpFile.fileName;
qDebug()<<"Phone::getFileList() - plik: "<<name<< " - " <<lineParts.first();
@@ -514,7 +516,7 @@ QList<File> *Phone::getFileList(QString filter)
tmpFile.fileColor = QColor(Qt::black);
name.remove(QRegExp("\\[\\d;\\d+m"));
- tmpFile.fileName = QString::fromUtf8(name.toAscii());
+ tmpFile.fileName = QString::fromUtf8(name.toLatin1());
tmpFile.filePath = this->getPath() + tmpFile.fileName;
qDebug()<<"Phone::getFileList() - plik: "<<name<< " - " <<lineParts.first();
@@ -573,9 +575,9 @@ FileList *Phone::getStaticFileList(QString path, QString sdk, bool hiddenFiles)
qDebug()<<QDateTime::currentDateTime().toString("hh:mm:ss");
qDebug()<<"Phone::getFileList() - "<<path;
if (hiddenFiles)
- command="\""+sdk+"\""+"adb shell \"busybox ls -l -a \'"+codec->toUnicode(path.toAscii())+"\'\"";
+ command="\""+sdk+"\""+"adb shell \"busybox ls -l -a \'"+codec->toUnicode(path.toLatin1())+"\'\"";
else
- command="\""+sdk+"\""+"adb shell \"busybox ls -l \'"+codec->toUnicode(path.toAscii())+"\'\"";
+ command="\""+sdk+"\""+"adb shell \"busybox ls -l \'"+codec->toUnicode(path.toLatin1())+"\'\"";
qDebug()<<"Phone::getFileList() - "<<command;
phone->start(command);
diff --git a/dialogs/connectWifi.cpp b/dialogs/connectWifi.cpp
index 6ac31ce..2b5770a 100644
--- a/dialogs/connectWifi.cpp
+++ b/dialogs/connectWifi.cpp
@@ -20,8 +20,8 @@
#include "connectWifi.h"
-ConnectWifi::ConnectWifi( QWidget * parent, Qt::WFlags f)
- : QDialog(parent, f)
+ConnectWifi::ConnectWifi( QWidget * parent)
+ : QDialog(parent)
{
setupUi(this);
this->setLayout(this->gridLayout);
diff --git a/dialogs/connectWifi.h b/dialogs/connectWifi.h
index bf71d04..9909853 100644
--- a/dialogs/connectWifi.h
+++ b/dialogs/connectWifi.h
@@ -30,7 +30,7 @@ class ConnectWifi : public QDialog, public Ui::ConnectWifi
{
Q_OBJECT
public:
- ConnectWifi( QWidget * parent = 0, Qt::WFlags f = 0 );
+ ConnectWifi( QWidget * parent = 0);
};
#endif
diff --git a/dialogs/logcatdialog.cpp b/dialogs/logcatdialog.cpp
index 9be7699..f896d51 100644
--- a/dialogs/logcatdialog.cpp
+++ b/dialogs/logcatdialog.cpp
@@ -21,6 +21,10 @@
#include "logcatdialog.h"
#include "ui_logcatdialog.h"
+#include <QMenu>
+#include <QScrollBar>
+#include <QFileDialog>
+
LogcatDialog::LogcatDialog(QWidget *parent) :
QDialog(parent)
{
diff --git a/dialogs/mainwindow.cpp b/dialogs/mainwindow.cpp
index 8629b3b..06c081b 100644
--- a/dialogs/mainwindow.cpp
+++ b/dialogs/mainwindow.cpp
@@ -22,6 +22,9 @@
#include "../classes/application.h"
#include "ui_mainwindow.h"
+#include <QDesktopWidget>
+#include <QToolButton>
+
MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
{
ui->setupUi(this);
@@ -232,8 +235,8 @@ void MainWindow::changeEvent(QEvent *e)
this->logcatDialog->retranslateUi(this->logcatDialog);
for (int i=0; i < this->akcje.size(); i++)
{
- akcje.at(i).actionMenu->setText(tr(akcje.at(i).text.toAscii()));
- akcje.at(i).button->setText(tr(akcje.at(i).text.toAscii()));
+ akcje.at(i).actionMenu->setText(tr(akcje.at(i).text.toLatin1()));
+ akcje.at(i).button->setText(tr(akcje.at(i).text.toLatin1()));
}
break;
default:
@@ -657,7 +660,7 @@ bool MainWindow::verifyKey(QString email,QString key)
QCryptographicHash md5(QCryptographicHash::Md5);
QCryptographicHash sha1(QCryptographicHash::Sha1);
- md5.addData(email.toAscii());
+ md5.addData(email.toLatin1());
sha1.addData(md5.result());
QString tmp = sha1.result().toHex();
@@ -712,13 +715,14 @@ void MainWindow::showPageMessages()
else if (firstRun.addDays(10) <= QDate::currentDate())
{
qDebug()<<"MainWindow::showPageMessages(): demo is over dude";
- accountList = Phone::getGoogleAccounts();
+ verified = true;
+// accountList = Phone::getGoogleAccounts();
- foreach(QString element, accountList)
- {
- if (verifyRegistered(element))
- verified = true;
- }
+// foreach(QString element, accountList)
+// {
+// if (verifyRegistered(element))
+// verified = true;
+// }
}
else
{
diff --git a/dialogs/mainwindow.h b/dialogs/mainwindow.h
index 0485c8b..24836c1 100644
--- a/dialogs/mainwindow.h
+++ b/dialogs/mainwindow.h
@@ -30,7 +30,8 @@
#include <stdio.h>
#include <iostream>
-#include <QtGui>
+#include <QMainWindow>
+#include <QSystemTrayIcon>
#include "dialogkopiuj.h"
#include "../threads/screenshotthread.h"
diff --git a/dialogs/registerdialog.cpp b/dialogs/registerdialog.cpp
index 0d50398..d2ee10f 100644
--- a/dialogs/registerdialog.cpp
+++ b/dialogs/registerdialog.cpp
@@ -77,7 +77,7 @@ bool RegisterDialog::verifyKey(QString key)
QCryptographicHash md5(QCryptographicHash::Md5);
QCryptographicHash sha1(QCryptographicHash::Sha1);
- md5.addData("QtADB"+element.toAscii()+"qtadb");
+ md5.addData("QtADB"+element.toLatin1()+"qtadb");
sha1.addData(md5.result());
if (key == sha1.result().toHex())
diff --git a/main.cpp b/main.cpp
index 796b102..4a9fa50 100644
--- a/main.cpp
+++ b/main.cpp
@@ -18,46 +18,79 @@
************************************************************************/
-#include <QtGui/QApplication>
+#include <QApplication>
#include "./classes/application.h"
#include "./dialogs/mainwindow.h"
////////////////////////////////////////
#include <QtDebug>
#include <QFile>
#include <QTextStream>
+#include <QFileDialog>
-void myMessageHandler(QtMsgType type, const char *msg)
+void customMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
- QStringList args = qApp->arguments();
+ Q_UNUSED(context);
+// QString dt = QDateTime::currentDateTime().toString("dd/MM/yyyy hh:mm:ss");
+// QString txt = QString("[%1] ").arg(dt);
QString txt;
- switch (type) {
- case QtDebugMsg:
- txt = QString("Debug: %1").arg(msg);
- break;
- case QtWarningMsg:
- txt = QString("Warning: %1").arg(msg);
- break;
- case QtCriticalMsg:
- txt = QString("Critical: %1").arg(msg);
- break;
- case QtFatalMsg:
- txt = QString("Fatal: %1").arg(msg);
- abort();
- }
- if (args.contains("--debug"))
- {
- QFile outFile("debug.log");
- outFile.open(QIODevice::WriteOnly | QIODevice::Append);
- QTextStream ts(&outFile);
- txt.remove(QChar( 0xa ),Qt::CaseInsensitive);
- txt.remove(QChar( 0xd ),Qt::CaseInsensitive);
+ switch (type)
+ {
+ case QtDebugMsg:
+ txt += QString("{Debug} \t\t %1").arg(msg);
+ break;
+ case QtWarningMsg:
+ txt += QString("{Warning} \t %1").arg(msg);
+ break;
+ case QtCriticalMsg:
+ txt += QString("{Critical} \t %1").arg(msg);
+ break;
+ case QtFatalMsg:
+ txt += QString("{Fatal} \t\t %1").arg(msg);
+ abort();
+ break;
+ }
- ts << txt << endl;
- }
+ QFile outFile("debug.log");
+ outFile.open(QIODevice::WriteOnly | QIODevice::Append);
+
+ QTextStream textStream(&outFile);
+ textStream << txt << endl;
}
+//void myMessageHandler(QtMsgType type, const char *msg)
+//{
+// QStringList args = qApp->arguments();
+
+// QString txt;
+// switch (type) {
+// case QtDebugMsg:
+// txt = QString("Debug: %1").arg(msg);
+// break;
+// case QtWarningMsg:
+// txt = QString("Warning: %1").arg(msg);
+// break;
+// case QtCriticalMsg:
+// txt = QString("Critical: %1").arg(msg);
+// break;
+// case QtFatalMsg:
+// txt = QString("Fatal: %1").arg(msg);
+// abort();
+// }
+// if (args.contains("--debug"))
+// {
+// QFile outFile("debug.log");
+// outFile.open(QIODevice::WriteOnly | QIODevice::Append);
+// QTextStream ts(&outFile);
+
+// txt.remove(QChar( 0xa ),Qt::CaseInsensitive);
+// txt.remove(QChar( 0xd ),Qt::CaseInsensitive);
+
+// ts << txt << endl;
+// }
+//}
+
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("Bracia");
@@ -65,7 +98,7 @@ int main(int argc, char *argv[])
QCoreApplication::setApplicationVersion("0.8.1");
QCoreApplication::setOrganizationDomain("http://qtadb.com");
Application a(argc, argv);
- qInstallMsgHandler(myMessageHandler);
+ qInstallMessageHandler(customMessageHandler);
a.loadTranslations(":/lang");
a.loadTranslations(qApp->applicationDirPath());
a.setQuitOnLastWindowClosed(true);
diff --git a/threads/screenshotthread.cpp b/threads/screenshotthread.cpp
index 08e1709..c54e6dd 100644
--- a/threads/screenshotthread.cpp
+++ b/threads/screenshotthread.cpp
@@ -140,7 +140,7 @@ void ThreadScreenshot::run()
{
tmp.setNum(serialNumber.length()+15, 16);
tmp = tmp.rightJustified(4, '0');
- this->socket->write(tmp.toAscii() + "host:transport:" + serialNumber.toAscii());
+ this->socket->write(tmp.toLatin1() + "host:transport:" + serialNumber.toLatin1());
this->socket->waitForReadyRead(2000);
data = this->socket->read(4);
if (data == "OKAY")
diff --git a/widgets/appwidget.cpp b/widgets/appwidget.cpp
index bebb929..3cba532 100644
--- a/widgets/appwidget.cpp
+++ b/widgets/appwidget.cpp
@@ -21,6 +21,9 @@
#include "appwidget.h"
#include "ui_appwidget.h"
+#include <QMenu>
+#include <QFileDialog>
+
AppWidget::AppWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::AppWidget)
@@ -132,17 +135,17 @@ void AppWidget::changeEvent(QEvent *e)
if (this->appMenu != NULL)
{
foreach(QAction *action, this->appMenu->actions())
- action->setText(tr(action->data().toString().toAscii()));
+ action->setText(tr(action->data().toString().toLatin1()));
}
if (this->backupMenu != NULL)
{
foreach(QAction *action, this->backupMenu->actions())
- action->setText(tr(action->data().toString().toAscii()));
+ action->setText(tr(action->data().toString().toLatin1()));
}
foreach(QAction *action, this->ui->toolButtonBackup->menu()->actions())
- action->setText(tr(action->data().toString().toAscii()));
+ action->setText(tr(action->data().toString().toLatin1()));
foreach(QAction *action, this->ui->toolButtonRestore->menu()->actions())
- action->setText(tr(action->data().toString().toAscii()));
+ action->setText(tr(action->data().toString().toLatin1()));
break;
default:
@@ -618,7 +621,7 @@ void AppWidget::missingAapt()
msgBox->exec();
- if (msgBox->clickedButton() == download)
+ if (msgBox->clickedButton() == (QAbstractButton*)download)
{
QDesktopServices::openUrl(QUrl("http://qtadb.wordpress.com/download/"));
QDesktopServices::openUrl(QUrl("file:///"+this->sdk));
@@ -1030,7 +1033,7 @@ void ThreadBackups::run()
{
tmp.remove("app.name=");
tmp.remove(QRegExp("\\s+$"));
- backupFound.appName = QString::fromUtf8(tmp.toAscii());
+ backupFound.appName = QString::fromUtf8(tmp.toLatin1());
}
else if (tmp.contains("app.size"))
{
@@ -1313,7 +1316,7 @@ void ThreadApps::run()
{
if (aaptLineParts.first().contains(QRegExp("name=")) && app.packageName.isEmpty())
{
- app.packageName=QString::fromUtf8(aaptLineParts.first().toAscii());
+ app.packageName=QString::fromUtf8(aaptLineParts.first().toLatin1());
app.packageName.remove(0,app.packageName.indexOf("name=")+5);
app.packageName.remove("'");
}
@@ -1325,7 +1328,7 @@ void ThreadApps::run()
}
else if (aaptLineParts.first().contains(QRegExp("label="))&&app.appName.isEmpty())
{
- app.appName=QString::fromUtf8(aaptLineParts.first().toAscii());
+ app.appName=QString::fromUtf8(aaptLineParts.first().toLatin1());
app.appName.remove(0,app.appName.indexOf("label=")+6);
app.appName.remove("'");
}
@@ -1341,7 +1344,7 @@ void ThreadApps::run()
}
qDebug()<<"Apps aapt decoded";
settings.setValue("apps/"+app.packageName+"/icoName", app.icoName);
- settings.setValue("apps/"+app.packageName+"/appName", QString::fromUtf8(app.appName.toAscii()));
+ settings.setValue("apps/"+app.packageName+"/appName", QString::fromUtf8(app.appName.toLatin1()));
settings.setValue("apps/"+app.packageName+"/version", app.appVersion);
settings.setValue("apps/"+app.packageName+"/size", app.appSize);
settings.setValue("apps/"+app.packageName+"/date", app.date);
@@ -1506,7 +1509,7 @@ App * AppWidget::getAppInfo(QString filePath)
}
else if (aaptLineParts.first().contains(QRegExp("label="))&&app->appName.isEmpty())
{
- app->appName=QString::fromUtf8(aaptLineParts.first().toAscii());
+ app->appName=QString::fromUtf8(aaptLineParts.first().toLatin1());
app->appName.remove(0,app->appName.indexOf("label=")+6);
app->appName.remove("'");
}
@@ -1524,7 +1527,7 @@ App * AppWidget::getAppInfo(QString filePath)
if (!settings.contains(app->packageName))
{
settings.setValue(app->packageName+"/icoName", app->icoName);
- settings.setValue(app->packageName+"/appName", QString::fromUtf8(app->appName.toAscii()));
+ settings.setValue(app->packageName+"/appName", QString::fromUtf8(app->appName.toLatin1()));
settings.setValue(app->packageName+"/version", app->appVersion);
}
diff --git a/widgets/contactwidget.cpp b/widgets/contactwidget.cpp
index be1aadd..4e20bf7 100644
--- a/widgets/contactwidget.cpp
+++ b/widgets/contactwidget.cpp
@@ -92,7 +92,7 @@
// proces->start("\""+sdk+"\""+"adb shell sqlite3");
// proces->waitForReadyRead(-1);
// tmp=proces->readLine();
-// proces->write(QString(QChar(0x3)).toAscii());
+// proces->write(QString(QChar(0x3)).toLatin1());
// proces->close();
// if (tmp.contains("not found"))
diff --git a/widgets/fastbootwidget.cpp b/widgets/fastbootwidget.cpp
index 0f2e829..f5e5920 100644
--- a/widgets/fastbootwidget.cpp
+++ b/widgets/fastbootwidget.cpp
@@ -21,6 +21,9 @@
#include "fastbootwidget.h"
#include "ui_fastbootwidget.h"
+#include <QFileDialog>
+#include <QMessageBox>
+
FastbootWidget::FastbootWidget(QWidget *parent,Phone *phone) :
QWidget(parent),
ui(new Ui::FastbootWidget)
diff --git a/widgets/fastbootwidget.h b/widgets/fastbootwidget.h
index 8b31ded..79ad19d 100644
--- a/widgets/fastbootwidget.h
+++ b/widgets/fastbootwidget.h
@@ -21,7 +21,7 @@
#ifndef FASTBOOTWIDGET_H
#define FASTBOOTWIDGET_H
-#include <QtGui>
+#include <QWidget>
#include "../classes/phone.h"
namespace Ui {
diff --git a/widgets/filewidget.cpp b/widgets/filewidget.cpp
index 01717b5..2cb769e 100644
--- a/widgets/filewidget.cpp
+++ b/widgets/filewidget.cpp
@@ -21,6 +21,10 @@
#include "filewidget.h"
#include "ui_filewidget.h"
+#include <QStandardPaths>
+#include <QMenu>
+#include <QScrollBar>
+
quint32 qbytearrayToInt32(QByteArray array)
{
QDataStream stream(array);
@@ -212,15 +216,17 @@ FileWidget::FileWidget(QWidget *parent, SettingsWidget *settings) :
//ustawienie comboboxa
QPair<QIcon, QString> para;
QFileIconProvider *provider = new QFileIconProvider;
- para.second = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
+ para.second = QStandardPaths::standardLocations(QStandardPaths::DesktopLocation).first();//QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
para.first = provider->icon(QFileInfo(para.second));
this->ui->leftComboBox->addItem(para.first, para.second);
- para.second = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+ para.second = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).first();
+// para.second = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
para.first = provider->icon(QFileInfo(para.second));
this->ui->leftComboBox->addItem(para.first, para.second);
- para.second = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
+ QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first();
+// para.second = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
para.first = provider->icon(QFileInfo(para.second));
this->ui->leftComboBox->addItem(para.first, para.second);
@@ -364,7 +370,7 @@ void FileWidget::changeEvent(QEvent *e)
QList<QAction *> actions = this->computerMenu->actions();
foreach(QAction *action, actions)
{
- action->setText(tr(action->data().toString().toAscii()));
+ action->setText(tr(action->data().toString().toLatin1()));
}
}
if (this->phoneLeftMenu != NULL)
@@ -372,7 +378,7 @@ void FileWidget::changeEvent(QEvent *e)
QList<QAction *> actions = this->phoneLeftMenu->actions();
foreach(QAction *action, actions)
{
- action->setText(tr(action->data().toString().toAscii()));
+ action->setText(tr(action->data().toString().toLatin1()));
}
}
if (this->phoneRightMenu != NULL)
@@ -380,7 +386,7 @@ void FileWidget::changeEvent(QEvent *e)
QList<QAction *> actions = this->phoneRightMenu->actions();
foreach(QAction *action, actions)
{
- action->setText(tr(action->data().toString().toAscii()));
+ action->setText(tr(action->data().toString().toLatin1()));
}
}
}
@@ -1994,7 +2000,7 @@ App * FileWidget::getAppInfo(QString filePath)
}
else if (aaptLineParts.first().contains(QRegExp("label="))&&app->appName.isEmpty())
{
- app->appName=QString::fromUtf8(aaptLineParts.first().toAscii());
+ app->appName=QString::fromUtf8(aaptLineParts.first().toLatin1());
app->appName.remove(0,app->appName.indexOf("label=")+6);
app->appName.remove("'");
}
@@ -2012,7 +2018,7 @@ App * FileWidget::getAppInfo(QString filePath)
if (!settings.contains(app->packageName))
{
settings.setValue(app->packageName+"/icoName", app->icoName);
- settings.setValue(app->packageName+"/appName", QString::fromUtf8(app->appName.toAscii()));
+ settings.setValue(app->packageName+"/appName", QString::fromUtf8(app->appName.toLatin1()));
settings.setValue(app->packageName+"/version", app->appVersion);
}
diff --git a/widgets/messagewidget.cpp b/widgets/messagewidget.cpp
index 29e2164..10bd57f 100644
--- a/widgets/messagewidget.cpp
+++ b/widgets/messagewidget.cpp
@@ -21,6 +21,7 @@
#include "messagewidget.h"
#include "ui_messagewidget.h"
+#include <QMessageBox>
MessageWidget::MessageWidget(QWidget *parent, QString clientIP) :
QWidget(parent),
diff --git a/widgets/recoverywidget.cpp b/widgets/recoverywidget.cpp
index 5633ec6..9359241 100644
--- a/widgets/recoverywidget.cpp
+++ b/widgets/recoverywidget.cpp
@@ -21,6 +21,8 @@
#include "recoverywidget.h"
#include "ui_recoverywidget.h"
+#include <QFileDialog>
+
RecoveryWidget::RecoveryWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::RecoveryWidget)
diff --git a/widgets/screenshotwidget.cpp b/widgets/screenshotwidget.cpp
index b65ecf7..3b07a31 100644
--- a/widgets/screenshotwidget.cpp
+++ b/widgets/screenshotwidget.cpp
@@ -21,6 +21,9 @@
#include "screenshotwidget.h"
#include "ui_screenshotwidget.h"
+#include <QMouseEvent>
+#include <QFileDialog>
+
ScreenshotWidget::ScreenshotWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::ScreenshotWidget)
diff --git a/widgets/screenshotwidget.h b/widgets/screenshotwidget.h
index 9f662eb..ff15ea3 100644
--- a/widgets/screenshotwidget.h
+++ b/widgets/screenshotwidget.h
@@ -21,7 +21,7 @@
#ifndef SCREENSHOTWIDGET_H
#define SCREENSHOTWIDGET_H
-#include <QtGui>
+#include <QWidget>
#include "../threads/screenshotthread.h"
namespace Ui {
diff --git a/widgets/settingswidget.cpp b/widgets/settingswidget.cpp
index d442811..ecf8bd6 100644
--- a/widgets/settingswidget.cpp
+++ b/widgets/settingswidget.cpp
@@ -21,6 +21,10 @@
#include "settingswidget.h"
#include "ui_settingswidget.h"
+#include <QFontDialog>
+#include <QColorDialog>
+#include <QFileDialog>
+
SettingsWidget::SettingsWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::SettingsWidget)
@@ -426,8 +430,8 @@ void SettingsWidget::getSettings()
this->animationDuration = settings->value("animationDuration", 1000).toInt();
this->animationDirection = settings->value("animationDirection", 0).toInt();
- this->shellBackgroundColor = settings->value("shellBackgroundColor", Qt::white).value<QColor>();
- this->shellFontColor = settings->value("shellFontColor", Qt::black).value<QColor>();
+ this->shellBackgroundColor = settings->value("shellBackgroundColor", "#ffffff").value<QColor>();
+ this->shellFontColor = settings->value("shellFontColor", "#000000").value<QColor>();
this->windowGeometry = settings->value("windowGeometry").toByteArray();
diff --git a/widgets/shellwidget.cpp b/widgets/shellwidget.cpp
index 4877e3f..c4990bb 100644
--- a/widgets/shellwidget.cpp
+++ b/widgets/shellwidget.cpp
@@ -21,6 +21,11 @@
#include "shellwidget.h"
#include "ui_shellwidget.h"
+#include <QSettings>
+#include <QKeyEvent>
+#include <QClipboard>
+#include <QTextDocumentFragment>
+
/*
dodac 2 listy stringow:
- commandList - w konstruktorze wczytywac komendy busyboxa i shella, a pozniej szift+tab bedzie podpowiadal komendy
@@ -43,10 +48,10 @@ ShellWidget::ShellWidget(QWidget *parent) :
QSettings settings;
this->sdk=settings.value("sdkPath").toString();
- this->fontColor = settings.value("shellFontColor", Qt::black).value<QColor>();
+ this->fontColor = settings.value("shellFontColor", "#000000").value<QColor>();
QPalette palette = this->palette();
- palette.setColor(QPalette::Base, settings.value("shellBackgroundColor", Qt::white).value<QColor>());
+ palette.setColor(QPalette::Base, settings.value("shellBackgroundColor", "#ffffff").value<QColor>());
this->setPalette(palette);
@@ -70,7 +75,7 @@ void ShellWidget::keyPressEvent(QKeyEvent *e)
{
if (e->key() == Qt::Key_C)
{
- this->process.write(QString(QChar(0x3)).toAscii());
+ this->process.write(QString(QChar(0x3)).toLatin1());
}
else if (e->key() == Qt::Key_Left)
{
@@ -218,7 +223,7 @@ void ShellWidget::keyPressEvent(QKeyEvent *e)
}
else if(e->key() == Qt::Key_Escape)
{
- this->process.write(QString(QChar(0x3)).toAscii());
+ this->process.write(QString(QChar(0x3)).toLatin1());
}
else if (e->text().length()>0)
{
@@ -402,7 +407,7 @@ void ShellWidget::keyPressEvent(QKeyEvent *e)
{
if(ui->editShell->hasFocus() && e->key() == Qt::Key_Escape)
{
- this->procesShell->write(QString(QChar(0x3)).toAscii());
+ this->procesShell->write(QString(QChar(0x3)).toLatin1());
}
if(ui->editShell->hasFocus() && e->key() == Qt::Key_Down)
{
diff --git a/widgets/shellwidget.h b/widgets/shellwidget.h
index ddceca2..f1cb9f8 100644
--- a/widgets/shellwidget.h
+++ b/widgets/shellwidget.h
@@ -21,7 +21,8 @@
#ifndef SHELLWIDGET_H
#define SHELLWIDGET_H
-#include <QtGui>
+#include <QTextEdit>
+#include <QProcess>
class ShellWidget : public QTextEdit
{
--
2.7.4.1.g5468f9e