[rhythmbox] ensure RBBrowserSource subclasses implement can_delete correctly



commit f01b4eff87863e73dee27c1ff6c077e8484f03e8
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Jan 13 22:48:36 2010 +1000

    ensure RBBrowserSource subclasses implement can_delete correctly
    
    RBBrowserSource defaults to returning true, so browser sources that
    shouldn't allow deletion (such as the Magnatune, Jamendo, and Coherence
    sources) need to override it.

 plugins/coherence/upnp_coherence/UpnpSource.py |    3 +++
 plugins/jamendo/jamendo/JamendoSource.py       |    3 +++
 plugins/magnatune/magnatune/MagnatuneSource.py |    3 +++
 3 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/coherence/upnp_coherence/UpnpSource.py b/plugins/coherence/upnp_coherence/UpnpSource.py
index 50ceda8..93a20ba 100644
--- a/plugins/coherence/upnp_coherence/UpnpSource.py
+++ b/plugins/coherence/upnp_coherence/UpnpSource.py
@@ -141,4 +141,7 @@ class UpnpSource(rb.BrowserSource,log.Loggable):
 
                     self.__db.commit()
 
+        def do_impl_can_delete(self):
+            return False
+
 gobject.type_register(UpnpSource)
diff --git a/plugins/jamendo/jamendo/JamendoSource.py b/plugins/jamendo/jamendo/JamendoSource.py
index 198391e..b81e8a3 100644
--- a/plugins/jamendo/jamendo/JamendoSource.py
+++ b/plugins/jamendo/jamendo/JamendoSource.py
@@ -95,6 +95,9 @@ class JamendoSource(rb.BrowserSource):
 	def do_impl_get_paned_key (self):
 		return "/apps/rhythmbox/plugins/jamendo/paned_position"
 
+	def do_impl_can_delete (self):
+		return False
+
 	def do_impl_pack_paned (self, paned):
 		self.__paned_box = gtk.VBox(False, 5)
 		self.pack_start(self.__paned_box)
diff --git a/plugins/magnatune/magnatune/MagnatuneSource.py b/plugins/magnatune/magnatune/MagnatuneSource.py
index acc990e..a90d4bf 100644
--- a/plugins/magnatune/magnatune/MagnatuneSource.py
+++ b/plugins/magnatune/magnatune/MagnatuneSource.py
@@ -159,6 +159,9 @@ class MagnatuneSource(rb.BrowserSource):
 	def do_impl_get_paned_key (self):
 		return "/apps/rhythmbox/plugins/magnatune/paned_position"
 
+	def do_impl_can_delete (self):
+		return False
+
 	def do_impl_pack_paned (self, paned):
 		self.__paned_box = gtk.VBox(False, 5)
 		self.pack_start(self.__paned_box)



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