Merge lp:~rodrigo-moya/libubuntuone/location-property into lp:libubuntuone

Proposed by Rodrigo Moya
Status: Merged
Approved by: Rodrigo Moya
Approved revision: 66
Merged at revision: not available
Proposed branch: lp:~rodrigo-moya/libubuntuone/location-property
Merge into: lp:libubuntuone
Diff against target: 89 lines (+35/-2)
4 files modified
bindings/python/ubuntuone.defs (+5/-0)
libubuntuone/u1-music-store.c (+26/-1)
libubuntuone/u1-music-store.h (+2/-1)
tests/test-music-store.c (+2/-0)
To merge this branch: bzr merge lp:~rodrigo-moya/libubuntuone/location-property
Reviewer Review Type Date Requested Status
Stuart Langridge (community) Approve
Review via email: mp+21140@code.launchpad.net

Commit message

Export library path from music store widget

Description of the change

Export library path from music store widget

To post a comment you must log in.
66. By Rodrigo Moya

Added new method to Python bindings

Revision history for this message
Stuart Langridge (sil) wrote :

Works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bindings/python/ubuntuone.defs'
--- bindings/python/ubuntuone.defs 2010-02-09 22:54:22 +0000
+++ bindings/python/ubuntuone.defs 2010-03-11 15:37:25 +0000
@@ -24,4 +24,9 @@
24 (return-type "GtkWidget*")24 (return-type "GtkWidget*")
25)25)
2626
27(define-method get_library_location
28 (of-object "U1MusicStore")
29 (c-name "u1_music_store_get_library_location")
30 (return-type "const-gchar*")
31)
2732
2833
=== modified file 'libubuntuone/u1-music-store.c'
--- libubuntuone/u1-music-store.c 2010-03-08 16:55:26 +0000
+++ libubuntuone/u1-music-store.c 2010-03-11 15:37:25 +0000
@@ -30,6 +30,8 @@
30#include "syncdaemon.h"30#include "syncdaemon.h"
31#include "u1-marshal.h"31#include "u1-marshal.h"
3232
33#define U1_MUSIC_LIBRARY_LOCATION ".ubuntuone/Purchased from Ubuntu One"
34
33#define U1_STORE_URL "/music/login"35#define U1_STORE_URL "/music/login"
34#define U1_LIBRARY_URL "/music/store/library"36#define U1_LIBRARY_URL "/music/store/library"
35#define U1_NOT_LOGGED_IN_STORE_URL "/music/store-no-token"37#define U1_NOT_LOGGED_IN_STORE_URL "/music/store-no-token"
@@ -472,7 +474,7 @@
472 }474 }
473475
474 full_path = g_build_filename (g_get_home_dir (),476 full_path = g_build_filename (g_get_home_dir (),
475 ".ubuntuone/Purchased from Ubuntu One",477 U1_MUSIC_LIBRARY_LOCATION,
476 prop, NULL);478 prop, NULL);
477479
478 download = g_hash_table_lookup (current_downloads, full_path);480 download = g_hash_table_lookup (current_downloads, full_path);
@@ -788,3 +790,26 @@
788790
789 return (GtkWidget *) music_store;791 return (GtkWidget *) music_store;
790}792}
793
794/**
795 * u1_music_store_get_library_location:
796 * @music_store: A #U1MusicStore object.
797 *
798 * Return the location where purchased music is stored on the user's
799 * computer.
800 *
801 * Return value: Location of the music library.
802 */
803const gchar *
804u1_music_store_get_library_location (U1MusicStore *music_store)
805{
806 static gchar *full_path = NULL;
807
808 if (full_path == NULL) {
809 full_path = g_build_filename (g_get_home_dir (),
810 U1_MUSIC_LIBRARY_LOCATION,
811 NULL);
812 }
813
814 return (const gchar *) full_path;
815}
791816
=== modified file 'libubuntuone/u1-music-store.h'
--- libubuntuone/u1-music-store.h 2010-03-04 10:04:51 +0000
+++ libubuntuone/u1-music-store.h 2010-03-11 15:37:25 +0000
@@ -52,7 +52,8 @@
5252
53GType u1_music_store_get_type (void);53GType u1_music_store_get_type (void);
5454
55GtkWidget *u1_music_store_new (void);55GtkWidget *u1_music_store_new (void);
56const gchar *u1_music_store_get_library_location (U1MusicStore *music_store);
5657
57G_END_DECLS58G_END_DECLS
5859
5960
=== modified file 'tests/test-music-store.c'
--- tests/test-music-store.c 2010-03-05 12:50:50 +0000
+++ tests/test-music-store.c 2010-03-11 15:37:25 +0000
@@ -66,6 +66,8 @@
66 g_signal_connect (G_OBJECT (music_store), "download-finished", G_CALLBACK (download_finished_cb), NULL);66 g_signal_connect (G_OBJECT (music_store), "download-finished", G_CALLBACK (download_finished_cb), NULL);
67 gtk_widget_show (music_store);67 gtk_widget_show (music_store);
68 gtk_container_add (GTK_CONTAINER (window), music_store);68 gtk_container_add (GTK_CONTAINER (window), music_store);
69
70 g_print ("Music library location: %s\n", u1_music_store_get_library_location (music_store));
69 71
70 /* Run the application */72 /* Run the application */
71 gtk_widget_show (window);73 gtk_widget_show (window);

Subscribers

People subscribed via source and target branches