/[packages]/cauldron/xdg-user-dirs-gtk/current/SOURCES/xdg-user-dirs-gtk-0.5-mdkfolders.patch
ViewVC logotype

Contents of /cauldron/xdg-user-dirs-gtk/current/SOURCES/xdg-user-dirs-gtk-0.5-mdkfolders.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6400 - (show annotations) (download)
Tue Jan 11 22:14:29 2011 UTC (13 years, 3 months ago) by blino
File size: 1975 byte(s)
imported package xdg-user-dirs-gtk
1 --- xdg-user-dirs-gtk-0.6/update.c.mdkfolders 2007-07-03 10:40:34.000000000 +0200
2 +++ xdg-user-dirs-gtk-0.6/update.c 2007-09-28 17:39:36.000000000 +0200
3 @@ -210,6 +210,8 @@ update_locale (XdgDirEntry *old_entries)
4 /* Change succeeded, remove any leftover empty directories */
5 for (i = 0; old_entries[i].type != NULL; i++)
6 {
7 + char *dot_directory;
8 +
9 /* Never remove homedir */
10 if (strcmp (old_entries[i].path, g_get_home_dir ()) == 0)
11 continue;
12 @@ -219,6 +221,13 @@ update_locale (XdgDirEntry *old_entries)
13 if (entry)
14 continue;
15
16 + /* remove leftover of .directory from mdk-folders */
17 + dot_directory = g_build_filename (old_entries[i].path, "/.directory", NULL);
18 + if (g_file_test (dot_directory, G_FILE_TEST_IS_REGULAR))
19 + g_unlink (dot_directory);
20 +
21 + g_free (dot_directory);
22 +
23 /* Remove the dir, will fail if not empty */
24 g_rmdir (old_entries[i].path);
25 }
26 @@ -279,7 +288,37 @@ main (int argc, char *argv[])
27 bookmarks = parse_gtk_bookmarks (NULL);
28
29 modified_bookmarks = FALSE;
30 - if (bookmarks == NULL)
31 +
32 +
33 + /* Drop any mdk-folder bookmarks if found */
34 + if (bookmarks != NULL) {
35 + char *mdk_folders;
36 + GList *copy;
37 +
38 + mdk_folders = g_strconcat (g_get_home_dir (), "/.mdk-folders/", NULL);
39 + copy = g_list_copy (bookmarks);
40 + for (l = copy; l != NULL; l = l->next)
41 + {
42 + char *path;
43 + GList *prev;
44 +
45 + bookmark = l->data;
46 + path = g_filename_from_uri (bookmark->uri, NULL, NULL);
47 + if (path) {
48 + if (g_str_has_prefix (path, mdk_folders)) {
49 + modified_bookmarks = TRUE;
50 + g_free (bookmark->uri);
51 + g_free (bookmark->label);
52 + bookmarks = g_list_remove (bookmarks, bookmark);
53 + }
54 + }
55 + g_free (path);
56 + }
57 + g_list_free (copy);
58 + }
59 +
60 + /* add default directories if we migrated mdk folders */
61 + if (bookmarks == NULL || modified_bookmarks)
62 {
63 char *make_bm_for[] = {
64 "DOCUMENTS",

  ViewVC Help
Powered by ViewVC 1.1.30