comparison finch/finch.c @ 32819:2c6510167895 default tip

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24) to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 02 Jun 2012 02:30:49 +0000
parents 36fc641ca013
children
comparison
equal deleted inserted replaced
32818:01ff09d4a463 32819:2c6510167895
337 return 0; 337 return 0;
338 } 338 }
339 339
340 /* set a user-specified config directory */ 340 /* set a user-specified config directory */
341 if (opt_config_dir_arg != NULL) { 341 if (opt_config_dir_arg != NULL) {
342 purple_util_set_user_dir(opt_config_dir_arg); 342 if (g_path_is_absolute(opt_config_dir_arg)) {
343 purple_util_set_user_dir(opt_config_dir_arg);
344 } else {
345 /* Make an absolute (if not canonical) path */
346 char *cwd = g_get_current_dir();
347 char *path = g_build_path(G_DIR_SEPARATOR_S, cwd, opt_config_dir_arg, NULL);
348 purple_util_set_user_dir(path);
349 g_free(path);
350 g_free(cwd);
351 }
352
343 g_free(opt_config_dir_arg); 353 g_free(opt_config_dir_arg);
344 } 354 }
345 355
346 /* 356 /*
347 * We're done piddling around with command line arguments. 357 * We're done piddling around with command line arguments.
348 * Fire up this baby. 358 * Fire up this baby.
349 */ 359 */
350 360
351 /* We don't want debug-messages to show up and corrupt the display */ 361 /* We don't want debug-messages to show up and corrupt the display */
352 purple_debug_set_enabled(debug_enabled); 362 purple_debug_set_enabled(debug_enabled);
353
354 /* If we're using a custom configuration directory, we
355 * do NOT want to migrate, or weird things will happen. */
356 if (opt_config_dir_arg == NULL)
357 {
358 if (!purple_core_migrate())
359 {
360 char *old = g_strconcat(purple_home_dir(),
361 G_DIR_SEPARATOR_S ".gaim", NULL);
362 char *text = g_strdup_printf(_(
363 "%s encountered errors migrating your settings "
364 "from %s to %s. Please investigate and complete the "
365 "migration by hand. Please report this error at http://developer.pidgin.im"), _("Finch"),
366 old, purple_user_dir());
367
368 g_free(old);
369
370 purple_print_utf8_to_console(stderr, text);
371 g_free(text);
372
373 return 0;
374 }
375 }
376 363
377 purple_core_set_ui_ops(gnt_core_get_ui_ops()); 364 purple_core_set_ui_ops(gnt_core_get_ui_ops());
378 purple_eventloop_set_ui_ops(gnt_eventloop_get_ui_ops()); 365 purple_eventloop_set_ui_ops(gnt_eventloop_get_ui_ops());
379 purple_idle_set_ui_ops(finch_idle_get_ui_ops()); 366 purple_idle_set_ui_ops(finch_idle_get_ui_ops());
380 367