Git commit 81b7e1e43e5fce39ace676ef40637059b9bb9317 by Aleix Pol.
Committed on 11/07/2012 at 13:29.
Pushed by apol into branch 'master'.

Fix freezing problem on load

Don't iterate over the home directory, this happened in cases
where the fallback icon theme was set to "" and Qt translated it
to QDir("") which was CWD.

CCMAIL: 678...@bugs.debian.org

M  +6    -2    src/gtkconfigkcmodule.cpp
M  +1    -0    src/iconthemesmodel.cpp

http://commits.kde.org/kde-gtk-config/81b7e1e43e5fce39ace676ef40637059b9bb9317

diff --git a/src/gtkconfigkcmodule.cpp b/src/gtkconfigkcmodule.cpp
index 03cea95..9a2bbb3 100644
--- a/src/gtkconfigkcmodule.cpp
+++ b/src/gtkconfigkcmodule.cpp
@@ -200,7 +200,9 @@ void tryIcon(QLabel* label, const QString& fallback, const 
QString& theme, const
 {
     label->setToolTip(iconName);
     
-    QString ret = 
IconThemesModel::findFilesRecursively(QStringList(iconName+".*"), theme);
+    QString ret;
+    if(!theme.isEmpty())
+        ret = 
IconThemesModel::findFilesRecursively(QStringList(iconName+".*"), theme);
     if(!ret.isEmpty()) {
         QPixmap p(ret);
         Q_ASSERT(!p.isNull());
@@ -208,7 +210,9 @@ void tryIcon(QLabel* label, const QString& fallback, const 
QString& theme, const
         return;
     }
     
-    ret = IconThemesModel::findFilesRecursively(QStringList(iconName+".*"), 
fallback);
+    if(!fallback.isEmpty())
+        ret = 
IconThemesModel::findFilesRecursively(QStringList(iconName+".*"), fallback);
+    
     if(!ret.isEmpty()) {
         QPixmap p(ret);
         Q_ASSERT(!p.isNull());
diff --git a/src/iconthemesmodel.cpp b/src/iconthemesmodel.cpp
index 4cf54cf..6167ace 100644
--- a/src/iconthemesmodel.cpp
+++ b/src/iconthemesmodel.cpp
@@ -78,6 +78,7 @@ bool greatSizeIs48(const QString& a, const QString& b)
 
 QString IconThemesModel::findFilesRecursively(const QStringList& wildcard, 
const QDir& directory)
 {
+    Q_ASSERT(directory.isAbsolute());
     QFileInfoList entries = directory.entryInfoList(wildcard, QDir::Files);
     foreach(const QFileInfo& f, entries) {
         return f.absoluteFilePath();



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to