summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qiconloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make it more obvious that Q_WS_ is dead code, and should perhaps be portedTor Arne Vestbø2015-02-031-2/+2
| | | | | | | | | | | | We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fixed icons lookup in QIcon::fromThemeRuslan Nigmatullin2015-02-021-49/+75
| | | | | | | | | | | | | | | | | | | | This commit fixes incorrect logic of icons' lookup if there are fallbacks or more than one theme's directory. According to Icon Theme Specification, Directory Layout section, theme can be spread across several base directories by having subdirectories of the same name. This makes possible to extend system themes by application-specific icons without making of collisions with other applications. According to Icon Naming Specification, Icon Naming Guidelines section, icon name may contain dashes to separate levels of specificity in icon names. This makes possible to set in application very specific icon which may be not in every theme. So it can fallback to less specific one. Change-Id: Iafc813902a3646be56e8f1d3a2fdbf8fd32ac542 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Avoid adding empty parent icon themeWeitian Leung2014-10-221-0/+1
| | | | | | | | "Icon Theme/Inherits" may assign an empty value, e.g. Flattr icon theme Change-Id: I90713b3eb67e39d6a49a49d1f5b3d7a75a8f30f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Use QPlatformTheme::SystemIconFallbackThemeName in static QString ↵Albert Astals Cid2014-09-031-1/+1
| | | | | | | | | fallbackTheme() Instead of QPlatformTheme::SystemIconThemeName Change-Id: Id318944730cd1b8014380a972eb28fd8aab1f382 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QIconLoader: enable an easy case of transactional processingMarc Mutz2014-09-021-3/+4
| | | | | | | | | It's easy to do the work on the side and then commit. This is strongly exception safe, but in Qt, we don't care. But transactional code, when this easy to achieve, is also clearer. Change-Id: I30f1badec7745d62a09af4eede234cb312b373aa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QIconLoader: replace an inefficient QList with a QVectorMarc Mutz2014-08-231-1/+1
| | | | | | | | | | QIconDirInfo is larger than a pointer, so holding it in a QList is horribly inefficient. Fix by holding it in a QVector instead. Change-Id: I6551d2d2941447e600a33c3d68edf46db002d96c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: replace while(!empty()) delete takeLast() with qDeleteAll()Marc Mutz2014-08-231-6/+2
| | | | | | | | | | There's no calling back into QIconLoaderEngine from the QIconLoaderEngineEntry dtors, so don't bother slicing off one element by one from the container as they are deleted, the more so as m_entires is either move-assigned or deleted right after these loops. Change-Id: Ic9ffa442ef0b0c59e19eb91d164183ea5c3bab67 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: don't re-evaluate container.size() all the time (II)Marc Mutz2014-08-231-2/+4
| | | | | | | | Experience shows that the compiler does not recognize the size() call as a constant expression, so help it along. Change-Id: I688244f37c555365566cd1a59dc601974316a2e6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: don't re-evaluate container.size() all the timeMarc Mutz2014-08-231-1/+3
| | | | | | | | Experience shows that the compiler does not recognize the size() call as a constant expression, so help it along. Change-Id: I60cd1754f8be123c62e3b47f6f721f42a69fe3c5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: remove another unused variableMarc Mutz2014-08-231-1/+0
| | | | | Change-Id: I2b11944d1964878ff5f6f666f33a97ea842ffea7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QIconLoader: remove an unused variableMarc Mutz2014-08-231-1/+0
| | | | | Change-Id: I4f1fee2da9358f63c4d3c9e46b8d69b4a1b280c7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Do not overwrite basePixmap of QIconLoader PixmapEntryAlbert Astals Cid2014-01-221-3/+4
| | | | | | Change-Id: I4799af1d9151ba4b0952369e9620d2fab2b002d9 Reviewed-by: David Sansome <me@davidsansome.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-04-291-4/+5
|\ | | | | | | Change-Id: I2a54058b64ac69c78b4120fdaf09b96e025a4c6c
| * Fixed crashes relating to SVG icons.Samuel Rødal2013-04-241-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating a second QFactoryLoader for the same plugins seems to trigger an unload of the plugins loaded by the first factory loader. The QIconEngine created by the SVG icon plugin thus gets an invalid virtual table pointer, which causes a crash when attempting to call any virtual function in the QIconEngine (pixmap(), the virtual destructor, etc). Reusing a single QFactoryLoader instead fixes the crash. Task-number: QTBUG-30496 Change-Id: I80c5fa8b52ab9b0db68499f8c37fad14a1ac4f3c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Make sure QIconLoader is always initializedKevin Ottens2013-04-221-7/+5
|/ | | | | | | | | | | | | | | | | It is necessary to properly initialize the icon loader in all case. Otherwise some calls might give wrong results if a platform theme plugin is involved. For instance, we might miss the actual theme name reported by the platform theme, eg it's what happen with QStyle::standardPixmap if no one created a QIcon before its first call. Also clean up the accesses to the global static and have only QIconLoader::instance() use it. All other call go through the static method. This way only instance() needs to call ensureInitialized(), definitely safer and looks cleaner to me. Change-Id: Id3ea6816edd5a65586004f69464960abc3602cf8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Scale icons returned by QIcon::fromTheme.David Sansome2012-10-101-2/+8
| | | | | | | | | | | | | | | | | The icon engine behind icons that are loaded from QIcon::fromTheme does not scale any pixmaps that it returns. When using an icon theme with an incomplete set of icons (for example, only a "128x128" folder), QIcon::pixmap will always return 128x128 pixmaps even if you ask for one of size 22x22. This is contrary to the QIcon::pixmap documentation that says "The pixmap might be smaller than requested, but never larger." This patch uses the same code that is in the main QIcon class in the PixmapEntry QIconLoaderEngineEntry to scale pixmaps if they are too big. Change-Id: Ic25a3628ac82cfb899574245f658490a2dd49d54 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QIcon: move back to QtGuiOlivier Goffart2012-05-181-0/+584
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the files and tests git mv src/widgets/kernel/qicon* qrc/gui/image/ git mv tests/auto/widgets/kernel/qicon/ tests/auto/gui/image/ - update the include of QIcon git grep -O"sed -i s,QtWidgets/qicon,QtGui/qicon," "QtWidgets/qicon" git grep -O"sed -i s,QtWidgets/QIcon,QtGui/QIcon," "QtWidgets/QIcon" - Adapt QIcon \ingroup documentation sed -i s/QtWidgets/QtGui/ src/gui/images/qicon* - Adapt export macro sed -i s/Q_WIDGETS_EXPORT/Q_GUI_EXPORT/g src/gui/image/qicon* - Update .pri and .pro files - Remove the use of QStyle::alignedRect by copying its content (and adapt slightly - Use QGuiApplication::palette() instead of QApplication::palette() - Add a hook in QGuiApplicationPrivate to call the QStyle::generatedIconPixmap() from QtWidgets Another commit follows to adjust QMetaType::Icon and move the QVariant and QMetaType icon handler back in QtGui Change-Id: I1b63759f892ebc02dfc30f41bb6e76e0b7451182 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* moving some more files around.Lars Knoll2011-05-041-573/+0
|
* QGuiApplication is not QPA specificLars Knoll2011-05-031-2/+5
| | | | | Rename files to reflect that QGuiApplication is going to be used everywhere.
* remove QApplication dependencies in gui/imageLars Knoll2011-05-031-1/+1
|
* split the HexString template class out of qstylehelperLars Knoll2011-05-031-1/+1
| | | | | | The class is used in quite a few places and has no relation to styles. Split it out into it's own file to remove a dependency between Gui and Widgets.
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+570
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12