~ubuntu-branches/ubuntu/raring/banshee/raring

« back to all changes in this revision

Viewing changes to src/Core/Banshee.Services/Banshee.ServiceStack/DBusConnection.cs

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2012-01-23 23:16:49 UTC
  • mfrom: (6.3.22 experimental)
  • Revision ID: package-import@ubuntu.com-20120123231649-safm1f8eycltcgsf
Tags: 2.3.4.ds-1ubuntu1
* Merge from Debian Experimental, remaining changes:
  + Enable and recommend SoundMenu and Disable NotificationArea by default
  + Disable boo and karma extensions
  + Enable and suggest u1ms
  + Move desktop file for Meego UI to /usr/share/une/applications
  + Change the url for the Amazon store redirector
  + [08dea2c] Revert "Fix invalid cast causing ftbfs with libgpod"
* [b617fe0] Convert Ubuntu-specific patches to gbp-pq patches
* Also fixes Launchpad bugs:
  - Fixes race condition while starting (LP: #766303)

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
            }
125
125
        }
126
126
 
 
127
        // Tries to grab the default DBus service name and returns true if we're the primary instance,
 
128
        // false if Banshee is already running. If DBus is not available, we assume we're the primary instance
 
129
        public static bool GrabDefaultName ()
 
130
        {
 
131
            bool primary_instance = false;
 
132
 
 
133
            connect_tried = true;
 
134
 
 
135
            if (!enabled) {
 
136
                primary_instance = true;
 
137
            }
 
138
 
 
139
            try {
 
140
                if (Connect (DefaultServiceName, true) == RequestNameReply.PrimaryOwner) {
 
141
                    active_connections.Add (DefaultServiceName);
 
142
                    primary_instance = true;
 
143
                }
 
144
            } catch (Exception e) {
 
145
                Log.Exception ("DBus support could not be started. Disabling for this session.", e);
 
146
                enabled = false;
 
147
                primary_instance = true;
 
148
            }
 
149
 
 
150
            return primary_instance;
 
151
        }
 
152
 
127
153
        private static RequestNameReply Connect (string serviceName, bool init)
128
154
        {
129
155
            connect_tried = true;