# HG changeset patch # User Richard Laager # Date 1177348294 0 # Node ID 0fc1b85fd2472936aa68d8a319be51d7be9a49d0 # Parent 670c03e39ff961b3c6580c3dd68c4a861cfa0087 Call the core migrate code. Again, I don't recommend you run this on your main ~/.gaim until the icon migration code is finished. diff -r 670c03e39ff9 -r 0fc1b85fd247 pidgin/gtkmain.c --- a/pidgin/gtkmain.c Mon Apr 23 17:10:38 2007 +0000 +++ b/pidgin/gtkmain.c Mon Apr 23 17:11:34 2007 +0000 @@ -446,6 +446,7 @@ int opt; gboolean gui_check; gboolean debug_enabled; + gboolean migration_failed = FALSE; struct option long_options[] = { {"config", required_argument, NULL, 'c'}, @@ -639,6 +640,15 @@ purple_debug_set_enabled(debug_enabled); + /* If we're using a custom configuration directory, we + * do NOT want to migrate, or weird things will happen. */ + if (opt_config_dir_arg == NULL) + { + if (!purple_core_migrate()) + { + migration_failed = TRUE; + } + } search_path = g_build_filename(purple_user_dir(), "gtkrc-2.0", NULL); gtk_rc_add_default_file(search_path); @@ -663,6 +673,36 @@ winpidgin_init(hint); #endif + if (migration_failed) + { + char *old = g_strconcat(purple_home_dir(), + G_DIR_SEPARATOR_S ".gaim", NULL); + char *text = _( + "Pidgin encountered errors migrating your settings " + "from %s to %s. Please investigate and complete the " + "migration by hand."); + GtkWidget *dialog; + + dialog = gtk_message_dialog_new(NULL, + 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + text, old, purple_user_dir()); + g_free(old); + + g_signal_connect_swapped(dialog, "response", + G_CALLBACK(gtk_main_quit), NULL); + + gtk_widget_show_all(dialog); + + gtk_main(); + +#ifdef HAVE_SIGNAL_H + g_free(segfault_message); +#endif + return 0; + } + purple_core_set_ui_ops(pidgin_core_get_ui_ops()); purple_eventloop_set_ui_ops(pidgin_eventloop_get_ui_ops());