void action(const gcn::ActionEvent& actionEvent) { char tempPath[300]; strcpy(tempPath, prefs_get_attr ("rom_path")); strcpy(currentDir,tempPath); if (actionEvent.getSource() == button_main_rom) { run_menuLoad_guichan(currentDir, MENU_SELECT_MAIN_ROM); } if (actionEvent.getSource() == button_ext_rom) { run_menuLoad_guichan(currentDir, MENU_SELECT_EXT_ROM); } if (actionEvent.getSource() == button_key_rom) { run_menuLoad_guichan(currentDir, MENU_SELECT_KEY_ROM); } }
static const char *get_last_savestate_dir (void) { if (!last_savestate_dir) { static int done = 0; unsigned int len; if (!done) { done = 1; atexit (free_last_savestate_dir); } last_savestate_dir = my_strdup (prefs_get_attr ("savestate_path")); } return last_savestate_dir; }