From e10ccbd38205bdf451f68932aacfc7f5e3f70dea Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Tue, 24 Jan 2006 18:15:50 +0000 Subject: Run the main loop until the reply is received when activating a running 2006-01-24 Christian Persch * lib/ephy-file-helpers.c: (ephy_dot_dir), (ephy_file_helpers_init): * lib/ephy-file-helpers.h: * src/ephy-dbus.c: * src/ephy-main.c: (unref_proxy_reply_cb), (open_urls), (main): Run the main loop until the reply is received when activating a running instance. Fixes URL opening with two concurrently starting instance. --- lib/ephy-file-helpers.c | 49 +++++++++++++++++++++++++++++++++++-------------- lib/ephy-file-helpers.h | 7 ++++--- 2 files changed, 39 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index c9c62d043..6e024c260 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2002 Jorn Baayen * Copyright (C) 2003, 2004 Marco Pesenti Gritti - * Copyright (C) 2004 Christian Persch + * Copyright (C) 2004, 2005, 2006 Christian Persch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,10 +28,6 @@ #include "eel-gconf-extensions.h" #include "ephy-debug.h" -#include -#include -#include -#include #include #include #include @@ -49,6 +45,11 @@ #include #include +#include +#include +#include +#include + #define EPHY_UUID "0d82d98f-7079-401c-abff-203fcde1ece3" #define EPHY_UUID_ENVVAR "EPHY_UNIQUE" #define EPHY_UUID_ENVSTRING EPHY_UUID_ENVVAR "=" EPHY_UUID @@ -59,6 +60,7 @@ static GHashTable *files = NULL; static GHashTable *mime_table = NULL; +static gboolean have_private_profile = FALSE; static char *dot_dir = NULL; static char *tmp_dir = NULL; static GList *del_on_exit = NULL; @@ -251,19 +253,12 @@ ephy_file (const char *filename) const char * ephy_dot_dir (void) { - if (dot_dir == NULL) - { - dot_dir = g_build_filename (g_get_home_dir (), - GNOME_DOT_GNOME, - "epiphany", - NULL); - } - return dot_dir; } gboolean -ephy_file_helpers_init (GError **error) +ephy_file_helpers_init (gboolean private_profile, + GError **error) { const char *uuid; @@ -285,6 +280,32 @@ ephy_file_helpers_init (GError **error) (GDestroyNotify) g_free, (GDestroyNotify) g_free); + have_private_profile = private_profile; + + if (private_profile) + { + if (ephy_file_tmp_dir () == NULL) + { + g_set_error (error, + EPHY_FILE_HELPERS_ERROR_QUARK, + 0, + _("Could not create a temporary directory in ā€œ%sā€."), + g_get_tmp_dir ()); + return FALSE; + } + + dot_dir = g_build_filename (ephy_file_tmp_dir (), + "epiphany", + NULL); + } + else + { + dot_dir = g_build_filename (g_get_home_dir (), + GNOME_DOT_GNOME, + "epiphany", + NULL); + } + return ephy_ensure_dir_exists (ephy_dot_dir (), error); } diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h index 189cc17e2..505e609c6 100644 --- a/lib/ephy-file-helpers.h +++ b/lib/ephy-file-helpers.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2002 Jorn Baayen * Copyright (C) 2003, 2004 Marco Pesenti Gritti - * Copyright (C) 2004 Christian Persch + * Copyright (C) 2004, 2005, 2006 Christian Persch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,12 +43,13 @@ typedef struct _EphyFileMonitor EphyFileMonitor; typedef void (* EphyFileMonitorFunc) (EphyFileMonitor*, const char*, GnomeVFSMonitorEventType, gpointer); typedef gboolean (* EphyFileMonitorDelayFunc) (EphyFileMonitor*, gpointer); +gboolean ephy_file_helpers_init (gboolean private_profile, + GError **error); + const char *ephy_file (const char *filename); const char *ephy_dot_dir (void); -gboolean ephy_file_helpers_init (GError **error); - void ephy_file_helpers_shutdown (void); char *ephy_file_downloads_dir (void); -- cgit v1.2.3