OSDN Git Service

use foreach() for iteration in QIconTheme constructor
authorIvailo Monev <xakepa10@gmail.com>
Sat, 2 Jan 2021 21:48:06 +0000 (23:48 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 2 Jan 2021 21:48:06 +0000 (23:48 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/image/qiconloader.cpp

index 360bf22..41f8023 100644 (file)
@@ -119,9 +119,8 @@ QStringList QIconLoader::themeSearchPaths() const
 QIconTheme::QIconTheme(const QString &themeName)
         : m_valid(false)
 {
-    QStringList iconDirs = QIcon::themeSearchPaths();
-    for ( int i = 0 ; i < iconDirs.size() ; ++i) {
-        QString themeDir = iconDirs[i] + QLatin1Char('/') + themeName;
+    foreach (const QString &it, QIcon::themeSearchPaths()) {
+        QString themeDir = it + QLatin1Char('/') + themeName;
         if (QFile::exists(themeDir + QLatin1String("/index.theme"))) {
             m_contentDir = themeDir;
             m_valid = true;