[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/kimmoli/tohkbd2.git</param>
<param name="branch">master</param>
- <param name="revision">307a52168dfe08eb3ea303ac832f2828d43daab8</param>
+ <param name="revision">d7d2ddaa50080dabacd8a173859bf5c231fc16a0</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/.gitignore
^
|
@@ -1,4 +1,8 @@
*~
*.pro.user
-adaptor.*
+*.pro.user.*
*.qm
+userAdaptor.*
+userInterface.*
+daemonAdaptor.*
+daemonInterface.*
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/daemon/daemon.pro
^
|
@@ -3,7 +3,9 @@
QT += dbus
QT -= gui
-system(qdbusxml2cpp config/com.kimmoli.tohkbd2.xml -i src/tohkeyboard.h -a src/adaptor)
+# D-bus adaptor and interface
+system(qdbusxml2cpp config/com.kimmoli.tohkbd2.xml -i src/tohkeyboard.h -a src/daemonAdaptor)
+system(qdbusxml2cpp config/com.kimmoli.tohkbd2.xml -p ../daemon/src/daemonInterface)
DEFINES += "APPVERSION=\\\"$${SPECVERSION}\\\""
@@ -34,9 +36,10 @@
src/driverBase.cpp \
src/tca8424driver.cpp \
src/keymapping.cpp \
- src/adaptor.cpp \
+ src/daemonAdaptor.cpp \
src/eepromdriver.cpp \
- src/modifierhandler.cpp
+ src/modifierhandler.cpp \
+ ../user-daemon/src/userInterface.cpp
HEADERS += \
src/toh.h \
@@ -46,11 +49,12 @@
src/driverBase.h \
src/tca8424driver.h \
src/keymapping.h \
- src/adaptor.h \
+ src/daemonAdaptor.h \
src/defaultSettings.h \
src/eepromdriver.h \
src/keymapping_lut.h \
- src/modifierhandler.h
+ src/modifierhandler.h \
+ ../user-daemon/src/userInterface.h
OTHER_FILES += \
config/$${TARGET}.service \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/daemon/src/tohkbd2-daemon.cpp
^
|
@@ -13,7 +13,7 @@
#include <sys/types.h>
#include "tohkeyboard.h"
#include "toh.h"
-#include "adaptor.h"
+#include "daemonAdaptor.h"
#include <QtCore/QCoreApplication>
#include <QDBusConnection>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/daemon/src/tohkeyboard.cpp
^
|
@@ -51,7 +51,7 @@
fix_CapsLock = !checkSailfishVersion("1.1.7.0");
capsLock = false;
- tohkbd2user = new QDBusInterface("com.kimmoli.tohkbd2user", "/", "com.kimmoli.tohkbd2user", QDBusConnection::sessionBus(), this);
+ tohkbd2user = new ComKimmoliTohkbd2userInterface("com.kimmoli.tohkbd2user", "/", QDBusConnection::sessionBus(), this);
tohkbd2user->setTimeout(2000);
thread = new QThread();
@@ -132,9 +132,7 @@
/* Restore orientation when shutting down */
if (forceLandscapeOrientation)
{
- QList<QVariant> args;
- args.append(currentOrientationLock);
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setOrientationLock", args);
+ tohkbd2user->setOrientationLock(currentOrientationLock);
}
uinputif->closeUinputDevice();
@@ -151,7 +149,7 @@
connection.unregisterService(SERVICE);
printf("tohkbd2: unregistered from dbus systemBus\n");
- tohkbd2user->call(QDBus::AutoDetect, "quit");
+ tohkbd2user->quit();
}
}
@@ -490,13 +488,13 @@
{
/* show taskswitcher and advance one app */
taskSwitcherVisible = true;
- tohkbd2user->call(QDBus::AutoDetect, "nextAppTaskSwitcher");
- tohkbd2user->call(QDBus::AutoDetect, "showTaskSwitcher");
+ tohkbd2user->nextAppTaskSwitcher();
+ tohkbd2user->showTaskSwitcher();
}
else
{
/* Toggle to next app */
- tohkbd2user->call(QDBus::AutoDetect, "nextAppTaskSwitcher");
+ tohkbd2user->nextAppTaskSwitcher();
}
/* Don't process further */
keyIsPressed = true;
@@ -511,7 +509,7 @@
{
/* Sym-Int takes a screenshot */
case KEY_TOH_SCREENSHOT:
- tohkbd2user->call(QDBus::AutoDetect, "takeScreenShot");
+ tohkbd2user->takeScreenShot();
break;
/* Sym-Del toggles "selfie" led */
@@ -554,9 +552,7 @@
{
printf("Requesting user daemon to start %s\n", qPrintable(cmd));
- QList<QVariant> args;
- args.append(cmd);
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "launchApplication", args);
+ tohkbd2user->launchApplication(cmd);
/* Don't process further */
keyIsPressed = true;
@@ -570,9 +566,7 @@
{
printf("Requesting user daemon to reboot with remorse.\n");
- QList<QVariant> args;
- args.append(QString(ACTION_REBOOT_REMORSE));
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "actionWithRemorse", args);
+ tohkbd2user->actionWithRemorse(ACTION_REBOOT_REMORSE);
keyIsPressed = true;
return;
@@ -584,9 +578,7 @@
{
printf("Requesting user daemon to restart lipstick with remorse.\n");
- QList<QVariant> args;
- args.append(QString(ACTION_RESTART_LIPSTICK_REMORSE));
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "actionWithRemorse", args);
+ tohkbd2user->actionWithRemorse(ACTION_RESTART_LIPSTICK_REMORSE);
keyIsPressed = true;
return;
@@ -718,7 +710,7 @@
{
/* hide taskswitcher when alt is released
* this will also activate selected application */
- tohkbd2user->call(QDBus::AutoDetect, "hideTaskSwitcher");
+ tohkbd2user->hideTaskSwitcher();
taskSwitcherVisible = false;
}
}
@@ -830,7 +822,7 @@
*/
void Tohkbd::changeActiveLayout(bool justGetIt)
{
- QString __currentActiveLayout = tohkbd2user->call(QDBus::AutoDetect, "getActiveLayout").arguments().at(0).toString();
+ QString __currentActiveLayout = tohkbd2user->getActiveLayout();
printf("Current layout is %s\n", qPrintable(__currentActiveLayout));
@@ -856,16 +848,12 @@
if (vkbLayoutIsTohkbd)
{
printf("Changing to tohkbd\n");
- QList<QVariant> args;
- args.append("harbour-tohkbd2.qml");
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setActiveLayout", args);
+ tohkbd2user->setActiveLayout("harbour-tohkbd2.qml");
}
else if (currentActiveLayout.contains("qml"))
{
printf("Changing to %s\n", qPrintable(currentActiveLayout));
- QList<QVariant> args;
- args.append(currentActiveLayout);
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setActiveLayout", args);
+ tohkbd2user->setActiveLayout(currentActiveLayout);
}
}
@@ -888,16 +876,12 @@
if (keypadIsPresent)
{
/* Force to landscape if keypad is present */
- QList<QVariant> args;
- args.append("landscape");
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setOrientationLock", args);
+ tohkbd2user->setOrientationLock("landscape");
}
else if (!currentOrientationLock.isEmpty())
{
/* Or return the previous value, if we have one */
- QList<QVariant> args;
- args.append(currentOrientationLock);
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setOrientationLock", args);
+ tohkbd2user->setOrientationLock(currentOrientationLock);
}
}
@@ -1140,15 +1124,11 @@
if (value == 0 && !currentOrientationLock.isEmpty())
{
- QList<QVariant> args;
- args.append(currentOrientationLock);
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setOrientationLock", args);
+ tohkbd2user->setOrientationLock(currentOrientationLock);
}
else if (value == 1 && keypadIsPresent)
{
- QList<QVariant> args;
- args.append("landscape");
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "setOrientationLock", args);
+ tohkbd2user->setOrientationLock("landscape");
}
}
else if (key == "stickyShiftEnabled" && (value == 0 || value == 1))
@@ -1229,9 +1209,7 @@
/* Tell user daemon to show notification */
void Tohkbd::keyboardConnectedNotification(bool connected)
{
- QList<QVariant> args;
- args.append(connected);
- tohkbd2user->callWithArgumentList(QDBus::AutoDetect, "showKeyboardConnectionNotification", args);
+ tohkbd2user->showKeyboardConnectionNotification(connected);
}
/** DBUS Test methods */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/daemon/src/tohkeyboard.h
^
|
@@ -21,6 +21,7 @@
#include "tca8424driver.h"
#include "keymapping.h"
+#include "../user-daemon/src/userInterface.h"
#define SERVICE_NAME "com.kimmoli.tohkbd2"
#define EVDEV_OFFSET (8)
@@ -136,7 +137,7 @@
bool selfieLedOn;
bool capsLock;
- QDBusInterface *tohkbd2user;
+ ComKimmoliTohkbd2userInterface *tohkbd2user;
QByteArray FKEYS;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/harbour-ambience-tohkbd2.pro
^
|
@@ -2,5 +2,6 @@
# tohkbd2 top level project file
#
TEMPLATE = subdirs
-SUBDIRS = daemon user-daemon settings-ui ambience
+CONFIG = ordered
+SUBDIRS = user-daemon daemon settings-ui ambience
OTHER_FILES = rpm/harbour-ambience-tohkbd2.spec
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/settings-ui/settings-ui.pro
^
|
@@ -23,10 +23,14 @@
message($${DEFINES})
SOURCES += src/tohkbd2-settingsui.cpp \
- src/settingsui.cpp
+ src/settingsui.cpp \
+ ../daemon/src/daemonInterface.cpp \
+ ../user-daemon/src/userInterface.cpp
HEADERS += src/settingsui.h \
- src/IconProvider.h
+ src/IconProvider.h \
+ ../daemon/src/daemonInterface.h \
+ ../user-daemon/src/userInterface.h
OTHER_FILES += qml/tohkbd2-settingsui.qml \
qml/cover/CoverPage.qml \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/settings-ui/src/settingsui.cpp
^
|
@@ -21,6 +21,11 @@
SettingsUi::SettingsUi(QObject *parent) :
QObject(parent)
{
+ tohkbd2daemon = new ComKimmoliTohkbd2Interface("com.kimmoli.tohkbd2", "/", QDBusConnection::systemBus(), this);
+ tohkbd2daemon->setTimeout(2000);
+ tohkbd2user = new ComKimmoliTohkbd2userInterface("com.kimmoli.tohkbd2user", "/", QDBusConnection::sessionBus(), this);
+ tohkbd2user->setTimeout(2000);
+
emit versionChanged();
}
@@ -154,12 +159,7 @@
{
qDebug() << "setting shortcut" << key << "to" << appPath;
- QDBusInterface tohkbd2daemon("com.kimmoli.tohkbd2", "/", "com.kimmoli.tohkbd2", QDBusConnection::systemBus());
- tohkbd2daemon.setTimeout(2000);
- QList<QVariant> args;
- args.append(key);
- args.append(appPath);
- tohkbd2daemon.callWithArgumentList(QDBus::AutoDetect, "setShortcut", args);
+ tohkbd2daemon->setShortcut(key, appPath);
emit shortcutsChanged();
}
@@ -168,12 +168,7 @@
{
qDebug() << "setting" << key << "to" << value;
- QDBusInterface tohkbd2daemon("com.kimmoli.tohkbd2", "/", "com.kimmoli.tohkbd2", QDBusConnection::systemBus());
- tohkbd2daemon.setTimeout(2000);
- QList<QVariant> args;
- args.append(key);
- args.append(value);
- tohkbd2daemon.callWithArgumentList(QDBus::AutoDetect, "setSettingInt", args);
+ tohkbd2daemon->setSettingInt(key, value);
emit settingsChanged();
}
@@ -182,12 +177,7 @@
{
qDebug() << "setting" << key << "to" << value;
- QDBusInterface tohkbd2daemon("com.kimmoli.tohkbd2", "/", "com.kimmoli.tohkbd2", QDBusConnection::systemBus());
- tohkbd2daemon.setTimeout(2000);
- QList<QVariant> args;
- args.append(key);
- args.append(value);
- tohkbd2daemon.callWithArgumentList(QDBus::AutoDetect, "setSettingString", args);
+ tohkbd2daemon->setSettingString(key, value);
emit settingsChanged();
}
@@ -196,9 +186,7 @@
{
qDebug() << "setting all shortcuts to default";
- QDBusInterface tohkbd2daemon("com.kimmoli.tohkbd2", "/", "com.kimmoli.tohkbd2", QDBusConnection::systemBus());
- tohkbd2daemon.setTimeout(2000);
- tohkbd2daemon.call(QDBus::AutoDetect, "setShortcutsToDefault");
+ tohkbd2daemon->setShortcutsToDefault();
emit shortcutsChanged();
}
@@ -226,41 +214,34 @@
QString SettingsUi::readDaemonVersion()
{
- QDBusInterface getDaemonVersionCall("com.kimmoli.tohkbd2", "/", "com.kimmoli.tohkbd2", QDBusConnection::systemBus());
- getDaemonVersionCall.setTimeout(2000);
-
- QDBusMessage getDaemonVersionReply = getDaemonVersionCall.call(QDBus::AutoDetect, "getVersion");
+ QString daemonVersion = tohkbd2daemon->getVersion();
- if (getDaemonVersionReply.type() == QDBusMessage::ErrorMessage)
+ if (tohkbd2daemon->lastError().type() != QDBusError::NoError)
{
- qDebug() << "Error reading daemon version:" << getDaemonVersionReply.errorMessage();
- return QString("N/A");
+ qDebug() << "Error getting daemon version " << QDBusError::errorString(tohkbd2daemon->lastError().type());
+ daemonVersion = QString("N/A");
+ }
+ else
+ {
+ qDebug() << "Daemon version is" << daemonVersion;
}
-
- QString daemonVersion = getDaemonVersionReply.arguments().at(0).toString();
-
- qDebug() << "Daemon version is" << daemonVersion;
return daemonVersion;
-
}
QString SettingsUi::readUserDaemonVersion()
{
- QDBusInterface getUserDaemonVersionCall("com.kimmoli.tohkbd2user", "/", "com.kimmoli.tohkbd2user", QDBusConnection::sessionBus());
- getUserDaemonVersionCall.setTimeout(2000);
-
- QDBusMessage getUserDaemonVersionReply = getUserDaemonVersionCall.call(QDBus::AutoDetect, "getVersion");
+ QString userDaemonVersion = tohkbd2user->getVersion();
- if (getUserDaemonVersionReply.type() == QDBusMessage::ErrorMessage)
+ if (tohkbd2user->lastError().type() != QDBusError::NoError)
{
- qDebug() << "Error reading daemon version:" << getUserDaemonVersionReply.errorMessage();
- return QString("N/A");
+ qDebug() << "Error getting user daemon version " << QDBusError::errorString(tohkbd2user->lastError().type());
+ userDaemonVersion = QString("N/A");
+ }
+ else
+ {
+ qDebug() << "User daemon version is" << userDaemonVersion;
}
-
- QString userDaemonVersion = getUserDaemonVersionReply.arguments().at(0).toString();
-
- qDebug() << "User daemon version is" << userDaemonVersion;
return userDaemonVersion;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/settings-ui/src/settingsui.h
^
|
@@ -7,6 +7,9 @@
#include <QObject>
#include <QVariantList>
+#include "../daemon/src/daemonInterface.h"
+#include "../user-daemon/src/userInterface.h"
+
class SettingsUi : public QObject
{
Q_OBJECT
@@ -34,8 +37,10 @@
void shortcutsChanged();
void settingsChanged();
- //private:
+private:
+ ComKimmoliTohkbd2Interface *tohkbd2daemon;
+ ComKimmoliTohkbd2userInterface *tohkbd2user;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/user-daemon/src/tohkbd2user.cpp
^
|
@@ -20,7 +20,7 @@
#include <sailfishapp.h>
#include "userdaemon.h"
-#include "adaptor.h"
+#include "userAdaptor.h"
#include "viewhelper.h"
#include "applauncher.h"
#include "screenshot.h"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-ambience-tohkbd2-0.3.10.tar.bz2/user-daemon/user-daemon.pro
^
|
@@ -5,8 +5,8 @@
QT += dbus gui-private
-# DBus
-system(qdbusxml2cpp config/com.kimmoli.tohkbd2user.xml -i src/userdaemon.h -a src/adaptor)
+system(qdbusxml2cpp config/com.kimmoli.tohkbd2user.xml -i src/userdaemon.h -a src/userAdaptor)
+system(qdbusxml2cpp config/com.kimmoli.tohkbd2user.xml -p ../user-daemon/src/userInterface)
#system(lupdate src qml -no-obsolete -ts $$PWD/i18n/engineering_en.ts)
system(lrelease -idbased $$PWD/i18n/*.ts)
@@ -31,7 +31,7 @@
SOURCES += \
src/tohkbd2user.cpp \
- src/adaptor.cpp \
+ src/userAdaptor.cpp \
src/userdaemon.cpp \
src/viewhelper.cpp \
src/applauncher.cpp \
@@ -45,7 +45,7 @@
qml/taskswitcher.qml
HEADERS += \
- src/adaptor.h \
+ src/userAdaptor.h \
src/userdaemon.h \
src/viewhelper.h \
src/applauncher.h \
|