Merge lp://qastaging/~mitya57/indicator-datetime/lp1502480 into lp://qastaging/indicator-datetime/15.10

Proposed by Dmitry Shachnev
Status: Merged
Approved by: Sebastien Bacher
Approved revision: no longer in the source branch.
Merged at revision: 440
Proposed branch: lp://qastaging/~mitya57/indicator-datetime/lp1502480
Merge into: lp://qastaging/indicator-datetime/15.10
Diff against target: 56 lines (+28/-1)
2 files modified
include/datetime/actions-live.h (+1/-0)
src/actions-live.cpp (+27/-1)
To merge this branch: bzr merge lp://qastaging/~mitya57/indicator-datetime/lp1502480
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Sebastien Bacher Approve
Alkis Georgopoulos (community) Approve
Mystic-Mirage (community) Approve
Alberts Muktupāvels Approve
Ted Gould Pending
Lars Karlitski Pending
Review via email: mp+290145@code.qastaging.launchpad.net

Commit message

Support multiple desktop names in $XDG_CURRENT_DESKTOP.

Description of the change

According to the Desktop Entry specification:

If $XDG_CURRENT_DESKTOP is set then it contains a colon-separated list of strings. In order, each string is considered.

This branch adds support for proper detecting of Unity-derived desktops. It is mainly needed for GNOME Flashback session, which uses unity-control-center and XDG_DESKTOP_NAME=GNOME-Flashback:Unity.

To post a comment you must log in.
Revision history for this message
Alberts Muktupāvels (muktupavels) :
review: Approve
Revision history for this message
Mystic-Mirage (mystic-mirage) :
review: Approve
Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

It looks fine to me.

In shell, to avoid the loop, I do:
if echo ":$XDG_CURRENT_DESKTOP:" | grep -q ":Unity:"; then
    echo yes
else
    echo no
fi

Performance-wise it's fine, it needs only one malloc (for strcat) instead of many (for split), but I'm not sure how readable it is.

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

it might be a bit nicer to move the is_unity in a function which is what is done usually...

Revision history for this message
Charles Kerr (charlesk) wrote :

+1 on seb128's to move it into a standalone is_unity() function.

Not a dealbreaker, but I'd probably cache the flag so that we don't have to re-evaluate it every time is_unity() is called.

440. By Dmitry Shachnev

Support multiple desktop names in XDG_CURRENT_DESKTOP

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Added a standalone function and caching, please re-review.

Revision history for this message
Charles Kerr (charlesk) wrote :

LGTM. Thanks Dmitry :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches