예제 #1
0
static void
setup (void)
{
        G_LOCK (mutex);
        if (localedir != NULL) {
                G_UNLOCK (mutex);
                return;
        }

        localedir = e_util_replace_prefix (E_DATA_SERVER_PREFIX, e_util_get_cp_prefix (), LOCALEDIR);

	libexecdir = e_util_replace_prefix (E_DATA_SERVER_PREFIX, e_util_get_prefix (), CAMEL_LIBEXECDIR);
	providerdir = e_util_replace_prefix (E_DATA_SERVER_PREFIX, e_util_get_prefix (), CAMEL_PROVIDERDIR);

	G_UNLOCK (mutex);
}
예제 #2
0
static gint
plugin_lib_construct (EPlugin *plugin,
                      xmlNodePtr root)
{
	EPluginLib *plugin_lib = E_PLUGIN_LIB (plugin);

	/* Set the location before chaining up, as some EPluginHooks
	 * will cause the module to load during hook construction. */

	plugin_lib->location = e_plugin_xml_prop (root, "location");

	if (plugin_lib->location == NULL) {
		g_warning ("Library plugin '%s' has no location", plugin->id);
		return -1;
	}
#ifdef G_OS_WIN32
	{
		gchar *mapped_location =
			e_util_replace_prefix (
				EVOLUTION_PREFIX,
				e_util_get_prefix (),
				plugin_lib->location);
		g_free (plugin_lib->location);
		plugin_lib->location = mapped_location;
	}
#endif

	/* Chain up to parent's construct() method. */
	if (E_PLUGIN_CLASS (parent_class)->construct (plugin, root) == -1)
		return -1;

	/* If we're enabled, check for the load-on-startup property */
	if (plugin->enabled) {
		xmlChar *tmp;

		tmp = xmlGetProp (root, (const guchar *)"load-on-startup");
		if (tmp) {
			if (plugin_lib_loadmodule (plugin) != 0) {
				xmlFree (tmp);
				return -1;
			}
			xmlFree (tmp);
		}
	}

	return 0;
}