(gtk) fix ticket #560, faulty handling of bad command-line options

This commit is contained in:
Charles Kerr 2007-12-30 18:23:45 +00:00
parent ea3dcd541b
commit 6e9b5966a5
1 changed files with 8 additions and 1 deletions

View File

@ -221,6 +221,7 @@ main( int argc, char ** argv )
char * err;
struct cbdata * cbdata = g_new (struct cbdata, 1);
GList * argfiles;
GError * gerr;
gboolean didinit = FALSE;
gboolean didlock = FALSE;
gboolean sendquit = FALSE;
@ -242,7 +243,13 @@ main( int argc, char ** argv )
/* initialize gtk */
g_thread_init( NULL );
gtk_init_with_args( &argc, &argv, _("[torrent files]"), entries, domain, NULL );
gerr = NULL;
if( !gtk_init_with_args( &argc, &argv, _("[torrent files]"), entries, domain, &gerr ) ) {
g_message( "%s", gerr->message );
g_clear_error( &gerr );
return 0;
}
didinit = cf_init( tr_getPrefsDirectory(), NULL ); /* must come before actions_init */
tr_prefs_init_global( );
myUIManager = gtk_ui_manager_new ();