Merge lp:~pete-woods/hud/13.10-lp1238420 into lp:hud/13.10

Proposed by Pete Woods
Status: Rejected
Rejected by: Ted Gould
Proposed branch: lp:~pete-woods/hud/13.10-lp1238420
Merge into: lp:hud/13.10
Diff against target: 107 lines (+37/-14)
1 file modified
window-stack-bridge/BamfWindowStack.cpp (+37/-14)
To merge this branch: bzr merge lp:~pete-woods/hud/13.10-lp1238420
Reviewer Review Type Date Requested Status
Ted Gould (community) Disapprove
Charles Kerr (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+208347@code.launchpad.net

Commit message

Backport fixes to window stack bridge

Description of the change

Backport fixes to window stack bridge

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

Seems to be killing test-application-list...?

review: Needs Fixing
Revision history for this message
Ted Gould (ted) wrote :

13.10 is no longer a supported release.

review: Disapprove

Unmerged revisions

348. By Pete Woods

Backport fixes to BamfWindowStack

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'window-stack-bridge/BamfWindowStack.cpp'
2--- window-stack-bridge/BamfWindowStack.cpp 2013-11-04 17:38:54 +0000
3+++ window-stack-bridge/BamfWindowStack.cpp 2014-02-26 12:07:32 +0000
4@@ -57,12 +57,13 @@
5 QDBusPendingReply<QString> desktopFileReply(application.DesktopFile());
6 desktopFileReply.waitForFinished();
7 if (desktopFileReply.isError()) {
8- qWarning() << _("Could not get desktop file for") << path;
9+ qWarning() << _("Could not get desktop file for") << path
10+ << desktopFileReply.error();
11 m_error = true;
12 return;
13 } else {
14- QFile desktopFile(desktopFileReply);
15- if (desktopFile.exists()) {
16+ QString desktopFile(desktopFileReply);
17+ if (!desktopFile.isEmpty()) {
18 m_applicationId = QFileInfo(desktopFile).baseName();
19 }
20 }
21@@ -160,6 +161,7 @@
22 }
23
24 QString BamfWindowStack::GetAppIdFromPid(uint pid) {
25+ Q_UNUSED(pid);
26 // FIXME Not implemented
27 sendErrorReply(QDBusError::NotSupported,
28 "GetAppIdFromPid method not implemented");
29@@ -169,17 +171,33 @@
30 QList<WindowInfo> BamfWindowStack::GetWindowStack() {
31 QList<WindowInfo> results;
32
33- QStringList stack(m_matcher.WindowStackForMonitor(-1));
34+ QDBusPendingReply<QStringList> stackReply(
35+ m_matcher.WindowStackForMonitor(-1));
36+ stackReply.waitForFinished();
37+ if (stackReply.isError()) {
38+ qWarning() << "Failed to get BAMF window stack" << stackReply.error();
39+ return results;
40+ }
41+
42+ QStringList stack(stackReply);
43 for (const QString &path : stack) {
44- const auto window (m_windows[path]);
45+ const auto window(m_windows[path]);
46 if (window) {
47- results << WindowInfo(window->windowId(),
48- window->applicationId(),
49- false);
50+ results
51+ << WindowInfo(window->windowId(), window->applicationId(),
52+ false);
53 }
54 }
55
56- const auto window (m_windows[m_matcher.ActiveWindow()]);
57+ QDBusPendingReply<QString> activeWindowReply(m_matcher.ActiveWindow());
58+ activeWindowReply.waitForFinished();
59+ if (activeWindowReply.isError()) {
60+ qWarning() << "Failed to get BAMF active window"
61+ << activeWindowReply.error();
62+ return results;
63+ }
64+
65+ const auto window(m_windows[activeWindowReply]);
66 if (window) {
67 const uint windowId(window->windowId());
68
69@@ -195,8 +213,9 @@
70
71 QStringList BamfWindowStack::GetWindowProperties(uint windowId,
72 const QString &appId, const QStringList &names) {
73+ Q_UNUSED(appId);
74 QStringList result;
75- auto window = m_windowsById[windowId];
76+ const auto window = m_windowsById[windowId];
77
78 if (window == nullptr) {
79 sendErrorReply(QDBusError::InvalidArgs, "Unable to find windowId");
80@@ -204,19 +223,23 @@
81 }
82
83 for (const QString &name : names) {
84- result << window->xProp(name);
85+ if (window) {
86+ result << window->xProp(name);
87+ } else {
88+ result << QString();
89+ }
90 }
91 return result;
92 }
93
94 void BamfWindowStack::ActiveWindowChanged(const QString &oldWindowPath,
95 const QString &newWindowPath) {
96+ Q_UNUSED(oldWindowPath);
97 if (!newWindowPath.isEmpty()) {
98 const auto window(m_windows[newWindowPath]);
99 if (window) {
100- FocusedWindowChanged(window->windowId(),
101- window->applicationId(),
102- WindowInfo::MAIN);
103+ FocusedWindowChanged(window->windowId(), window->applicationId(),
104+ WindowInfo::MAIN);
105 }
106 }
107 }

Subscribers

People subscribed via source and target branches