Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sat, 29 Oct 2016 13:33:21 UTC Commit: 85a2f4bc6fbb9f3f5f4de26b676ae0120554b707 https://github.com/geany/geany/commit/85a2f4bc6fbb9f3f5f4de26b676ae0120554b7...
Log Message: ----------- Do not strip dots from proxy plugin extensions
Only warn when an extension starts with a dot, because it's unlikely to be what the author wanted, but leave the dot there. This forces the author to fix the extension instead of ignoring the warning.
Also, include the proxy plugin name in the warning message.
Follow-up to #1212.
Modified Paths: -------------- src/plugins.c
Modified: src/plugins.c 20 lines changed, 7 insertions(+), 13 deletions(-) =================================================================== @@ -2005,18 +2005,6 @@ static void pm_show_dialog(GtkMenuItem *menuitem, gpointer user_data) }
-static const gchar *fix_extension(const gchar *ext) -{ - if (*ext == '.') - { - g_warning(_("Proxy plugin extension '%s' starts with a dot, " - "stripping. Please fix your proxy plugin."), ext); - ext++; - } - return ext; -} - - /** Register the plugin as a proxy for other plugins * * Proxy plugins register a list of file extensions and a set of callbacks that are called @@ -2067,8 +2055,14 @@ gboolean geany_plugin_register_proxy(GeanyPlugin *plugin, const gchar **extensio
foreach_strv(ext, extensions) { + if (**ext == '.') + { + g_warning(_("Proxy plugin '%s' extension '%s' starts with a dot. " + "Please fix your proxy plugin."), p->info.name, *ext); + } + proxy = g_new(PluginProxy, 1); - g_strlcpy(proxy->extension, fix_extension(*ext), sizeof(proxy->extension)); + g_strlcpy(proxy->extension, *ext, sizeof(proxy->extension)); proxy->plugin = p; /* prepend, so that plugins automatically override core providers for a given extension */ g_queue_push_head(&active_proxies, proxy);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).