Merge lp:~midori/midori/win32-bookmarks-import into lp:midori

Proposed by Paweł Forysiuk
Status: Merged
Approved by: Cris Dywan
Approved revision: 7080
Merged at revision: 7084
Proposed branch: lp:~midori/midori/win32-bookmarks-import
Merge into: lp:midori
Diff against target: 91 lines (+30/-3)
3 files modified
midori/midori-browser.c (+13/-3)
midori/sokoke.c (+14/-0)
midori/sokoke.h (+3/-0)
To merge this branch: bzr merge lp:~midori/midori/win32-bookmarks-import
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Review via email: mp+281409@code.launchpad.net

Commit message

win32: Make bookmark import code use proper paths for win32 browser profiles

To post a comment you must log in.
7080. By Paweł Forysiuk <email address hidden>

Specify supported "family" of Opera browser

Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice and straight-forward. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2015-11-30 23:44:52 +0000
3+++ midori/midori-browser.c 2016-01-04 20:56:48 +0000
4@@ -4502,13 +4502,18 @@
5 const gchar* icon;
6 } BookmarkClient;
7 static const BookmarkClient bookmark_clients[] = {
8+#ifdef G_OS_WIN32
9+ { "Opera/Opera/bookmarks.adr", N_("Opera 12.x"), "opera" },
10+ { "Mozilla/Firefox/Profiles/*/bookmarks.html", N_("Firefox (%s)"), "firefox" },
11+#else
12 { ".local/share/data/Arora/bookmarks.xbel", N_("Arora"), "arora" },
13 { ".kazehakase/bookmarks.xml", N_("Kazehakase"), "kazehakase-icon" },
14- { ".opera/bookmarks.adr", N_("Opera"), "opera" },
15+ { ".opera/bookmarks.adr", N_("Opera 12.x"), "opera" },
16 { ".kde/share/apps/konqueror/bookmarks.xml", N_("Konqueror"), "konqueror" },
17 { ".gnome2/epiphany/bookmarks.rdf", N_("Epiphany"), "epiphany" },
18 { ".mozilla/firefox/*/bookmarks.html", N_("Firefox (%s)"), "firefox" },
19 { ".config/midori/bookmarks.xbel", N_("Midori 0.2.6"), "midori" },
20+#endif
21 };
22
23 GtkWidget* dialog;
24@@ -4560,6 +4565,11 @@
25 {
26 const gchar* location = bookmark_clients[i].path;
27 const gchar* client = bookmark_clients[i].name;
28+#ifdef G_OS_WIN32
29+ const gchar* home_dir = sokoke_get_win32_appdata_dir();
30+#else
31+ const gchar* home_dir = g_get_home_dir();
32+#endif
33 gchar* path = NULL;
34
35 /* Interpret * as 'any folder' */
36@@ -4567,7 +4577,7 @@
37 {
38 gchar** parts = g_strsplit (location, "*", 2);
39 GDir* dir;
40- path = g_build_filename (g_get_home_dir (), parts[0], NULL);
41+ path = g_build_filename (home_dir, parts[0], NULL);
42 if ((dir = g_dir_open (path, 0, NULL)))
43 {
44 const gchar* name;
45@@ -4596,7 +4606,7 @@
46 continue;
47 }
48
49- path = g_build_filename (g_get_home_dir (), location, NULL);
50+ path = g_build_filename (home_dir, location, NULL);
51 if (g_access (path, F_OK) == 0)
52 gtk_list_store_insert_with_values (model, NULL, G_MAXINT,
53 0, _(client), 1, bookmark_clients[i].icon,
54
55=== modified file 'midori/sokoke.c'
56--- midori/sokoke.c 2014-03-19 20:48:58 +0000
57+++ midori/sokoke.c 2016-01-04 20:56:48 +0000
58@@ -919,6 +919,20 @@
59 }
60
61 #ifdef G_OS_WIN32
62+const gchar*
63+sokoke_get_win32_appdata_dir()
64+{
65+ WCHAR path[MAX_PATH];
66+ gchar* appdata_dir = NULL;
67+
68+ SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, path);
69+
70+ MultiByteToWideChar (CP_UTF8, 0, appdata_dir, -1, path, MAX_PATH);
71+
72+ return g_strdup(path);
73+}
74+
75+
76 gchar*
77 sokoke_get_win32_desktop_lnk_path_for_filename (gchar* filename)
78 {
79
80=== modified file 'midori/sokoke.h'
81--- midori/sokoke.h 2014-02-22 23:19:22 +0000
82+++ midori/sokoke.h 2016-01-04 20:56:48 +0000
83@@ -109,6 +109,9 @@
84 sokoke_search_entry_new (const gchar* placeholder_text);
85
86 #ifdef G_OS_WIN32
87+const gchar*
88+sokoke_get_win32_appdata_dir();
89+
90 gchar*
91 sokoke_get_win32_desktop_lnk_path_for_filename (gchar* filename);
92

Subscribers

People subscribed via source and target branches

to all changes: