summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-06-18 19:04:06 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-06-18 19:04:06 +0000
commit2c6895207d46f1005afb33668f277237ac5e1238 (patch)
treec4a82f6808550e9aa2990a5c411970bb0136b4a0 /rbutil/rbutilqt/base
parentae64b59afad9e186340b4cfe27f8fa78157c80b1 (diff)
Make System and Utils class based on QObject.
Those classes use Qt objects anyway, and making them based on QObject moved the strings into the appropriate class when translating. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26931 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/system.cpp12
-rw-r--r--rbutil/rbutilqt/base/system.h4
-rw-r--r--rbutil/rbutilqt/base/utils.cpp6
-rw-r--r--rbutil/rbutilqt/base/utils.h4
4 files changed, 15 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp
index 80e787515c..2bc0764b8b 100644
--- a/rbutil/rbutilqt/base/system.cpp
+++ b/rbutil/rbutilqt/base/system.cpp
@@ -116,16 +116,16 @@ QString System::userPermissionsString(void)
int perm = userPermissions();
switch(perm) {
case GUEST:
- result = QObject::tr("Guest");
+ result = tr("Guest");
break;
case ADMIN:
- result = QObject::tr("Admin");
+ result = tr("Admin");
break;
case USER:
- result = QObject::tr("User");
+ result = tr("User");
break;
default:
- result = QObject::tr("Error");
+ result = tr("Error");
break;
}
return result;
@@ -254,7 +254,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void)
libusb_close(dh);
}
if(name.isEmpty())
- name = QObject::tr("(no description available)");
+ name = tr("(no description available)");
if(id) {
usbids.insert(id, name);
qDebug("[System] USB: 0x%08x, %s", id, name.toLocal8Bit().data());
@@ -299,7 +299,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void)
}
}
usb_close(dev);
- if(name.isEmpty()) name = QObject::tr("(no description available)");
+ if(name.isEmpty()) name = tr("(no description available)");
if(id) {
usbids.insert(id, name);
diff --git a/rbutil/rbutilqt/base/system.h b/rbutil/rbutilqt/base/system.h
index 25c404e37c..cd9fa82a19 100644
--- a/rbutil/rbutilqt/base/system.h
+++ b/rbutil/rbutilqt/base/system.h
@@ -23,12 +23,14 @@
#ifndef SYSTEM_H
#define SYSTEM_H
+#include <QtCore/QObject>
+
#include <inttypes.h>
#include <QString>
#include <QUrl>
-class System
+class System : public QObject
{
public:
System() {}
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp
index ce8cb1c5a9..f9efd955f0 100644
--- a/rbutil/rbutilqt/base/utils.cpp
+++ b/rbutil/rbutilqt/base/utils.cpp
@@ -180,7 +180,7 @@ QString Utils::checkEnvironment(bool permission)
#if defined(Q_OS_WIN32)
if(System::userPermissions() != System::ADMIN)
{
- text += QObject::tr("<li>Permissions insufficient for bootloader "
+ text += tr("<li>Permissions insufficient for bootloader "
"installation.\nAdministrator priviledges are necessary.</li>");
}
#endif
@@ -192,14 +192,14 @@ QString Utils::checkEnvironment(bool permission)
if(!installed.isEmpty() && installed !=
SystemInfo::value(SystemInfo::CurConfigureModel).toString())
{
- text += QObject::tr("<li>Target mismatch detected.\n"
+ text += tr("<li>Target mismatch detected.\n"
"Installed target: %1, selected target: %2.</li>")
.arg(installed, SystemInfo::value(SystemInfo::CurPlatformName).toString());
// FIXME: replace installed by human-friendly name
}
if(!text.isEmpty())
- return QObject::tr("Problem detected:") + "<ul>" + text + "</ul>";
+ return tr("Problem detected:") + "<ul>" + text + "</ul>";
else
return text;
}
diff --git a/rbutil/rbutilqt/base/utils.h b/rbutil/rbutilqt/base/utils.h
index 266044d567..ae02a2ca95 100644
--- a/rbutil/rbutilqt/base/utils.h
+++ b/rbutil/rbutilqt/base/utils.h
@@ -23,10 +23,12 @@
#ifndef UTILS_H
#define UTILS_H
+#include <QtCore/QObject>
+
#include <QString>
#include <QUrl>
-class Utils
+class Utils : public QObject
{
public:
static bool recursiveRmdir(const QString &dirName);