]> spindle.queued.net Git - midori/commitdiff
Create as needed when opening user addon target folder
authorPaweł Forysiuk <tuxator@o2.pl>
Mon, 21 May 2012 21:07:31 +0000 (23:07 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 21 May 2012 21:07:31 +0000 (23:07 +0200)
extensions/addons.c

index 7c566f41170e161670953b1d2f3d8b10863d8690..edf5339b7a298859699cd12a71a98c945f2d2adf 100644 (file)
@@ -522,10 +522,16 @@ addons_open_target_folder_clicked_cb (GtkWidget* toolitem,
         folder = g_path_get_dirname (element->fullpath);
     }
     else
+    {
         folder = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (),
                                PACKAGE_NAME,
                                addons->kind == ADDONS_USER_SCRIPTS
                                ? "scripts" : "styles", NULL);
+
+        if (!g_file_test (folder, G_FILE_TEST_EXISTS))
+            katze_mkdir_with_parents (folder, 0700);
+    }
+
     folder_uri = g_filename_to_uri (folder, NULL, NULL);
     g_free (folder);