on xenial help sign in
style tweaks
e885a33Nick Dedekind
plugins/Utils/plugin.cpp+1−3
@@ -50,7 +50,6 @@ static QObject *createConstants(QQmlEngine *engine, QJSEngine *scriptEngine)
50 return new Constants();
50 return new Constants();
51}
51}
52
52
53−
54void UtilsPlugin::registerTypes(const char *uri)
53void UtilsPlugin::registerTypes(const char *uri)
55{
54{
56 Q_ASSERT(uri == QLatin1String("Utils"));
55 Q_ASSERT(uri == QLatin1String("Utils"));
@@ -64,8 +63,7 @@ void UtilsPlugin::registerTypes(const char *uri)
64 qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
63 qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
65 qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
64 qmlRegisterType<RelativeTimeFormatter>(uri, 0, 1, "RelativeTimeFormatter");
66 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
65 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
67−
68− qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "Constants", createConstants);
66+ qmlRegisterSingletonType<Constants>(uri, 0, 1, "Constants", createConstants);
69}
67}
70
68
71void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
69void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
qml/Panel/Indicators/MenuItemFactory.qml−1
@@ -320,7 +320,6 @@ Item {
320 objectName: "switchMenu"
320 objectName: "switchMenu"
321 property QtObject menuData: null
321 property QtObject menuData: null
322 property int menuIndex: -1
322 property int menuIndex: -1
323−
324 property bool serverChecked: menuData && menuData.isToggled || false
323 property bool serverChecked: menuData && menuData.isToggled || false
325
324
326 text: menuData && menuData.label || ""
325 text: menuData && menuData.label || ""
tests/mocks/indicator-service/mock-indicator-service.c+22−22
@@ -31,17 +31,17 @@ typedef struct
31
31
32static void
32static void
33bus_acquired (GDBusConnection *connection,
33bus_acquired (GDBusConnection *connection,
34− const gchar *name,
34+ const gchar *name,
35− gpointer user_data)
35+ gpointer user_data)
36{
36{
37 (void) name;
37 (void) name;
38 IndicatorTestService *indicator = user_data;
38 IndicatorTestService *indicator = user_data;
39 GError *error = NULL;
39 GError *error = NULL;
40
40
41 indicator->actions_export_id = g_dbus_connection_export_action_group (connection,
41 indicator->actions_export_id = g_dbus_connection_export_action_group (connection,
42− "/com/canonical/indicator/mock",
42+ "/com/canonical/indicator/mock",
43− G_ACTION_GROUP (indicator->actions),
43+ G_ACTION_GROUP (indicator->actions),
44− &error);
44+ &error);
45 if (indicator->actions_export_id == 0)
45 if (indicator->actions_export_id == 0)
46 {
46 {
47 g_warning ("cannot export action group: %s", error->message);
47 g_warning ("cannot export action group: %s", error->message);
@@ -50,9 +50,9 @@ bus_acquired (GDBusConnection *connection,
50 }
50 }
51
51
52 indicator->menu_export_id = g_dbus_connection_export_menu_model (connection,
52 indicator->menu_export_id = g_dbus_connection_export_menu_model (connection,
53− "/com/canonical/indicator/mock/desktop",
53+ "/com/canonical/indicator/mock/desktop",
54− G_MENU_MODEL (indicator->menu),
54+ G_MENU_MODEL (indicator->menu),
55− &error);
55+ &error);
56 if (indicator->menu_export_id == 0)
56 if (indicator->menu_export_id == 0)
57 {
57 {
58 g_warning ("cannot export menu: %s", error->message);
58 g_warning ("cannot export menu: %s", error->message);
@@ -63,8 +63,8 @@ bus_acquired (GDBusConnection *connection,
63
63
64static void
64static void
65name_lost (GDBusConnection *connection,
65name_lost (GDBusConnection *connection,
66− const gchar *name,
66+ const gchar *name,
67− gpointer user_data)
67+ gpointer user_data)
68{
68{
69 (void) name;
69 (void) name;
70 IndicatorTestService *indicator = user_data;
70 IndicatorTestService *indicator = user_data;
@@ -78,8 +78,8 @@ name_lost (GDBusConnection *connection,
78
78
79static void
79static void
80activate_show (GSimpleAction *action,
80activate_show (GSimpleAction *action,
81− GVariant *parameter,
81+ GVariant *parameter,
82− gpointer user_data)
82+ gpointer user_data)
83{
83{
84 (void) action;
84 (void) action;
85 (void) parameter;
85 (void) parameter;
@@ -105,8 +105,8 @@ actual_switch (gpointer user_data)
105
105
106static void
106static void
107activate_switch (GSimpleAction *action,
107activate_switch (GSimpleAction *action,
108− GVariant *parameter,
108+ GVariant *parameter,
109− gpointer user_data)
109+ gpointer user_data)
110{
110{
111 (void) action;
111 (void) action;
112 (void) parameter;
112 (void) parameter;
@@ -240,13 +240,13 @@ main (int argc, char **argv)
240 g_menu_append_item (indicator.menu, item);
240 g_menu_append_item (indicator.menu, item);
241
241
242 g_bus_own_name (G_BUS_TYPE_SESSION,
242 g_bus_own_name (G_BUS_TYPE_SESSION,
243− "com.canonical.indicator.mock",
243+ "com.canonical.indicator.mock",
244− G_BUS_NAME_OWNER_FLAGS_NONE,
244+ G_BUS_NAME_OWNER_FLAGS_NONE,
245− bus_acquired,
245+ bus_acquired,
246− NULL,
246+ NULL,
247− name_lost,
247+ name_lost,
248− &indicator,
248+ &indicator,
249− NULL);
249+ NULL);
250
250
251 loop = g_main_loop_new (NULL, FALSE);
251 loop = g_main_loop_new (NULL, FALSE);
252 g_main_loop_run (loop);
252 g_main_loop_run (loop);
@@ -258,4 +258,4 @@ main (int argc, char **argv)
258 g_object_unref (loop);
258 g_object_unref (loop);
259
259
260 return 1;
260 return 1;
261−}
261+}