aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-01-25 01:57:41 +0800
committerChris Toshok <toshok@src.gnome.org>2004-01-25 01:57:41 +0800
commit0cbdd811163d861873e62c23370f58ba736a13aa (patch)
tree243a7deed9c780fc5f0a31e6605c8bb68a1221d5 /addressbook/gui
parentd4997530350cec26c5a42c664b4e37673ea513d0 (diff)
downloadgsoc2013-evolution-0cbdd811163d861873e62c23370f58ba736a13aa.tar.gz
gsoc2013-evolution-0cbdd811163d861873e62c23370f58ba736a13aa.tar.zst
gsoc2013-evolution-0cbdd811163d861873e62c23370f58ba736a13aa.zip
use e_folder_map_local_folders. (find_addressbook_dirs): nuke.
2004-01-24 Chris Toshok <toshok@ximian.com> * gui/component/addressbook-migrate.c (migrate_local_folders): use e_folder_map_local_folders. (find_addressbook_dirs): nuke. svn path=/trunk/; revision=24404
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook-migrate.c58
1 files changed, 5 insertions, 53 deletions
diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c
index 1514e72434..07d461b75e 100644
--- a/addressbook/gui/component/addressbook-migrate.c
+++ b/addressbook/gui/component/addressbook-migrate.c
@@ -31,6 +31,7 @@
#include <gtk/gtkmain.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkprogressbar.h>
+#include <e-util/e-folder-map.h>
static GtkWidget *window;
static GtkLabel *label;
@@ -107,55 +108,6 @@ dialog_set_progress (double percent)
gtk_main_iteration ();
}
-static GList*
-find_addressbook_dirs (char *path, gboolean toplevel)
-{
- char *db_path;
- char *subfolder_path;
- GList *list = NULL;
-
- printf ("find_addressbook_dirs (%s)\n", path);
-
- /* check if the present path is a db */
- db_path = g_build_filename (path, "addressbook.db", NULL);
- if (g_file_test (db_path, G_FILE_TEST_EXISTS))
- list = g_list_append (list, g_strdup (path));
- g_free (db_path);
-
- /* recurse to subfolders */
- if (toplevel)
- subfolder_path = g_strdup (path);
- else
- subfolder_path = g_build_filename (path, "subfolders", NULL);
- if (g_file_test (subfolder_path, G_FILE_TEST_IS_DIR)) {
- GDir *dir = g_dir_open (subfolder_path, 0, NULL);
-
- if (dir) {
- const char *name;
- while ((name = g_dir_read_name (dir))) {
- if (strcmp (name, ".") && strcmp (name, "..")) {
- char *p;
- GList *sublist;
-
- if (toplevel)
- p = g_build_filename (path, name, NULL);
- else
- p = g_build_filename (path, "subfolders", name, NULL);
-
- sublist = find_addressbook_dirs (p, FALSE);
- g_free (p);
- list = g_list_concat (list, sublist);
- }
- }
- g_dir_close (dir);
- }
- }
-
- g_free (subfolder_path);
-
- return list;
-}
-
static gboolean
check_for_conflict (ESourceGroup *group, char *name)
{
@@ -458,11 +410,11 @@ migrate_local_folders (AddressbookComponent *component, ESourceGroup *on_this_co
char *old_path = NULL;
char *local_contact_folder = NULL;
char *source_name = NULL;
- GList *dirs, *l;
+ GSList *dirs, *l;
old_path = g_strdup_printf ("%s/evolution/local", g_get_home_dir ());
- dirs = find_addressbook_dirs (old_path, TRUE);
+ dirs = e_folder_map_local_folders (old_path, "contacts");
/* migrate the local addressbook first, to OnThisComputer/Personal */
local_contact_folder = g_build_filename (g_get_home_dir (), "/evolution/local/Contacts",
@@ -487,8 +439,8 @@ migrate_local_folders (AddressbookComponent *component, ESourceGroup *on_this_co
g_free (source_name);
}
- g_list_foreach (dirs, (GFunc)g_free, NULL);
- g_list_free (dirs);
+ g_slist_foreach (dirs, (GFunc)g_free, NULL);
+ g_slist_free (dirs);
g_free (local_contact_folder);
g_free (old_path);