[evolution] Change when Evolution loads its extension modules



commit 7e1a71ab0a64ff792b4414689a33e1618dfdd4cd
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jan 24 16:09:25 2018 +0100

    Change when Evolution loads its extension modules
    
    There had already been a workaround for EClientCache, which proved
    to be sub-optimal, and it can strike on more places, thus better
    to load the extension modules before EShell is created.

 src/shell/e-shell.c |   16 ----------------
 src/shell/main.c    |    5 +++++
 2 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/src/shell/e-shell.c b/src/shell/e-shell.c
index 4078738..9d79f24 100644
--- a/src/shell/e-shell.c
+++ b/src/shell/e-shell.c
@@ -2103,8 +2103,6 @@ e_shell_get_default (void)
 void
 e_shell_load_modules (EShell *shell)
 {
-       EClientCache *client_cache;
-       const gchar *module_directory;
        GList *list;
 
        g_return_if_fail (E_IS_SHELL (shell));
@@ -2112,15 +2110,6 @@ e_shell_load_modules (EShell *shell)
        if (shell->priv->modules_loaded)
                return;
 
-       /* Load all shared library modules. */
-
-       module_directory = e_shell_get_module_directory (shell);
-       g_return_if_fail (module_directory != NULL);
-
-       list = e_module_load_all_in_directory (module_directory);
-       g_list_foreach (list, (GFunc) g_type_module_unuse, NULL);
-       g_list_free (list);
-
        /* Process shell backends. */
 
        list = g_list_sort (
@@ -2130,11 +2119,6 @@ e_shell_load_modules (EShell *shell)
        g_list_foreach (list, (GFunc) shell_process_backend, shell);
        shell->priv->loaded_backends = list;
 
-       /* XXX The client cache needs extra help loading its extensions,
-        *     since it gets instantiated before any modules are loaded. */
-       client_cache = e_shell_get_client_cache (shell);
-       e_extensible_load_extensions (E_EXTENSIBLE (client_cache));
-
        shell->priv->modules_loaded = TRUE;
 }
 
diff --git a/src/shell/main.c b/src/shell/main.c
index 365fb75..b1e1622 100644
--- a/src/shell/main.c
+++ b/src/shell/main.c
@@ -358,6 +358,7 @@ create_default_shell (void)
        GSettings *settings;
        GApplicationFlags flags;
        gboolean online = TRUE;
+       GList *module_types;
        GError *error = NULL;
 
        settings = e_util_ref_settings ("org.gnome.evolution.shell");
@@ -391,6 +392,10 @@ create_default_shell (void)
                g_clear_error (&error);
        }
 
+       /* Load all shared library modules. */
+       module_types = e_module_load_all_in_directory (EVOLUTION_MODULEDIR);
+       g_list_free_full (module_types, (GDestroyNotify) g_type_module_unuse);
+
        flags = G_APPLICATION_HANDLES_OPEN |
                G_APPLICATION_HANDLES_COMMAND_LINE;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]