Merge lp:~ivaldi/midori/skip-plugin into lp:midori

Proposed by André Stösel
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6247
Merged at revision: 6256
Proposed branch: lp:~ivaldi/midori/skip-plugin
Merge into: lp:midori
Diff against target: 50 lines (+32/-1)
1 file modified
midori/midori-websettings.c (+32/-1)
To merge this branch: bzr merge lp:~ivaldi/midori/skip-plugin
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Cris Dywan Approve
Review via email: mp+172803@code.launchpad.net

Commit message

Test if plugins are redundant instead of skipping them all

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

This finalley fixes the duplicate Google Talk plugins for me.

Small issue: please use TRUE/ FALSE in C code.

review: Needs Fixing
lp:~ivaldi/midori/skip-plugin updated
6246. By André Stösel

Fix coding style issues

Revision history for this message
André Stösel (ivaldi) wrote :

Oops, sorry, I'm guess I'm too used to vala ;)

fixed

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

Thanks!

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

Paweł, could you give it a spin? I recall your plugin paths are quite different to mine at least and I'd prefer a second review on this one.

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

This seems to break listing in about:version (we probably hardcode same string skip there. Would be nice to see how it behaves on the systems where 64 bit plugins dirs is just a symlink to 32 bit one (i think it was ubuntu). Otherwise it seems to work. Cannot get flash to work witn gtk3 but it is probably unrelated to this change.

review: Needs Information
Revision history for this message
André Stösel (ivaldi) wrote :

Nice catch! Either the extension list or about:version works, but never both. I'll fix it.

lp:~ivaldi/midori/skip-plugin updated
6247. By André Stösel

Fixed bug which occurs when midori_web_settings_skip_plugin is called multiple times

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Nothing looks obviously wrong now and from mild testing it seems to work properly.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-websettings.c'
2--- midori/midori-websettings.c 2013-06-19 20:20:05 +0000
3+++ midori/midori-websettings.c 2013-07-07 13:17:26 +0000
4@@ -596,6 +596,8 @@
5 /**
6 * midori_web_settings_skip_plugin:
7 *
8+ * Tests if a plugin is redundant
9+ *
10 * Returns: %TRUE if the passed plugin shouldn't be shown in UI listings.
11 *
12 * Since: 0.5.1
13@@ -603,7 +605,36 @@
14 gboolean
15 midori_web_settings_skip_plugin (const gchar* path)
16 {
17- return !path || strstr (path, "npwrapper.") || strstr (path, "plugins-wrapped");
18+ static GHashTable* plugins = NULL;
19+ gchar* basename = NULL;
20+ gchar* plugin_path = NULL;
21+
22+ if (!path)
23+ return TRUE;
24+
25+ if (!plugins)
26+ plugins = g_hash_table_new (g_str_hash, g_str_equal);
27+
28+ basename = g_path_get_basename (path);
29+
30+ plugin_path = g_hash_table_lookup (plugins, basename);
31+ if (g_strcmp0 (path, plugin_path) == 0)
32+ {
33+ return FALSE;
34+ }
35+
36+ if (plugin_path != NULL)
37+ {
38+ g_free (basename);
39+
40+ return TRUE;
41+ }
42+
43+ g_hash_table_insert (plugins, basename, g_strdup (path));
44+
45+ /* Note: do not free basename */
46+
47+ return FALSE;
48 }
49
50 /**

Subscribers

People subscribed via source and target branches

to all changes: