Merge lp:~fboucault/unity-2d/dconf_migration_favorites into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 636
Merged at revision: 635
Proposed branch: lp:~fboucault/unity-2d/dconf_migration_favorites
Merge into: lp:unity-2d/3.0
Diff against target: 196 lines (+22/-27)
8 files modified
data/unity-2d.convert (+3/-0)
debian/20_unity-2d-gconf-default (+0/-1)
debian/changelog (+3/-1)
debian/gconf/schemas/unity-2d.schemas (+0/-13)
libunity-2d-private/Unity2d/CMakeLists.txt (+3/-0)
libunity-2d-private/Unity2d/launcherapplicationslist.cpp (+11/-9)
libunity-2d-private/Unity2d/launcherapplicationslist.h (+2/-1)
libunity-2d-private/Unity2d/workspacesinfo.cpp (+0/-2)
To merge this branch: bzr merge lp:~fboucault/unity-2d/dconf_migration_favorites
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+68881@code.launchpad.net

Description of the change

[launcher] Migrated GConf key /desktop/unity-2d/launcher/favorites to dconf

To post a comment you must log in.
636. By Florian Boucault

Removed useless include.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Looks good, compile fine and even works well!

Just for my curiousity, you are calling blockSignals() for blocking gsettings/dconf signals on writing new values. However, I couldn't find that you are listening to them on the same file at all. (picking/reloading on value changing). Is this a leftover or just to prepare it in case you change it to listen at some later point?

Just a note:
we should at some point adds the dconf-qt build-dep in debian/control, but that will be just one branch, I can push it

All looks good, approved!

review: Approve
Revision history for this message
Florian Boucault (fboucault) wrote :

Thanks for the review Didier!

"Is this a leftover or just to prepare it in case you change it to listen at some later point?"

It is a leftover and I was unsure of it so I left it.

"we should at some point adds the dconf-qt build-dep in debian/control, but that will be just one branch, I can push it"

