From acb1205d5d9a477ecf8a93449d5cc5cce27b1f09 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 28 Jul 2012 16:01:46 +0200 Subject: [PATCH] Allow also other file types for group icons in preference page when size is 96x96 --- src/Gui/DlgPreferencesImp.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Gui/DlgPreferencesImp.cpp b/src/Gui/DlgPreferencesImp.cpp index 1e52e00f4..e841e9b18 100644 --- a/src/Gui/DlgPreferencesImp.cpp +++ b/src/Gui/DlgPreferencesImp.cpp @@ -25,6 +25,7 @@ #ifndef _PreComp_ # include # include +# include # include #endif @@ -89,6 +90,15 @@ void DlgPreferencesImp::setupPages() } fileName = std::string("preferences-") + fileName; QPixmap icon = Gui::BitmapFactory().pixmapFromSvg(fileName.c_str(), QSize(96,96)); + if (icon.isNull()) { + icon = Gui::BitmapFactory().pixmap(fileName.c_str()); + if (icon.isNull()) { + qWarning() << "No group icon found for " << fileName.c_str(); + } + else if (icon.size() != QSize(96,96)) { + qWarning() << "Group icon for " << fileName.c_str() << " is not of size 96x96"; + } + } item->setIcon(icon); item->setTextAlignment(Qt::AlignHCenter); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);