ocarina: Don't do anything if chooser result is blank

If we don't have a filepath to scan or play then we shouldn't do
anything with the path.
This commit is contained in:
Bryan Schumaker 2011-09-10 10:49:51 -04:00
parent 705ca61e6a
commit 36212af3a4
2 changed files with 6 additions and 3 deletions

View File

@ -60,8 +60,10 @@ GtkWidget *make_text_button(const gchar *stockid,
static void on_click_open_file(GtkWidget *b, GdkEvent *e, gpointer d)
{
string file = ocarina_choose_file();
print("Playing file: " + file);
libsaria_load(file);
if (file != "") {
print("Playing file: " + file);
libsaria_load(file);
}
}
GtkWidget *make_open_button()

View File

@ -12,7 +12,8 @@ static GtkWidget *library_settings = NULL;
static void on_click_add(GtkWidget *b, GdkEvent *e, gpointer d)
{
string dir = ocarina_choose_dir();
print("Scanning dir: " + dir);
if (dir != "" )
print("Scanning dir: " + dir);
}
static GtkWidget *make_add_button()