diff options
-rw-r--r-- | src/metawatchbttransport.cpp | 2 | ||||
-rw-r--r-- | src/metawatchbttransport.h | 4 | ||||
-rw-r--r-- | src/salmeta.cpp | 26 | ||||
-rw-r--r-- | translations/salmeta.ts | 2 |
4 files changed, 15 insertions, 19 deletions
diff --git a/src/metawatchbttransport.cpp b/src/metawatchbttransport.cpp index 63996e9..a77977e 100644 --- a/src/metawatchbttransport.cpp +++ b/src/metawatchbttransport.cpp @@ -118,7 +118,7 @@ void MetaWatchBTTransport::connectDevice() // Sadly, seems that QBluetoothSocket doesn't really like been closed and reopened, // so we recreate it every time. - _socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket, this); + _socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol, this); connect(_socket, &QBluetoothSocket::connected, this, &MetaWatchBTTransport::handleSocketConnected); connect(_socket, &QBluetoothSocket::disconnected, this, &MetaWatchBTTransport::handleSocketDisconnected); connect(_socket, &QBluetoothSocket::readyRead, this, &MetaWatchBTTransport::handleSocketData); diff --git a/src/metawatchbttransport.h b/src/metawatchbttransport.h index b1f3bf0..a824151 100644 --- a/src/metawatchbttransport.h +++ b/src/metawatchbttransport.h @@ -3,10 +3,6 @@ #include <QtBluetooth/QBluetoothSocket> -#ifdef QT_USE_NAMESPACE_BLUETOOTH -QT_USE_NAMESPACE_BLUETOOTH -#endif - #include "metawatchtransport.h" class MetaWatchBTTransport : public MetaWatchTransport diff --git a/src/salmeta.cpp b/src/salmeta.cpp index 7bc14ae..f782b83 100644 --- a/src/salmeta.cpp +++ b/src/salmeta.cpp @@ -1,4 +1,5 @@ #include <QtCore/QDebug> +#include <QtCore/QCommandLineParser> #include <QtGui/QGuiApplication> #include <QtGui/QFontDatabase> #include <QtQml/QQmlComponent> @@ -17,19 +18,18 @@ int main(int argc, char *argv[]) { QGuiApplication *app = SailfishApp::application(argc, argv); - // TODO: Rudimentary command line parser ahead. Move to QCommandLineParser when it's ready. - const QStringList args = app->arguments(); - auto it = args.begin(); - while (it != args.end()) { - if (*it == "--daemon") { - launch_daemon = true; - } else if (*it == "--root") { - ++it; - settings_key_prefix = *it; - } - - ++it; - } + QCommandLineParser parser; + parser.setApplicationDescription("MetaWatch client application"); + parser.addHelpOption(); + + QCommandLineOption opt_daemon("daemon", "start background daemon instead of settings UI"); + QCommandLineOption opt_root("root", "dconf path to the settings to use", "/apps/salmeta/watchX", "/apps/salmeta/watch0"); + parser.addOption(opt_daemon); + + parser.process(*app); + + launch_daemon = parser.isSet(opt_daemon); + settings_key_prefix = parser.value(opt_root); qmlRegisterUncreatableType<WidgetInfo>("com.javispedro.salmeta", 1, 0, "WidgetInfo", "Use the models, not this"); diff --git a/translations/salmeta.ts b/translations/salmeta.ts index 605d20c..68fcdf5 100644 --- a/translations/salmeta.ts +++ b/translations/salmeta.ts @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> -<TS version="2.0"> +<TS version="2.1"> <context> <name>AddWidget</name> <message> |