[gnome-music/wip/christopherdavis/fix-nightly-mpris-launch: 1/2] mpris: Correctly report the DesktopEntry for both profiles



commit 3f9e9144edb369dd9b1ce853bf8d995821f45b46
Author: Christopher Davis <brainblasted disroot org>
Date:   Thu Apr 11 12:32:31 2019 -0400

    mpris: Correctly report the DesktopEntry for both profiles
    
    Music was launching the wrong profile if you clicked on the
    MPRIS entry. This is because the app was always reporting
    itself as the stable version. Now we account for all profiles
    by using the application id.
    
    Closes #273

 gnomemusic/mpris.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 6639c080..02400e31 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -32,6 +32,7 @@ import gnomemusic.utils as utils
 
 from gi.repository import GLib
 from gi.repository import Gio
+from gi.repository import Gtk
 from gnomemusic import log
 import logging
 logger = logging.getLogger(__name__)
@@ -681,6 +682,7 @@ class MediaPlayer2Service(Server):
         return self.GetAll(interface_name)[property_name]
 
     def GetAll(self, interface_name):
+        application_id  = Gtk.Application.get_default().get_application_id()
         if interface_name == MediaPlayer2Service.MEDIA_PLAYER2_IFACE:
             return {
                 'CanQuit': GLib.Variant('b', True),
@@ -689,7 +691,7 @@ class MediaPlayer2Service(Server):
                 'CanRaise': GLib.Variant('b', True),
                 'HasTrackList': GLib.Variant('b', True),
                 'Identity': GLib.Variant('s', 'Music'),
-                'DesktopEntry': GLib.Variant('s', 'org.gnome.Music'),
+                'DesktopEntry': GLib.Variant('s', application_id),
                 'SupportedUriSchemes': GLib.Variant('as', [
                     'file'
                 ]),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]