Skip to content
Permalink
Browse files

Merge pull request #21 from LelCP/master

Support for system-wide icon themes
  • Loading branch information...
jreidinger committed Feb 21, 2018
2 parents 1fe6843 + f38b552 commit 4ffbaad79265bb2fd18b088013ffd713c9957598
Showing with 22 additions and 10 deletions.
  1. +6 −0 package/yast2-control-center.changes
  2. +1 −1 package/yast2-control-center.spec
  3. +15 −9 src/yqdesktopfilesmodel.cpp
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Feb 21 16:30:37 UTC 2018 - letcp@protonmail.com

- Fixes to way icons are displayed (boo#1081517)
- 4.0.1

-------------------------------------------------------------------
Mon Nov 13 12:44:08 UTC 2017 - kukuk@suse.com

@@ -17,7 +17,7 @@


Name: yast2-control-center
Version: 4.0.0
Version: 4.0.1
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -278,20 +278,26 @@ QVariant YQDesktopFilesModel::translatedPropertyValue( const QModelIndex &index,

QVariant YQDesktopFilesModel::findIcon( QString &icon ) const
{
QRegExp extension( "\\.(png|jpg)$", Qt::CaseInsensitive );
if ( icon.indexOf( extension ) < 0 ) // no .png or .jpg extension?
icon += ".png"; // assume .png
QStringListIterator it(d->icon_dirs);
while (it.hasNext())
if ( QIcon::hasThemeIcon(icon) )
{
QString icondir(it.next());
if ( QFile::exists(icondir + "/" + icon) )
return QIcon::fromTheme(icon);
}
else
{
QRegExp extension( "\\.(png|jpg|svg)$", Qt::CaseInsensitive );
if ( icon.indexOf( extension ) < 0 ) // no .png or .jpg extension?
icon += ".png"; // assume .png
QStringListIterator it(d->icon_dirs);
while (it.hasNext())
{
return QIcon(icondir + "/" + icon);
QString icondir(it.next());
if ( QFile::exists(icondir + "/" + icon) )
{
return QIcon(icondir + "/" + icon);
}
}
}
return QVariant();

}

void YQDesktopFilesModel::sort( int, Qt::SortOrder order )

0 comments on commit 4ffbaad

Please sign in to comment.
You can’t perform that action at this time.