Skip to content

Commit

Permalink
Fix icon display to new libyui-qt function (boo#1125424)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp committed Feb 14, 2019
1 parent 7aa785d commit 365436b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
6 changes: 6 additions & 0 deletions package/yast2-control-center.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Feb 14 10:42:58 UTC 2019 - Stasiek Michalski <hellcp@mailbox.org>

- Fix icon display to new libyui-qt function (boo#1125424)
- 4.1.6

-------------------------------------------------------------------
Mon Jan 28 12:47:56 UTC 2019 - Fabian Vogt <fvogt@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-control-center.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-control-center
Version: 4.1.5
Version: 4.1.6
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
21 changes: 1 addition & 20 deletions src/yqdesktopfilesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,26 +278,7 @@ QVariant YQDesktopFilesModel::translatedPropertyValue( const QModelIndex &index,

QVariant YQDesktopFilesModel::findIcon( QString &icon ) const
{
if ( QIcon::hasThemeIcon(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())
{
QString icondir(it.next());
if ( QFile::exists(icondir + "/" + icon) )
{
return QIcon(icondir + "/" + icon);
}
}
}
return QVariant();
return QIcon::fromTheme(icon);
}

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

0 comments on commit 365436b

Please sign in to comment.