[gnome-music/wip/mschraal/core: 71/93] coremodel: Remove some old cruft



commit 9f837383a825bbf273ec8db44c0009fc9878819a
Author: Marinus Schraal <mschraal gnome org>
Date:   Wed Jun 19 23:41:07 2019 +0200

    coremodel: Remove some old cruft

 gnomemusic/coremodel.py | 28 ----------------------------
 1 file changed, 28 deletions(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index fe057a31..97579b90 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -62,7 +62,6 @@ class CoreModel(GObject.GObject):
         self._grilo = CoreGrilo(
             self._model, self._hash, self._url_hash, self._album_model,
             self._artist_model)
-        # self._grilo.connect("media-removed", self._on_media_removed)
 
     @log
     def get_model(self):
@@ -210,30 +209,3 @@ class CoreModel(GObject.GObject):
         albums = self._grilo.get_artist_albums(artist)
 
         return albums
-
-    @log
-    def _on_media_removed(self, klass, media):
-        try:
-            old_song = self._url_hash[media.get_url()]
-            print("SUCCES")
-        except KeyError:
-            print("KeyError", media.get_url())
-            return
-
-        for i in range(self._model.get_n_items()):
-            if old_song == self._model[i]:
-                print("REMOVING index", i)
-                self._model.remove(i)
-                break
-
-        if self._album_store is not None:
-            for i in range(self._album_store.get_n_items()):
-                if old_song == self._album_store[i]:
-                    print("REMOVING index", i)
-                    self._album_store.remove(i)
-                    break
-        
-        print("pop2", self._url_hash.pop(media.get_url()))
-        print("pop1", self._hash.pop(old_song.props.media.get_id()))
-
-                # print("ITEM IN MODEL", media.get_id(), self._url_hash[media.get_url()]._media.get_id())


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