Release 0.1:
* Expose TMDBMovie via DBus
- Creating TMDB movie-service gobject
- + Getters for each property
- - A method to generate UID must be added
- - The result objects lifetime must be controlled and finalized
+ + Getters for each property
+ - The result objects lifetime must be controlled and finalized
when not needed.
* Update build so that it creates a .service file
* Create a MovieManager class in Python to ask for and retrieve results
struct _MvsMInfoProviderServicePrivate {
MvsMInfoProvider *minfo_provider;
DBusGConnection *connection;
+ guint search_id;
};
gboolean
for (iter = list; iter; iter = iter->next) {
if (MVS_IS_TMDB_MOVIE (iter->data)) {
MvsTmdbMovie *tmdb_movie = MVS_TMDB_MOVIE (iter->data);
+ gchar *uid_suffix = g_strdup_printf ("%d_%s",
+ self->priv->search_id,
+ mvs_tmdb_movie_get_id (tmdb_movie));
mvs_tmdb_movie_print (tmdb_movie);
- movie = mvs_tmdb_movie_service_new (self->priv->connection, tmdb_movie, i);
- object_paths[i] = g_strdup_printf ("/TMDBMovie/%d", i);
+ movie = mvs_tmdb_movie_service_new (self->priv->connection,
+ tmdb_movie, uid_suffix);
+ object_paths[i] = g_strdup_printf ("/TMDBMovie/%s",
+ uid_suffix);
+ g_free (uid_suffix);
}
i++;
}
g_signal_emit (self, mvs_minfo_provider_service_signals[RESPONSE_RECEIVED], 0, object_paths);
g_strfreev (object_paths);
+ self->priv->search_id++;
}
static void
self->priv = GET_PRIVATE (self);
self->priv->minfo_provider = mvs_minfo_provider_new ();
self->priv->connection = NULL;
+ self->priv->search_id = 0;
g_signal_connect (self->priv->minfo_provider, "response-received",
G_CALLBACK (response_received_cb), self);
struct _MvsTMDBMovieServicePrivate {
MvsTmdbMovie *movie;
DBusGConnection *connection;
- guint id;
+ gchar *suffix;
};
gboolean
g_error_free (error);
}
- object_path = g_strdup_printf (TMDB_MOVIE_SERVICE_OBJECT_PATH "/%d",
- self->priv->id);
+ object_path = g_strdup_printf (TMDB_MOVIE_SERVICE_OBJECT_PATH "/%s",
+ self->priv->suffix);
dbus_g_connection_register_g_object (self->priv->connection,
object_path,
if (self->priv->connection) {
dbus_g_connection_unref (self->priv->connection);
}
+ g_free (self->priv->suffix);
g_object_unref (self->priv->movie);
G_OBJECT_CLASS (mvs_tmdb_movie_service_parent_class)->finalize (object);
}
self->priv = GET_PRIVATE (self);
self->priv->movie = NULL;
self->priv->connection = NULL;
+ self->priv->suffix = NULL;
}
MvsTMDBMovieService*
mvs_tmdb_movie_service_new (DBusGConnection *connection,
- MvsTmdbMovie *movie, guint id)
+ MvsTmdbMovie *movie, const gchar *suffix)
{
MvsTMDBMovieService *instance = g_object_new (MVS_TYPE_TMDB_MOVIE_SERVICE, NULL);
- instance->priv->id = id;
+ instance->priv->suffix = g_strdup(suffix);
g_object_set (instance, "connection", connection, NULL);
instance->priv->movie = movie;
return instance;
GType mvs_tmdb_movie_service_get_type (void);
MvsTMDBMovieService* mvs_tmdb_movie_service_new (DBusGConnection *connection,
- MvsTmdbMovie *movie, guint id);
+ MvsTmdbMovie *movie, const gchar *suffix);
G_END_DECLS