Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
18 changes: 6 additions & 12 deletions src/lemonmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ 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();
}
}

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();
}
Expand Down Expand Up @@ -284,24 +286,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);
}
}

Expand Down Expand Up @@ -360,7 +354,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;

Expand Down