diff options
author | Felix Geyer <debfx@fobos.de> | 2010-09-22 00:39:42 +0400 |
---|---|---|
committer | Felix Geyer <debfx@fobos.de> | 2010-09-22 00:39:42 +0400 |
commit | 89e778d324add52fd358bbb54f6f76f4382c5714 (patch) | |
tree | 4bd36fca863ac3bbbb2bd3c9222a2dd409a82f23 /src | |
parent | 537ffafefd8a3276b51dbde07267a2c8bf398469 (diff) |
Display warning when an invalid icon index is requested.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/DatabaseIcons.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/DatabaseIcons.cpp b/src/core/DatabaseIcons.cpp index b3fc70308..90fa558ab 100644 --- a/src/core/DatabaseIcons.cpp +++ b/src/core/DatabaseIcons.cpp @@ -22,7 +22,8 @@ DatabaseIcons* DatabaseIcons::m_instance(0); QIcon DatabaseIcons::icon(int index) { - if (index >= iconCount()) { + if (index < 0 || index >= iconCount()) { + qWarning("DatabaseIcons::icon: invalid icon index %d", index); return QIcon(); } @@ -112,7 +113,7 @@ DatabaseIcons::DatabaseIcons() Q_ASSERT(m_indexToName.size() == iconCount()); } -#include <QFile> + QIcon DatabaseIcons::getIconInternal(int index) { if (m_iconCache.contains(index)) { |