[Pkg-cli-apps-commits] [SCM] banshee branch, ubuntu/oneiric, updated. debian/2.2.0-1ubuntu1-2-g6104d55

Chow Loong Jin hyperair at ubuntu.com
Fri Sep 23 04:18:08 UTC 2011


The following commit has been merged in the ubuntu/oneiric branch:
commit cd59790769e9ea8b8aee781b2b60fa89b06c5051
Author: Chow Loong Jin <hyperair at ubuntu.com>
Date:   Fri Sep 23 12:00:39 2011 +0800

    Backport patch to add U1MS URI support
    
    LP: #856542

diff --git a/debian/patches/0001-U1MS-Ensure-that-u1ms-uris-passed-to-Banshee-at-star.patch b/debian/patches/0001-U1MS-Ensure-that-u1ms-uris-passed-to-Banshee-at-star.patch
new file mode 100644
index 0000000..84f787f
--- /dev/null
+++ b/debian/patches/0001-U1MS-Ensure-that-u1ms-uris-passed-to-Banshee-at-star.patch
@@ -0,0 +1,99 @@
+From b57437bb82d33e1415c50bba80be915b6f5352bc Mon Sep 17 00:00:00 2001
+From: Alex Launi <alex.launi at canonical.com>
+Date: Thu, 22 Sep 2011 16:16:46 -0400
+Subject: [PATCH] [U1MS] Ensure that u1ms uris passed to Banshee at startup get loaded by the store extension
+
+---
+ .../UbuntuOneMusicStoreSource.cs                   |   41 +++++++++++++++++--
+ 1 files changed, 36 insertions(+), 5 deletions(-)
+
+diff --git a/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs b/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
+index e06ea9c..b2703a1 100644
+--- a/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
++++ b/src/Extensions/Banshee.UbuntuOneMusicStore/Banshee.UbuntuOneMusicStore/UbuntuOneMusicStoreSource.cs
+@@ -47,6 +47,7 @@ namespace Banshee.UbuntuOneMusicStore
+         // In the sources TreeView, sets the order value for this source, small on top
+         const int sort_order = 190;
+         CustomView custom_view;
++        string cached_startup_uri;
+ 
+         public UbuntuOneMusicStoreSource () : base (
+             Catalog.GetString ("Ubuntu One Music Store"),
+@@ -61,6 +62,15 @@ namespace Banshee.UbuntuOneMusicStore
+ 
+             // So we can handle u1ms:// URIs
+             ServiceManager.Get<DBusCommandService> ().ArgumentPushed += OnCommandLineArgument;
++            custom_view.store.UrlLoaded += OnDefaultStoreUrlLoaded;
++
++            // make sure that the u1ms uri gets handled on banshee startup
++            foreach (string uri in ApplicationContext.CommandLine.Files) {
++                if (IsU1msUri (uri)) {
++                    cached_startup_uri = uri;
++                    break;
++                }
++            }
+         }
+ 
+         ~UbuntuOneMusicStoreSource ()
+@@ -68,24 +78,45 @@ namespace Banshee.UbuntuOneMusicStore
+             ServiceManager.Get<DBusCommandService> ().ArgumentPushed -= OnCommandLineArgument;
+         }
+ 
++        // A count of 0 will be hidden in the source TreeView
++        public override int Count {
++            get { return 0; }
++        }
++
++        private void OnDefaultStoreUrlLoaded (object o, UbuntuOne.UrlLoadedArgs args)
++        {
++            if (args.Url.StartsWith( "http://stores.7digital.com/default")) {
++                // we just do this the first time we load the default store view
++                // so that we can switch to the passed u1ms uri and not have it switch out on us.
++                custom_view.store.UrlLoaded -= OnDefaultStoreUrlLoaded;
++                if (!string.IsNullOrEmpty (cached_startup_uri))
++                    LoadU1msUri (cached_startup_uri);
++            }
++        }
++
+         private void OnCommandLineArgument (string uri, object value, bool isFile)
+         {
+             if (!isFile || String.IsNullOrEmpty (uri)) {
+                 return;
+             }
+ 
++            LoadU1msUri (uri);
++        }
++
++        private void LoadU1msUri (string uri)
++        {
+             Log.Debug ("U1MS: URI requested: ", uri);
+             // Handle u1ms:// URIs
+-            if (uri.StartsWith ("u1ms://")) {
++            if (IsU1msUri (uri)) {
+                 string http_url = uri.Replace ("u1ms://", "http://");
+                 custom_view.Store.LoadStoreLink (http_url);
+                 ServiceManager.SourceManager.SetActiveSource (this);
+             }
+         }
+ 
+-        // A count of 0 will be hidden in the source TreeView
+-        public override int Count {
+-            get { return 0; }
++        private bool IsU1msUri (string uri)
++        {
++            return uri.StartsWith ("u1ms://");
+         }
+ 
+         public class StoreWrapper: UbuntuOne.U1MusicStore, IDisableKeybindings
+@@ -140,7 +171,7 @@ namespace Banshee.UbuntuOneMusicStore
+ 
+         private class CustomView : ISourceContents
+         {
+-            StoreWrapper store = new StoreWrapper ();
++            internal StoreWrapper store = new StoreWrapper ();
+ 
+             public bool SetSource (ISource source) { return true; }
+             public void ResetSource () { }
+-- 
+1.7.4.1
+
diff --git a/debian/patches/series b/debian/patches/series
index eb496fc..ccc9aa0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,4 +11,5 @@
 90_amazon_url.patch
 workaround-clideps-winmm.patch
 workaround-clideps-meego.patch
+0001-U1MS-Ensure-that-u1ms-uris-passed-to-Banshee-at-star.patch
 99_ltmain_as-needed.patch

-- 
banshee



More information about the Pkg-cli-apps-commits mailing list