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
=== modified file 'midori/midori-websettings.c'
--- midori/midori-websettings.c 2013-06-19 20:20:05 +0000
+++ midori/midori-websettings.c 2013-07-07 13:17:26 +0000
@@ -596,6 +596,8 @@
596/**596/**
597 * midori_web_settings_skip_plugin:597 * midori_web_settings_skip_plugin:
598 *598 *
599 * Tests if a plugin is redundant
600 *
599 * Returns: %TRUE if the passed plugin shouldn't be shown in UI listings.601 * Returns: %TRUE if the passed plugin shouldn't be shown in UI listings.
600 *602 *
601 * Since: 0.5.1603 * Since: 0.5.1
@@ -603,7 +605,36 @@
603gboolean605gboolean
604midori_web_settings_skip_plugin (const gchar* path)606midori_web_settings_skip_plugin (const gchar* path)
605{607{
606 return !path || strstr (path, "npwrapper.") || strstr (path, "plugins-wrapped");608 static GHashTable* plugins = NULL;
609 gchar* basename = NULL;
610 gchar* plugin_path = NULL;
611
612 if (!path)
613 return TRUE;
614
615 if (!plugins)
616 plugins = g_hash_table_new (g_str_hash, g_str_equal);
617
618 basename = g_path_get_basename (path);
619
620 plugin_path = g_hash_table_lookup (plugins, basename);
621 if (g_strcmp0 (path, plugin_path) == 0)
622 {
623 return FALSE;
624 }
625
626 if (plugin_path != NULL)
627 {
628 g_free (basename);
629
630 return TRUE;
631 }
632
633 g_hash_table_insert (plugins, basename, g_strdup (path));
634
635 /* Note: do not free basename */
636
637 return FALSE;
607}638}
608639
609/**640/**

Subscribers

People subscribed via source and target branches

to all changes: