From 8c0b309bdee2527fab66b00b34171ef18f5055bf Mon Sep 17 00:00:00 2001 From: Tannin Date: Fri, 25 Oct 2013 14:49:42 +0200 Subject: - Option to choose edition of the game. Currently only relevant for FO3 because FO3 GOTY is its own app - applications that aren't in the executables list can again be started from the command line - references to missing categories are now removed from mods - bugfix: integrated fomod installer didn't update description and picture on some constellations of Windows version and theme --- src/modlist.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 18bbfd5a..0fdcf6fa 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -169,10 +169,16 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const int category = modInfo->getPrimaryCategory(); if (category != -1) { CategoryFactory &categoryFactory = CategoryFactory::instance(); - try { - return categoryFactory.getCategoryName(categoryFactory.getCategoryIndex(category)); - } catch (const std::exception &e) { - qCritical("failed to retrieve category name: %s", e.what()); + if (categoryFactory.categoryExists(category)) { + try { + return categoryFactory.getCategoryName(categoryFactory.getCategoryIndex(category)); + } catch (const std::exception &e) { + qCritical("failed to retrieve category name: %s", e.what()); + return QString(); + } + } else { + qWarning("category %d doesn't exist (may have been removed)", category); + modInfo->setCategory(category, false); return QString(); } } else { -- cgit v1.3.1