diff --git a/src/Database.cpp b/src/Database.cpp index 0df3632..2e017fc 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -116,7 +116,7 @@ void Database::InsertSample(int favorite, std::string filename, if (rc != SQLITE_DONE) { - wxLogDebug("No data inserted. Error code: %d", rc); + wxLogDebug("No data inserted. Error code: %d: Msg: %s", rc , sqlite3_errmsg(m_Database)); } rc = sqlite3_finalize(m_Stmt); @@ -127,7 +127,7 @@ void Database::InsertSample(int favorite, std::string filename, // "Error! Cannot insert data into table.", // "Error", wxOK | wxICON_ERROR); // msgDialog.ShowModal(); - wxLogDebug("Error! Cannot insert data into table. Error code: %d", rc); + wxLogDebug("Error! Cannot insert data into table. Error code: %d: Msg: %s", rc , sqlite3_errmsg(m_Database)); } else { @@ -746,6 +746,7 @@ wxVector> Database::FilterDatabaseBySampleName(wxVector(sqlite3_column_text(m_Stmt, 0))); - return true; + haveSample = true; } rc = sqlite3_finalize(m_Stmt); @@ -778,6 +779,8 @@ bool Database::HasSample(std::string filename) } sqlite3_close(m_Database); + + return haveSample; } catch (const std::exception &exception) {