on xenial help sign in
Drop migration support, that's moving to USS
08612a3Michael Terry
plugins/AccountsService/AccountsService.cpp−25
@@ -21,10 +21,8 @@
21#include <QFile>
21#include <QFile>
22#include <QStringList>
22#include <QStringList>
23#include <QDebug>
23#include <QDebug>
24−#include <QSettings>
25
24
26#include <glib.h>
25#include <glib.h>
27−#include <gio/gio.h> // for gsettings
28
26
29#define IFACE_ACCOUNTS_USER QStringLiteral("org.freedesktop.Accounts.User")
27#define IFACE_ACCOUNTS_USER QStringLiteral("org.freedesktop.Accounts.User")
30#define IFACE_LOCATION_HERE QStringLiteral("com.ubuntu.location.providers.here.AccountsService")
28#define IFACE_LOCATION_HERE QStringLiteral("com.ubuntu.location.providers.here.AccountsService")
@@ -286,29 +284,6 @@ QStringList AccountsService::keymaps() const
286 return {QStringLiteral("us")};
284 return {QStringLiteral("us")};
287}
285}
288
286
289−void AccountsService::migrateKeymapSettings()
290−{
291− QSettings settings;
292− if (!settings.value(QStringLiteral("KeymapsMigrated")).toBool()) {
293− auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_INPUT_SOURCES);
294− QDBusArgument arg = value.value<QDBusArgument>();
295− StringMapList maps = qdbus_cast<StringMapList>(arg);
296−
297− // Save the config settings (for the keyboard indicator)
298− GSettings * sourcesSettings = g_settings_new("org.gnome.desktop.input-sources");
299− GVariantBuilder builder;
300− g_variant_builder_init(&builder, G_VARIANT_TYPE("a(ss)"));
301− Q_FOREACH(const auto & keymapPair, maps) {
302− g_variant_builder_add(&builder, "(ss)", keymapPair.firstKey().toUtf8().constData(),
303− keymapPair.first().toUtf8().constData());
304− }
305− g_settings_set_value(sourcesSettings, "sources", g_variant_builder_end(&builder));
306− g_object_unref(sourcesSettings);
307−
308− settings.setValue(QStringLiteral("KeymapsMigrated"), true);
309− }
310−}
311−
312uint AccountsService::failedFingerprintLogins() const
287uint AccountsService::failedFingerprintLogins() const
313{
288{
314 return getProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_FINGERPRINT_LOGINS).toUInt();
289 return getProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_FINGERPRINT_LOGINS).toUInt();
plugins/AccountsService/AccountsService.h−3
@@ -118,9 +118,6 @@ public:
118 void setEmail(const QString &email);
118 void setEmail(const QString &email);
119 QStringList keymaps() const;
119 QStringList keymaps() const;
120
120
121−public Q_SLOTS:
122− Q_INVOKABLE void migrateKeymapSettings();
123−
124Q_SIGNALS:
121Q_SIGNALS:
125 void userChanged();
122 void userChanged();
126 void demoEdgesChanged();
123 void demoEdgesChanged();
plugins/AccountsService/CMakeLists.txt+2−2
@@ -1,5 +1,5 @@
1add_definitions(-DSM_BUSNAME=systemBus)
1add_definitions(-DSM_BUSNAME=systemBus)
2−include_directories(${GLIB_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS})
2+include_directories(${GLIB_INCLUDE_DIRS})
3
3
4add_library(AccountsService-qml MODULE
4add_library(AccountsService-qml MODULE
5 AccountsService.cpp
5 AccountsService.cpp
@@ -10,7 +10,7 @@ add_library(AccountsService-qml MODULE
10qt5_use_modules(AccountsService-qml DBus Qml)
10qt5_use_modules(AccountsService-qml DBus Qml)
11
11
12target_link_libraries(AccountsService-qml
12target_link_libraries(AccountsService-qml
13− ${GLIB_LIBRARIES} ${GIO_LDFLAGS}
13+ ${GLIB_LIBRARIES}
14 )
14 )
15
15
16add_unity8_plugin(AccountsService 0.1 AccountsService TARGETS AccountsService-qml)
16add_unity8_plugin(AccountsService 0.1 AccountsService TARGETS AccountsService-qml)
qml/Components/KeymapSwitcher.qml−1
@@ -108,7 +108,6 @@ Item {
108 onKeymapCountChanged: updateIndicatorVisibility();
108 onKeymapCountChanged: updateIndicatorVisibility();
109
109
110 Component.onCompleted: {
110 Component.onCompleted: {
111− AccountsService.migrateKeymapSettings();
112 updateIndicatorVisibility();
111 updateIndicatorVisibility();
113 }
112 }
114}
113}
tests/plugins/AccountsService/CMakeLists.txt−2
@@ -15,7 +15,6 @@ make_dbus_class(UscInput com.canonical.Unity.Input)
15
15
16include_directories(
16include_directories(
17 ${GLIB_INCLUDE_DIRS}
17 ${GLIB_INCLUDE_DIRS}
18− ${GIO_INCLUDE_DIRS}
19 ${CMAKE_CURRENT_BINARY_DIR}
18 ${CMAKE_CURRENT_BINARY_DIR}
20 ${CMAKE_CURRENT_SOURCE_DIR}
19 ${CMAKE_CURRENT_SOURCE_DIR}
21 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
20 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
@@ -23,7 +22,6 @@ include_directories(
23
22
24link_libraries(
23link_libraries(
25 ${GLIB_LIBRARIES}
24 ${GLIB_LIBRARIES}
26− ${GIO_LDFLAGS}
27 )
25 )
28
26
29add_definitions(-DSM_BUSNAME=sessionBus)
27add_definitions(-DSM_BUSNAME=sessionBus)