From 3802df129d9a688d3f2eaeeacbc59f1d120bc482 Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 13 Apr 2013 02:41:58 +0200 Subject: [PATCH 1/4] Created .gitignore. --- .gitignore | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90a0c62 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +build +config.cache +config.guess +config.h +config.h.in +config.log +config.status +config.sub +configure +depcomp +install-sh +libtool +ltmain.sh +missing +mkinstalldirs +releases +stamp-h +stamp-h1 +stamp-h.in +*~ +*.swp +*.o +.deps + +src/bin2c +src/lemonlauncher +src/default_font.h From c16575449e41f5d4b205dc55f9de2ccb15070965 Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 13 Apr 2013 09:54:23 +0200 Subject: [PATCH 2/4] Get rid of extra database connection. --- src/lemonmenu.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/lemonmenu.cpp b/src/lemonmenu.cpp index afe5b34..baa246e 100644 --- a/src/lemonmenu.cpp +++ b/src/lemonmenu.cpp @@ -284,24 +284,16 @@ void lemon_menu::handle_run() string query("UPDATE games SET count = count+1 WHERE filename = "); query.append("'").append(g->rom()).append("'"); - sqlite3* db = NULL; char* error_msg = NULL; try { - if (sqlite3_open(db_file.c_str(), &db)) - throw bad_lemon(sqlite3_errmsg(db)); - - // execute query and throw exception on error - if (sqlite3_exec(db, query.c_str(), NULL, NULL, &error_msg) + if (sqlite3_exec(_db, query.c_str(), NULL, NULL, &error_msg) != SQLITE_OK) throw bad_lemon(error_msg); } catch (...) { sqlite3_free(error_msg); throw; } - - if (db) - sqlite3_close(db); } } From 2b35a83f73e8f29c55c5a0294bf352d94c58d9fb Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 13 Apr 2013 09:55:14 +0200 Subject: [PATCH 3/4] Sort most played games in descending order. --- src/lemonmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lemonmenu.cpp b/src/lemonmenu.cpp index baa246e..c2c433a 100644 --- a/src/lemonmenu.cpp +++ b/src/lemonmenu.cpp @@ -352,7 +352,7 @@ void lemon_menu::change_view(view_t view) break; case most_played: - order.append("count,name"); + order.append("count DESC,name"); where.append("count > 0"); break; From 653c0ba2b0ba9fc80e75dcca592c1f1f73957a6d Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 13 Apr 2013 10:11:14 +0200 Subject: [PATCH 4/4] Fixed alpha up/down direction. --- src/lemonmenu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lemonmenu.cpp b/src/lemonmenu.cpp index c2c433a..1484534 100644 --- a/src/lemonmenu.cpp +++ b/src/lemonmenu.cpp @@ -195,7 +195,8 @@ void lemon_menu::handle_pgdown() void lemon_menu::handle_alphaup() { - if (_current->select_next_alpha()) { + // up in the alphabet is the previous letter + if (_current->select_previous_alpha()) { reset_snap_timer(); render(); } @@ -203,7 +204,8 @@ void lemon_menu::handle_alphaup() void lemon_menu::handle_alphadown() { - if (_current->select_previous_alpha()) { + // down in the alphabet is the next letter + if (_current->select_next_alpha()) { reset_snap_timer(); render(); }