Add a "Failed" signal to the movie poster interface
authorPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 4 Aug 2010 22:17:15 +0000 (00:17 +0200)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Thu, 5 Aug 2010 19:04:59 +0000 (21:04 +0200)
src/poster/movie-poster-factory.vala
src/poster/poster-downloader-interface.vala

index 20e223b..cef31b6 100644 (file)
@@ -37,6 +37,7 @@ namespace MoviePoster {
                                                          "/org/maemo/movieposter/IMDb",
                                                          "org.maemo.movieposter.Provider");
                                server.Fetched.connect (this.on_poster_fetched);
+                               server.Failed.connect (this.on_poster_failed);
                        } catch (Error e) {
                                warning ("Couldn't connect to IMDb poster downloader: %s\n", e.message);
                        }
@@ -127,6 +128,20 @@ namespace MoviePoster {
                        }
                }
 
+               private void on_poster_failed (dynamic DBus.Object server, int handle) {
+                       Request request = null;
+                       foreach (Request r in requests) {
+                               if (r.handle == handle) {
+                                       request = r;
+                                       break;
+                               }
+                       }
+                       if (request == null)
+                               return;
+                       requests.remove (request);
+               //      request.callback (pixbuf, request.movie);
+               }
+
                public void join () {
                }
 
index 6c9b963..607a82a 100644 (file)
@@ -22,5 +22,6 @@ public interface PosterDownloader {
        public abstract int FetchThumbnail (string title, string year, string kind) throws DBus.Error;
        public abstract void Unqueue (int handle) throws DBus.Error;
        public signal void fetched (int handle, string path);
+       public signal void failed (int handle);
 }