Release history for lariza
next
+ [Fixed]
+ - Issue #15: lariza no longer tries to create local file names with
+ directory separators in them when downloading files.
+
[Changed]
- For the sake of consistency, $LARIZA_WEB_EXTENSIONS_DIR has been
removed.
gboolean
download_handle(WebKitDownload *download, gchar *suggested_filename, gpointer data)
{
- gchar *path, *path2 = NULL, *uri;
+ gchar *sug_clean, *path, *path2 = NULL, *uri;
GtkToolItem *tb;
int suffix = 1;
+ size_t i;
- path = g_build_filename(download_dir, suggested_filename, NULL);
+ sug_clean = g_strdup(suggested_filename);
+ for (i = 0; i < strlen(sug_clean); i++)
+ if (sug_clean[i] == G_DIR_SEPARATOR)
+ sug_clean[i] = '_';
+
+ path = g_build_filename(download_dir, sug_clean, NULL);
path2 = g_strdup(path);
while (g_file_test(path2, G_FILE_TEST_EXISTS) && suffix < 1000)
{
tb = gtk_tool_button_new(NULL, NULL);
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(tb), "gtk-delete");
- gtk_tool_button_set_label(GTK_TOOL_BUTTON(tb), suggested_filename);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(tb), sug_clean);
gtk_toolbar_insert(GTK_TOOLBAR(dm.toolbar), tb, 0);
gtk_widget_show_all(dm.win);
G_CALLBACK(downloadmanager_cancel), download);
}
+ g_free(sug_clean);
g_free(path);
g_free(path2);