commit be5b4d822eece41faba4e19fe52f0d0afe43bef4
Author: phantomjinx <p.g.richard...@phantomjinx.co.uk>
Date:   Wed Dec 29 20:57:19 2010 +0000

    Another attempt at 'handling' %27 in ipod mountpoints
    
    * Use g_uri_unescape_string for display of mountpoint in warning messages.
      Should convert %27 and other characters back to puntuaction marks

 libgtkpod/autodetection.c                      |    9 ++++++---
 libgtkpod/file_itunesdb.c                      |   12 ++++++------
 plugins/repository_editor/repository_actions.c |    8 ++++++--
 plugins/repository_editor/repository_init.c    |    4 +++-
 4 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/libgtkpod/autodetection.c b/libgtkpod/autodetection.c
index efe5a0e..e0bc5b0 100644
--- a/libgtkpod/autodetection.c
+++ b/libgtkpod/autodetection.c
@@ -203,9 +203,11 @@ static gboolean ad_timeout_cb(gpointer data) {
         while (ad->new_ipod_uris) {
             iTunesDB *itdb = NULL, *loaded_itdb = NULL;
             gchar *mountpoint;
+            gchar *displaymp;
             struct itdbs_head *itdbs;
             GList *gl = ad->new_ipod_uris;
             gchar *mount_uri = gl->data;
+            displaymp = g_uri_unescape_string(mount_uri, NULL);
 
             ad->new_ipod_uris = g_list_delete_link(ad->new_ipod_uris, gl);
 
@@ -218,7 +220,7 @@ static gboolean ad_timeout_cb(gpointer data) {
             g_object_unref(muri);
 
             if (mountpoint) {
-                debug ("Mounted iPod at '%s'\n", mount_uri);
+                debug ("Mounted iPod at '%s'\n", displaymp);
                 itdb = ad_find_repository_with_mountpoint(mountpoint);
             }
 
@@ -240,11 +242,11 @@ static gboolean ad_timeout_cb(gpointer data) {
                         set_itdb_prefs_int(loaded_itdb, "type", 
loaded_itdb->usertype);
                     }
                     else {
-                        gtkpod_warning(_("Newly mounted iPod at '%s' could not 
be loaded into gtkpod.\n\n"), mount_uri);
+                        gtkpod_warning(_("Newly mounted iPod at '%s' could not 
be loaded into gtkpod.\n\n"), displaymp);
                     }
                 }
                 else {
-                    gtkpod_warning(_("Newly mounted iPod at '%s' appears to be 
already loaded!\n\n"), mount_uri);
+                    gtkpod_warning(_("Newly mounted iPod at '%s' appears to be 
already loaded!\n\n"), displaymp);
                 } debug ("...OK (used)\n");
             }
             else { /* Set up new itdb (which we'll add to the end of the list) 
*/
@@ -272,6 +274,7 @@ static gboolean ad_timeout_cb(gpointer data) {
 
             g_free(mountpoint);
             g_free(mount_uri);
+            g_free(displaymp);
 
             g_mutex_lock (ad->mutex);
         }
diff --git a/libgtkpod/file_itunesdb.c b/libgtkpod/file_itunesdb.c
index 0218974..d640e0e 100644
--- a/libgtkpod/file_itunesdb.c
+++ b/libgtkpod/file_itunesdb.c
@@ -121,9 +121,7 @@ void fill_in_extended_info(Track *track, gint32 total, 
gint32 num) {
         sei = g_hash_table_lookup(extendedinfohash, &ipod_id);
     }
     if (!sei && extendedinfohash_sha1) {
-              gtkpod_statusbar_message (
-                 _("Matching SHA1 checksum for file %d/%d"),
-                 num, total);
+        gtkpod_statusbar_message(_("Matching SHA1 checksum for file %d/%d"), 
num, total);
         while (widgets_blocked && gtk_events_pending())
             gtk_main_iteration();
 
@@ -800,15 +798,17 @@ iTunesDB *gp_load_ipod(iTunesDB *itdb) {
 
     itunesdb = itdb_get_itunesdb_path(mountpoint);
     if (!itunesdb) {
+        gchar *displaymp = g_uri_unescape_string(mountpoint, NULL);
         gchar
                 *str =
-                        g_strdup_printf(_("Could not find iPod directory 
structure at '%s'.\n\nIf you are sure that the iPod is properly mounted at 
'%s', it may not be initialized for use. In this case, gtkpod can initialize it 
for you.\n\nDo you want to create the directory structure now?"), mountpoint, 
mountpoint);
+                        g_strdup_printf(_("Could not find iPod directory 
structure at '%s'.\n\nIf you are sure that the iPod is properly mounted at 
'%s', it may not be initialized for use. In this case, gtkpod can initialize it 
for you.\n\nDo you want to create the directory structure now?"), displaymp, 
displaymp);
 
         gint
                 result =
                         gtkpod_confirmation_simple(GTK_MESSAGE_WARNING, 
_("iPod directory structure not found"), str, _("Create directory structure"));
 
         g_free(str);
+        g_free(displaymp);
 
         if (result == GTK_RESPONSE_OK) {
             ok_to_load = gtkpod_init_repository(itdb);
@@ -1722,7 +1722,7 @@ static gboolean gp_write_itdb(iTunesDB *itdb) {
     }
 
     for (it = itdb->tracks; it != NULL; it = it->next) {
-        gp_track_cleanup_empty_strings ((Itdb_Track *)it->data);
+        gp_track_cleanup_empty_strings((Itdb_Track *) it->data);
     }
 
     if (success && !get_offline(itdb) && (itdb->usertype & GP_ITDB_TYPE_IPOD)) 
{ /* write to the iPod */
@@ -1837,7 +1837,7 @@ static gboolean gp_write_itdb(iTunesDB *itdb) {
     }
 
     for (it = itdb->tracks; it != NULL; it = it->next) {
-        gp_track_validate_entries ((Itdb_Track *)it->data);
+        gp_track_validate_entries((Itdb_Track *) it->data);
     }
 
     /* If the ipod supports photos and the photo_data_changed
diff --git a/plugins/repository_editor/repository_actions.c 
b/plugins/repository_editor/repository_actions.c
index dc4c1e2..5f7ebd6 100644
--- a/plugins/repository_editor/repository_actions.c
+++ b/plugins/repository_editor/repository_actions.c
@@ -53,10 +53,12 @@ void on_create_ipod_directories(GtkAction* action, 
RepositoryEditorPlugin* plugi
 
     if (!eitdb->itdb_imported) {
         gchar *mountpoint = get_itdb_prefs_string(itdb, KEY_MOUNTPOINT);
-        gchar *str = g_strdup_printf(_("iPod at '%s' is not loaded.\nPlease 
load it first."), mountpoint);
+        gchar *displaymp = g_uri_unescape_string(mountpoint, NULL);
+        gchar *str = g_strdup_printf(_("iPod at '%s' is not loaded.\nPlease 
load it first."), displaymp);
         gtkpod_warning(str);
         g_free(str);
         g_free(mountpoint);
+        g_free(displaymp);
     }
     else {
         repository_ipod_init(itdb);
@@ -76,10 +78,12 @@ void on_check_ipod_files(GtkAction* action, 
RepositoryEditorPlugin* plugin) {
 
     if (!eitdb->itdb_imported) {
         gchar *mountpoint = get_itdb_prefs_string(itdb, KEY_MOUNTPOINT);
-        gchar *str = g_strdup_printf(_("iPod at '%s' is not loaded.\nPlease 
load it first."), mountpoint);
+        gchar *displaymp = g_uri_unescape_string(mountpoint, NULL);
+        gchar *str = g_strdup_printf(_("iPod at '%s' is not loaded.\nPlease 
load it first."), displaymp);
         gtkpod_warning(str);
         g_free(str);
         g_free(mountpoint);
+        g_free(displaymp);
     }
     else {
         check_db(itdb);
diff --git a/plugins/repository_editor/repository_init.c 
b/plugins/repository_editor/repository_init.c
index 7041294..7e51859 100644
--- a/plugins/repository_editor/repository_init.c
+++ b/plugins/repository_editor/repository_init.c
@@ -268,10 +268,12 @@ void repository_ipod_init_set_model(iTunesDB *itdb, const 
gchar *old_model) {
 
     /* Set up label */
     mountpoint = get_itdb_prefs_string(itdb, KEY_MOUNTPOINT);
+    gchar *displaymp = g_uri_unescape_string(mountpoint, NULL);
     g_return_if_fail (mountpoint);
-    g_snprintf(buf, PATH_MAX, _("<b>Please select your iPod model at 
</b><i>%s</i>"), mountpoint);
+    g_snprintf(buf, PATH_MAX, _("<b>Please select your iPod model at 
</b><i>%s</i>"), displaymp);
     gtk_label_set_markup(GTK_LABEL (GET_WIDGET (xml, SIMD_LABEL)), buf);
     g_free(mountpoint);
+    g_free(displaymp);
 
     /* Setup model number combo */
     cb = GTK_COMBO_BOX (GET_WIDGET (xml, SIMD_MODEL_COMBO));

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to