Merge lp:~lukas-kde/unity-notifications/cmdLineCheck into lp:unity-notifications

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Michael Zanetti
Approved revision: 244
Merged at revision: 242
Proposed branch: lp:~lukas-kde/unity-notifications/cmdLineCheck
Merge into: lp:unity-notifications
Diff against target: 41 lines (+1/-12)
2 files modified
include/NotificationServer.h (+0/-1)
src/NotificationServer.cpp (+1/-11)
To merge this branch: bzr merge lp:~lukas-kde/unity-notifications/cmdLineCheck
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Approve
Christopher Townsend Approve
Review via email: mp+305653@code.launchpad.net

Commit message

Simplify the check for cmd line (notify-send) to make it work also inside a container

Description of the change

Simplify the check for cmd line (notify-send) to make the notifications work also inside a container

Fixes lp:1623142

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
242. By Lukáš Tinkl

simplify the check for cmd line (notify-send) to make it work also inside a container

243. By Lukáš Tinkl

fix the logic, oops

244. By Lukáš Tinkl

no need to check for calledFromDbus(), notify-send cmd line is all we care about

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:243
https://unity8-jenkins.ubuntu.com/job/lp-unity-notifications-ci/7/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2858
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2886
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2744/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2744
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2744/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-notifications-ci/7/rebuild

review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

Ok, I can confirm this now works for all cases of notifications of applications inside a Libertine container including the notify-send cli.

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:244
https://unity8-jenkins.ubuntu.com/job/lp-unity-notifications-ci/8/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2859
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2887
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2745/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2745
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2745/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-notifications-ci/8/rebuild

review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

makes sense to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/NotificationServer.h'
--- include/NotificationServer.h 2016-07-27 16:46:47 +0000
+++ include/NotificationServer.h 2016-09-13 21:23:54 +0000
@@ -83,7 +83,6 @@
83private:83private:
84 void incrementCounter();84 void incrementCounter();
85 QString messageSender() const;85 QString messageSender() const;
86 bool isCmdLine() const;
8786
88 QSharedPointer<Notification> buildNotification(NotificationID id, const QVariantMap &hints);87 QSharedPointer<Notification> buildNotification(NotificationID id, const QVariantMap &hints);
89 NotificationModel &model;88 NotificationModel &model;
9089
=== modified file 'src/NotificationServer.cpp'
--- src/NotificationServer.cpp 2016-07-27 17:12:08 +0000
+++ src/NotificationServer.cpp 2016-09-13 21:23:54 +0000
@@ -167,16 +167,6 @@
167 return sender;167 return sender;
168}168}
169169
170bool NotificationServer::isCmdLine() const {
171 if (!calledFromDBus()) {
172 return false;
173 }
174 QString sender = message().service();
175 uint pid = connection().interface()->servicePid(sender);
176 QString path = QDir(QString("/proc/%1/exe").arg(pid)).canonicalPath();
177 return (path == "/usr/bin/notify-send");
178}
179
180void NotificationServer::serviceUnregistered(const QString &clientId) {170void NotificationServer::serviceUnregistered(const QString &clientId) {
181 m_watcher.removeWatchedService(clientId);171 m_watcher.removeWatchedService(clientId);
182 const auto notifications = model.removeAllNotificationsForClient(clientId);172 const auto notifications = model.removeAllNotificationsForClient(clientId);
@@ -288,7 +278,7 @@
288278
289 if (newNotification) {279 if (newNotification) {
290 // Don't clean up after the command line client closes280 // Don't clean up after the command line client closes
291 if (!isCmdLine()) {281 if (app_name != QStringLiteral("notify-send")) {
292 m_watcher.addWatchedService(clientId);282 m_watcher.addWatchedService(clientId);
293 }283 }
294 model.insertNotification(notification);284 model.insertNotification(notification);

Subscribers

People subscribed via source and target branches

to all changes: