From 09957b4811e82e4aac8daa4049af572c811d5710 Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 9 Apr 2010 02:22:46 +0000 Subject: also load plug-ins from user plug-in directory. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2534 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 6 ++++++ libsylph/defs.h | 1 + libsylph/sylmain.c | 3 ++- src/main.c | 19 ++++++++++++------- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f871955b..8b5b6a63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-09 + + * libsylph/sylmain.c + libsylph/defs.h + src/main.c: also load plug-ins from user plug-in directory. + 2010-04-07 * libsylph/defs.h diff --git a/libsylph/defs.h b/libsylph/defs.h index e80ce08c..0b39d778 100644 --- a/libsylph/defs.h +++ b/libsylph/defs.h @@ -65,6 +65,7 @@ #define TEMPLATE_DIR "templates" #define TMP_DIR "tmp" #define UIDL_DIR "uidl" +#define PLUGIN_DIR "plugins" #define NEWSGROUP_LIST ".newsgroup_list" #define ADDRESS_BOOK "addressbook.xml" #define MANUAL_HTML_INDEX "sylpheed.html" diff --git a/libsylph/sylmain.c b/libsylph/sylmain.c index 6e8ccb80..97e078dd 100644 --- a/libsylph/sylmain.c +++ b/libsylph/sylmain.c @@ -1,6 +1,6 @@ /* * LibSylph -- E-Mail client library - * Copyright (C) 1999-2009 Hiroyuki Yamamoto + * Copyright (C) 1999-2010 Hiroyuki Yamamoto * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -299,6 +299,7 @@ gint syl_setup_rc_dir(void) MAKE_DIR_IF_NOT_EXIST(get_mime_tmp_dir()); MAKE_DIR_IF_NOT_EXIST(get_tmp_dir()); MAKE_DIR_IF_NOT_EXIST(UIDL_DIR); + MAKE_DIR_IF_NOT_EXIST(PLUGIN_DIR); /* remove temporary files */ remove_all_files(get_tmp_dir()); diff --git a/src/main.c b/src/main.c index 71d91bd2..f3a7fc4f 100644 --- a/src/main.c +++ b/src/main.c @@ -1099,6 +1099,7 @@ static void register_system_events(void) static void plugin_init(void) { MainWindow *mainwin; + gchar *path; mainwin = main_window_get(); @@ -1171,17 +1172,21 @@ static void plugin_init(void) syl_plugin_signal_connect("plugin-load", G_CALLBACK(load_cb), NULL); + /* loading plug-ins from user plug-in directory */ + path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, PLUGIN_DIR, NULL); + syl_plugin_load_all(path); + g_free(path); + + /* loading plug-ins from system plug-in directory */ #ifdef G_OS_WIN32 - { - gchar *path; - path = g_strconcat(get_startup_dir(), G_DIR_SEPARATOR_S, - "plugins", NULL); - syl_plugin_load_all(path); - g_free(path); - } + path = g_strconcat(get_startup_dir(), G_DIR_SEPARATOR_S, PLUGIN_DIR, + NULL); + syl_plugin_load_all(path); + g_free(path); #else syl_plugin_load_all(PLUGINDIR); #endif + STATUSBAR_POP(mainwin); } -- cgit v1.2.3