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
1=== modified file 'src/window-info.c'
2--- src/window-info.c 2013-10-11 16:16:21 +0000
3+++ src/window-info.c 2013-11-04 17:45:18 +0000
4@@ -128,6 +128,7 @@
5 const gchar * const *property_names) {
6 gchar **result = NULL;
7 GError *error = NULL;
8+
9 if (!dbus_window_stack_call_get_window_properties_sync(self->window_stack,
10 self->window_id, self->app_id, property_names, &result, NULL,
11 &error)) {
12@@ -135,5 +136,12 @@
13 g_error_free(error);
14 return NULL;
15 }
16+
17+ if (g_strv_length(result) != g_strv_length((gchar **)property_names)) {
18+ g_warning("Unable to get all properties from Window Switcher");
19+ g_strfreev(result);
20+ result = NULL;
21+ }
22+
23 return result;
24 }
25
26=== modified file 'window-stack-bridge/BamfWindowStack.cpp'
27--- window-stack-bridge/BamfWindowStack.cpp 2013-10-28 19:31:45 +0000
28+++ window-stack-bridge/BamfWindowStack.cpp 2013-11-04 17:45:18 +0000
29@@ -198,8 +198,10 @@
30 QStringList result;
31 auto window = m_windowsById[windowId];
32
33- if (window == nullptr)
34+ if (window == nullptr) {
35+ sendErrorReply(QDBusError::InvalidArgs, "Unable to find windowId");
36 return result;
37+ }
38
39 for (const QString &name : names) {
40 result << window->xProp(name);

Subscribers

People subscribed via source and target branches