diff --git a/src/core/library.c b/src/core/library.c index a8fbff79d4a..7a3913316bb 100644 --- a/src/core/library.c +++ b/src/core/library.c @@ -38,6 +38,7 @@ struct mLibrary { #define CONSTRAINTS_ROMONLY \ "CASE WHEN :useSize THEN roms.size = :size ELSE 1 END AND " \ "CASE WHEN :usePlatform THEN roms.platform = :platform ELSE 1 END AND " \ + "CASE WHEN :useModels THEN roms.models & :models ELSE 1 END AND " \ "CASE WHEN :useCrc32 THEN roms.crc32 = :crc32 ELSE 1 END AND " \ "CASE WHEN :useInternalCode THEN roms.internalCode = :internalCode ELSE 1 END" @@ -99,7 +100,9 @@ static void _bindConstraints(sqlite3_stmt* statement, const struct mLibraryEntry } if (constraints->platformModels != M_LIBRARY_MODEL_UNKNOWN) { + useIndex = sqlite3_bind_parameter_index(statement, ":useModels"); index = sqlite3_bind_parameter_index(statement, ":models"); + sqlite3_bind_int(statement, useIndex, 1); sqlite3_bind_int(statement, index, constraints->platformModels); } } @@ -184,8 +187,8 @@ struct mLibrary* mLibraryLoad(const char* path) { goto error; } else if (romsTableVersion < 2) { static const char upgradeRomsTable[] = - " ALTER TABLE roms" - "\nADD COLUMN models INTEGER NULL"; + " ALTER TABLE roms" + "\n ADD COLUMN models INTEGER NULL"; if (sqlite3_exec(library->db, upgradeRomsTable, NULL, NULL, NULL)) { goto error; } diff --git a/src/platform/qt/CMakeLists.txt b/src/platform/qt/CMakeLists.txt index ff859eae6a3..c067c1ec124 100644 --- a/src/platform/qt/CMakeLists.txt +++ b/src/platform/qt/CMakeLists.txt @@ -563,7 +563,7 @@ if(BUILD_SUITE) add_test(platform-qt-${TEST_NAME} test-qt-${TEST_NAME}) endforeach() else() - message("${QT}Test not found") + message(WARNING "${QT}Test not found") endif() endif() diff --git a/src/platform/qt/library/LibraryModel.cpp b/src/platform/qt/library/LibraryModel.cpp index ebb8f97e6ee..0a4379bbbe7 100644 --- a/src/platform/qt/library/LibraryModel.cpp +++ b/src/platform/qt/library/LibraryModel.cpp @@ -340,13 +340,13 @@ QVariant LibraryModel::data(const QModelIndex& index, int role) const { QString path = m_pathOrder[index.parent().row()]; entry = m_pathIndex[path][index.row()]; } else if (!index.parent().isValid() && index.row() < m_games.size()) { - entry = &m_games[index.row()]; + entry = &m_games[index.row()]; + } + if (entry) { + if (role == FullPathRole) { + return entry->fullpath; } - if (entry) { - if (role == FullPathRole) { - return entry->fullpath; - } - switch (index.column()) { + switch (index.column()) { case COL_NAME: if (role == Qt::DecorationRole) { return m_icons.value(entry->displayPlatform(), qApp->style()->standardIcon(QStyle::SP_FileIcon)); @@ -360,8 +360,8 @@ QVariant LibraryModel::data(const QModelIndex& index, int role) const { return (role == Qt::DisplayRole) ? QVariant(niceSizeFormat(entry->filesize)) : QVariant(int(entry->filesize)); case COL_CRC32: return (role == Qt::DisplayRole) ? QVariant(QStringLiteral("%0").arg(entry->crc32, 8, 16, QChar('0'))) : QVariant(entry->crc32); - } } + } return QVariant(); } diff --git a/src/platform/qt/utils.cpp b/src/platform/qt/utils.cpp index 0f013e296c8..6c7d2d52bf3 100644 --- a/src/platform/qt/utils.cpp +++ b/src/platform/qt/utils.cpp @@ -185,7 +185,7 @@ QString keyName(int key) { return QObject::tr("Menu"); default: return QKeySequence(key).toString(QKeySequence::NativeText); - } + } } void SpanSet::add(int pos) {