We did that already in the previous merge request :) (otherwise it would have broken the daily build)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/unity-2d.convert'
2--- data/unity-2d.convert 2011-07-14 14:36:53 +0000
3+++ data/unity-2d.convert 2011-07-23 12:49:28 +0000
4@@ -1,2 +1,5 @@
5 [com.canonical.Unity2d.Launcher]
6 super-key-enable = /desktop/unity-2d/launcher/super_key_enable
7+
8+[com.canonical.Unity.Launcher]
9+favorites = /desktop/unity-2d/launcher/favorites
10
11=== modified file 'debian/20_unity-2d-gconf-default'
12--- debian/20_unity-2d-gconf-default 2011-07-22 14:42:56 +0000
13+++ debian/20_unity-2d-gconf-default 2011-07-23 12:49:28 +0000
14@@ -1,6 +1,5 @@
15 /apps/gnome-power-manager/lock/use_screensaver_settings true
16 /apps/gnome-power-manager/general/use_time_for_policy false
17-/desktop/unity-2d/launcher/favorites [ubiquity-gtkui.desktop,nautilus-home.desktop,firefox.desktop,libreoffice-writer.desktop,libreoffice-calc.desktop,libreoffice-impress.desktop,ubuntu-software-center.desktop,ubuntuone-control-panel-gtk.desktop]
18 /desktop/unity-2d/launcher/hide_mode 2
19 /desktop/unity-2d/launcher/use_strut false
20 /desktop/gnome/applications/window_manager/default /usr/bin/metacity
21
22=== modified file 'debian/changelog'
23--- debian/changelog 2011-07-22 14:44:57 +0000
24+++ debian/changelog 2011-07-23 12:49:28 +0000
25@@ -9,8 +9,10 @@
26 - install GConf to GSettings conversion into usr/share/GConf/gsettings
27 * debian/gconf/schemas/unity-2d.schemas:
28 - remove GConf schema for /desktop/unity-2d/launcher/super_key_enable
29+ - remove GConf schema for /desktop/unity-2d/launcher/favorites
30 * debian/20_unity-2d-gconf-default:
31 - remove default value for /desktop/unity-2d/launcher/super_key_enable
32+ - remove default value for /desktop/unity-2d/launcher/favorites
33 * debian/control:
34 - add dependency on libdconf-qt-dev
35
36@@ -19,7 +21,7 @@
37 * Install the apport hook in the right directory so that it's not launched
38 unconditionally (LP: #712343)
39
40- -- Florian Boucault <florian.boucault@canonical.com> Fri, 22 Jul 2011 16:44:37 +0200
41+ -- Florian Boucault <florian.boucault@canonical.com> Fri, 22 Jul 2011 18:56:33 +0200
42
43 unity-2d (3.8.10-0ubuntu1) natty; urgency=low
44
45
46=== modified file 'debian/gconf/schemas/unity-2d.schemas'
47--- debian/gconf/schemas/unity-2d.schemas 2011-07-14 14:36:53 +0000
48+++ debian/gconf/schemas/unity-2d.schemas 2011-07-23 12:49:28 +0000
49@@ -1,19 +1,6 @@
50 <gconfschemafile>
51 <schemalist>
52 <schema>
53- <key>/schemas/desktop/unity-2d/launcher/favorites</key>
54- <applyto>/desktop/unity-2d/launcher/favorites</applyto>
55- <owner>unity-2d</owner>
56- <type>list</type>
57- <list_type>string</list_type>
58- <default>[ubiquity-gtkui.desktop,nautilus-home.desktop,firefox.desktop,libreoffice-writer.desktop,libreoffice-calc.desktop,libreoffice-impress.desktop,ubuntu-software-center.desktop,ubuntuone-control-panel-gtk.desktop]</default>
59- <locale name="C">
60- <short>Favorite applications</short>
61- <long>List of desktop files of applications that have been marked as favorites by the user in the launcher</long>
62- </locale>
63- </schema>
64-
65- <schema>
66 <key>/schemas/desktop/unity-2d/launcher/hide_mode</key>
67 <applyto>/desktop/unity-2d/launcher/hide_mode</applyto>
68 <owner>unity-2d</owner>
69
70=== modified file 'libunity-2d-private/Unity2d/CMakeLists.txt'
71--- libunity-2d-private/Unity2d/CMakeLists.txt 2011-06-22 08:54:52 +0000
72+++ libunity-2d-private/Unity2d/CMakeLists.txt 2011-07-23 12:49:28 +0000
73@@ -9,6 +9,7 @@
74 pkg_check_modules(GIO REQUIRED gio-2.0)
75 pkg_check_modules(STARTUPNOTIFICATION REQUIRED libstartup-notification-1.0)
76 pkg_check_modules(INDICATOR REQUIRED indicator)
77+pkg_check_modules(DCONFQT REQUIRED dconf-qt)
78
79 find_package(X11 REQUIRED)
80
81@@ -100,6 +101,7 @@
82 ${STARTUPNOTIFICATION_INCLUDE_DIRS}
83 ${INDICATOR_INCLUDE_DIRS}
84 ${X11_INCLUDE_DIR}
85+ ${DCONFQT_INCLUDE_DIRS}
86 ${libunity-2d-private_SOURCE_DIR}/src
87 )
88
89@@ -119,6 +121,7 @@
90 ${GIO_LDFLAGS}
91 ${STARTUPNOTIFICATION_LDFLAGS}
92 ${INDICATOR_LDFLAGS}
93+ ${DCONFQT_LDFLAGS}
94 ${X11_Xcomposite_LIB}
95 unity-2d-private
96 )
97
98=== modified file 'libunity-2d-private/Unity2d/launcherapplicationslist.cpp'
99--- libunity-2d-private/Unity2d/launcherapplicationslist.cpp 2011-07-13 16:04:50 +0000
100+++ libunity-2d-private/Unity2d/launcherapplicationslist.cpp 2011-07-23 12:49:28 +0000
101@@ -23,6 +23,9 @@
102 #include "bamf-application.h"
103 #include "gconfitem-qml-wrapper.h"
104
105+// libdconf-qt
106+#include "qconf.h"
107+
108 // unity-2d
109 #include <debug_p.h>
110
111@@ -40,7 +43,8 @@
112 }
113
114
115-#define FAVORITES_KEY QString("/desktop/unity-2d/launcher/favorites")
116+#define LAUNCHER_DCONF_SCHEMA QString("com.canonical.Unity.Launcher")
117+#define LAUNCHER_DCONF_PATH QString("/desktop/unity/launcher")
118 #define DBUS_SERVICE_UNITY "com.canonical.Unity"
119 #define DBUS_SERVICE_LAUNCHER_ENTRY "com.canonical.Unity.LauncherEntry"
120 #define DBUS_SERVICE_LAUNCHER "com.canonical.Unity.Launcher"
121@@ -52,8 +56,7 @@
122 LauncherApplicationsList::LauncherApplicationsList(QObject *parent) :
123 QAbstractListModel(parent)
124 {
125- m_favorites_list = new GConfItemQmlWrapper();
126- m_favorites_list->setKey(FAVORITES_KEY);
127+ m_dconf_launcher = new QConf(LAUNCHER_DCONF_SCHEMA);
128
129 QDBusConnection session = QDBusConnection::sessionBus();
130 /* FIXME: libunity will send out the Update signal for LauncherEntries
131@@ -171,7 +174,7 @@
132 sn_display_unref(m_snDisplay);
133
134 qDeleteAll(m_applications);
135- delete m_favorites_list;
136+ delete m_dconf_launcher;
137 }
138
139 QString
140@@ -366,9 +369,8 @@
141 LauncherApplicationsList::load()
142 {
143 /* Insert favorites */
144- /* FIXME: migrate to GSettings, like unity. */
145 QString desktop_file;
146- QStringList favorites = m_favorites_list->getValue().toStringList();
147+ QStringList favorites = m_dconf_launcher->property("favorites").toStringList();
148
149 Q_FOREACH(QString favorite, favorites) {
150 insertFavoriteApplication(favorite);
151@@ -453,9 +455,9 @@
152 }
153 }
154
155- m_favorites_list->blockSignals(true);
156- m_favorites_list->setValue(QVariant(favorites));
157- m_favorites_list->blockSignals(false);
158+ m_dconf_launcher->blockSignals(true);
159+ m_dconf_launcher->setProperty("favorites", QVariant(favorites));
160+ m_dconf_launcher->blockSignals(false);
161 }
162
163 int
164
165=== modified file 'libunity-2d-private/Unity2d/launcherapplicationslist.h'
166--- libunity-2d-private/Unity2d/launcherapplicationslist.h 2011-07-13 16:04:50 +0000
167+++ libunity-2d-private/Unity2d/launcherapplicationslist.h 2011-07-23 12:49:28 +0000
168@@ -37,6 +37,7 @@
169 class BamfApplication;
170 class BamfView;
171 class GConfItemQmlWrapper;
172+class QConf;
173
174 class LauncherApplicationsList : public QAbstractListModel, protected AbstractX11EventFilter, protected QDBusContext
175 {
176@@ -88,7 +89,7 @@
177 displayed (m_applications).
178 */
179 QHash<QString, LauncherApplication*> m_applicationForExecutable;
180- GConfItemQmlWrapper* m_favorites_list;
181+ QConf* m_dconf_launcher;
182
183 /* Startup notification support */
184 SnDisplay *m_snDisplay;
185
186=== modified file 'libunity-2d-private/Unity2d/workspacesinfo.cpp'
187--- libunity-2d-private/Unity2d/workspacesinfo.cpp 2011-06-27 13:43:05 +0000
188+++ libunity-2d-private/Unity2d/workspacesinfo.cpp 2011-07-23 12:49:28 +0000
189@@ -9,8 +9,6 @@
190 #include <libwnck/workspace.h>
191 }
192
193-#include "gconfitem-qml-wrapper.h"
194-
195 #include <QAbstractEventDispatcher>
196 #include <QX11Info>
197

Subscribers

People subscribed via source and target branches