fixing default rom setting
authorJavier S. Pedro <maemo@javispedro.com>
Fri, 2 Oct 2009 14:28:24 +0000 (16:28 +0200)
committerJavier S. Pedro <maemo@javispedro.com>
Fri, 2 Oct 2009 14:28:24 +0000 (16:28 +0200)
gui/drnoksnes.schemas.m4
gui/plugin.c
platform/hgw.cpp

index 5179c20..38ebd95 100644 (file)
@@ -59,7 +59,6 @@
       <applyto>/apps/maemo/drnoksnes/rom</applyto>
       <owner>drnoksnes</owner>
       <type>string</type>
-      <default></default>
       <locale name="C">
         <short>ROM to load</short>
         <long>
index 8294013..d9c15bf 100644 (file)
@@ -101,7 +101,7 @@ static inline void set_rom_label(gchar * text)
 static void set_rom(const char * rom_file)
 {
        if (current_rom_file) g_free(current_rom_file);
-       if (!rom_file) {
+       if (!rom_file || strlen(rom_file) == 0) {
                current_rom_file = NULL;
                set_rom_label("<no rom selected>");
                return;
@@ -525,7 +525,7 @@ static void plugin_callback(GtkWidget * menu_item, gpointer data)
                        // Override size limit set by OGS
                        gtk_widget_set_size_request(
                                gtk_widget_get_parent(GTK_WIDGET(buttons_hbox)),
-                               -1, -1);        
+                               -1, -1);
                        break;
 #endif
        }
index cfaaa5f..4ee43e9 100644 (file)
@@ -54,11 +54,12 @@ void HgwDeinit()
 void HgwConfig()
 {
        if (!hgwLaunched) return;
-       
+
        Config.fullscreen = true;
-       
+
        char romFile[PATH_MAX + 1];
-       if (hgw_conf_request_string(hgw, kGConfRomFile, romFile) == HGW_ERR_NONE) {
+       if (hgw_conf_request_string(hgw, kGConfRomFile, romFile) == HGW_ERR_NONE
+               && strlen(romFile) > 0) {
                S9xSetRomFile(romFile);
        } else {
                hgw_context_destroy(hgw, HGW_BYE_INACTIVE);