diff options
| author | Tannin <devnull@localhost> | 2013-10-25 14:49:42 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-10-25 14:49:42 +0200 |
| commit | 8c0b309bdee2527fab66b00b34171ef18f5055bf (patch) | |
| tree | 9e0d4000573046df8ae7e060b665365f71ed74a6 /src/modlist.cpp | |
| parent | bc7c42dbe8dd85a77a2eb8c1d094c77aa5cb7b1f (diff) | |
- 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
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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 { |
