Merge lp:~ted/hud/lp1247898 into lp:hud/13.10

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 348
Merged at revision: 347
Proposed branch: lp:~ted/hud/lp1247898
Merge into: lp:hud/13.10
Diff against target: 40 lines (+11/-1)
2 files modified
src/window-info.c (+8/-0)
window-stack-bridge/BamfWindowStack.cpp (+3/-1)
To merge this branch: bzr merge lp:~ted/hud/lp1247898
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+193826@code.launchpad.net

Commit message

Improve handling of unfound windows

Description of the change

We need more errors in our life.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/window-info.c'
--- src/window-info.c 2013-10-11 16:16:21 +0000
+++ src/window-info.c 2013-11-04 17:45:18 +0000
@@ -128,6 +128,7 @@
128 const gchar * const *property_names) {128 const gchar * const *property_names) {
129 gchar **result = NULL;129 gchar **result = NULL;
130 GError *error = NULL;130 GError *error = NULL;
131
131 if (!dbus_window_stack_call_get_window_properties_sync(self->window_stack,132 if (!dbus_window_stack_call_get_window_properties_sync(self->window_stack,
132 self->window_id, self->app_id, property_names, &result, NULL,133 self->window_id, self->app_id, property_names, &result, NULL,
133 &error)) {134 &error)) {
@@ -135,5 +136,12 @@
135 g_error_free(error);136 g_error_free(error);
136 return NULL;137 return NULL;
137 }138 }
139
140 if (g_strv_length(result) != g_strv_length((gchar **)property_names)) {
141 g_warning("Unable to get all properties from Window Switcher");
142 g_strfreev(result);
143 result = NULL;
144 }
145
138 return result;146 return result;
139}147}
140148
=== modified file 'window-stack-bridge/BamfWindowStack.cpp'
--- window-stack-bridge/BamfWindowStack.cpp 2013-10-28 19:31:45 +0000
+++ window-stack-bridge/BamfWindowStack.cpp 2013-11-04 17:45:18 +0000
@@ -198,8 +198,10 @@
198 QStringList result;198 QStringList result;
199 auto window = m_windowsById[windowId];199 auto window = m_windowsById[windowId];
200200
201 if (window == nullptr)201 if (window == nullptr) {
202 sendErrorReply(QDBusError::InvalidArgs, "Unable to find windowId");
202 return result;203 return result;
204 }
203205
204 for (const QString &name : names) {206 for (const QString &name : names) {
205 result << window->xProp(name);207 result << window->xProp(name);

Subscribers

People subscribed via source and target branches