summaryrefslogtreecommitdiffhomepage
path: root/proto-iokit-foohid
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-12-09 18:19:15 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-12-09 18:22:04 +0100
commit97f74d1e7b37cf15d4763999e1287a665eeedcec (patch)
tree752b5fce78d2d4d74e0934712dbbd8fd3fb8d72d /proto-iokit-foohid
parent4f9c633bc9a661fbeb367e950f6789d8de6782e6 (diff)
many: use otr_tr for non-qobject translation
I haven't even compile-tested Linux and OSX-specific bits.
Diffstat (limited to 'proto-iokit-foohid')
-rw-r--r--proto-iokit-foohid/foohidjoystick.cpp12
-rw-r--r--proto-iokit-foohid/iokitprotocol.cpp6
-rw-r--r--proto-iokit-foohid/iokitprotocol.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/proto-iokit-foohid/foohidjoystick.cpp b/proto-iokit-foohid/foohidjoystick.cpp
index 17a4bcb5..0b305d08 100644
--- a/proto-iokit-foohid/foohidjoystick.cpp
+++ b/proto-iokit-foohid/foohidjoystick.cpp
@@ -7,7 +7,7 @@
#include "foohidjoystick.h"
-#include <QCoreApplication>
+#include "compat/macros.hpp"
const char FOOHID_SERVICE_NAME[] = "it_unbit_foohid";
@@ -51,7 +51,7 @@ static bool connectToService(io_connect_t *connection, QString *errorMessage)
IOServiceMatching(FOOHID_SERVICE_NAME),
&iterator);
if (ret != KERN_SUCCESS) {
- *errorMessage = QCoreApplication::translate("iokit-foohid", "Unable to find FooHID IOService.");
+ *errorMessage = otr_tr("Unable to find FooHID IOService.");
return false;
}
// Iterate over services and try to open connection
@@ -66,7 +66,7 @@ static bool connectToService(io_connect_t *connection, QString *errorMessage)
}
IOObjectRelease(iterator);
if (!found) {
- *errorMessage = QCoreApplication::translate("iokit-foohid", "Unable to connect to FooHID IOService.");
+ *errorMessage = otr_tr("Unable to connect to FooHID IOService.");
return false;
}
return true;
@@ -89,8 +89,7 @@ FooHIDJoystick::FooHIDJoystick(const QByteArray &name, const QByteArray &serialN
deviceCreated = createDevice();
_hasError = !deviceCreated;
if (!deviceCreated)
- _errorMessage = QCoreApplication::translate("iokit-foohid",
- "Failed to create virtual joystick");
+ _errorMessage = otr_tr("Failed to create virtual joystick");
}
}
@@ -117,8 +116,7 @@ void FooHIDJoystick::setValue(JoystickValues newValues)
values = newValues;
if (!sendToDevice()) {
_hasError = true;
- _errorMessage = QCoreApplication::translate("iokit-foohid",
- "Failed to send values to virtual joystick");
+ _errorMessage = otr_tr("Failed to send values to virtual joystick");
}
}
diff --git a/proto-iokit-foohid/iokitprotocol.cpp b/proto-iokit-foohid/iokitprotocol.cpp
index 693ce31e..d3f0d2c9 100644
--- a/proto-iokit-foohid/iokitprotocol.cpp
+++ b/proto-iokit-foohid/iokitprotocol.cpp
@@ -10,6 +10,8 @@
#include "foohidjoystick.h"
#include "iokitprotocoldialog.h"
+#include "compat/macros.hpp"
+
#include <QDebug>
IOKitProtocol::IOKitProtocol()
@@ -23,14 +25,14 @@ IOKitProtocol::IOKitProtocol()
module_status IOKitProtocol::check_status()
{
if (!joystick)
- return QCoreApplication::translate("foohid", "Load failure");
+ return otr_tr("Load failure");
if (joystick->hasError())
{
QString msg = joystick->errorMessage();
if (msg.isEmpty())
- msg = QCoreApplication::translate("foohid", "Unknown error");
+ msg = otr_tr("Unknown error");
return error(msg);
}
diff --git a/proto-iokit-foohid/iokitprotocol.h b/proto-iokit-foohid/iokitprotocol.h
index 4c5b13a4..39bccf52 100644
--- a/proto-iokit-foohid/iokitprotocol.h
+++ b/proto-iokit-foohid/iokitprotocol.h
@@ -29,6 +29,6 @@ private:
class IOKitProtocolMetadata : public Metadata
{
public:
- QString name() { return QString(QCoreApplication::translate("iokit-foohid", "Virtual joystick")); }
+ QString name() { return otr_tr("Virtual joystick"); }
QIcon icon() { return QIcon(":/images/facetracknoir.png"); }
};