Hello community, here is the log from the commit of package libyui-qt-pkg for openSUSE:Factory checked in at 2019-02-25 17:46:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui-qt-pkg (Old) and /work/SRC/openSUSE:Factory/.libyui-qt-pkg.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-qt-pkg" Mon Feb 25 17:46:07 2019 rev:42 rq:676152 version:2.45.26 Changes: -------- --- /work/SRC/openSUSE:Factory/libyui-qt-pkg/libyui-qt-pkg.changes 2018-12-21 08:18:42.897721835 +0100 +++ /work/SRC/openSUSE:Factory/.libyui-qt-pkg.new.28833/libyui-qt-pkg.changes 2019-02-25 17:46:09.274887855 +0100 @@ -1,0 +2,6 @@ +Thu Feb 14 10:42:58 UTC 2019 - Stasiek Michalski <[email protected]> + +- Fix icon display to new libyui-qt function (boo#1125424) +- 2.45.26 + +------------------------------------------------------------------- Old: ---- libyui-qt-pkg-2.45.25.tar.bz2 New: ---- libyui-qt-pkg-2.45.26.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-qt-pkg-doc.spec ++++++ --- /var/tmp/diff_new_pack.xfVDTs/_old 2019-02-25 17:46:09.938887582 +0100 +++ /var/tmp/diff_new_pack.xfVDTs/_new 2019-02-25 17:46:09.942887581 +0100 @@ -1,7 +1,7 @@ # # spec file for package libyui-qt-pkg-doc # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ %define so_version 9 Name: %{parent}-doc -Version: 2.45.25 +Version: 2.45.26 Release: 0 Source: %{parent}-%{version}.tar.bz2 ++++++ libyui-qt-pkg.spec ++++++ --- /var/tmp/diff_new_pack.xfVDTs/_old 2019-02-25 17:46:09.958887574 +0100 +++ /var/tmp/diff_new_pack.xfVDTs/_new 2019-02-25 17:46:09.962887573 +0100 @@ -1,7 +1,7 @@ # # spec file for package libyui-qt-pkg # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libyui-qt-pkg -Version: 2.45.25 +Version: 2.45.26 Release: 0 Source: %{name}-%{version}.tar.bz2 ++++++ libyui-qt-pkg-2.45.25.tar.bz2 -> libyui-qt-pkg-2.45.26.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/VERSION.cmake new/libyui-qt-pkg-2.45.26/VERSION.cmake --- old/libyui-qt-pkg-2.45.25/VERSION.cmake 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/VERSION.cmake 2019-02-14 15:45:13.000000000 +0100 @@ -1,6 +1,6 @@ SET( VERSION_MAJOR "2" ) SET( VERSION_MINOR "45" ) -SET( VERSION_PATCH "25" ) +SET( VERSION_PATCH "26" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) ##### This is need for the libyui core, ONLY. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/package/libyui-qt-pkg-doc.spec new/libyui-qt-pkg-2.45.26/package/libyui-qt-pkg-doc.spec --- old/libyui-qt-pkg-2.45.25/package/libyui-qt-pkg-doc.spec 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/package/libyui-qt-pkg-doc.spec 2019-02-14 15:45:13.000000000 +0100 @@ -20,7 +20,7 @@ %define so_version 9 Name: %{parent}-doc -Version: 2.45.25 +Version: 2.45.26 Release: 0 Source: %{parent}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/package/libyui-qt-pkg.changes new/libyui-qt-pkg-2.45.26/package/libyui-qt-pkg.changes --- old/libyui-qt-pkg-2.45.25/package/libyui-qt-pkg.changes 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/package/libyui-qt-pkg.changes 2019-02-14 15:45:13.000000000 +0100 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Feb 14 10:42:58 UTC 2019 - Stasiek Michalski <[email protected]> + +- Fix icon display to new libyui-qt function (boo#1125424) +- 2.45.26 + +------------------------------------------------------------------- Sat Dec 15 22:14:29 UTC 2018 - Stasiek Michalski <[email protected]> - Make icons pop out from any background (boo#1115949) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/package/libyui-qt-pkg.spec new/libyui-qt-pkg-2.45.26/package/libyui-qt-pkg.spec --- old/libyui-qt-pkg-2.45.25/package/libyui-qt-pkg.spec 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/package/libyui-qt-pkg.spec 2019-02-14 15:45:13.000000000 +0100 @@ -17,7 +17,7 @@ Name: libyui-qt-pkg -Version: 2.45.25 +Version: 2.45.26 Release: 0 Source: %{name}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPackageSelector.cc new/libyui-qt-pkg-2.45.26/src/YQPackageSelector.cc --- old/libyui-qt-pkg-2.45.25/src/YQPackageSelector.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPackageSelector.cc 2019-02-14 15:45:13.000000000 +0100 @@ -263,17 +263,6 @@ } - -std::string -YQPackageSelector::iconPath( const std::string &name, int size ) -{ - // FIXME - #define PREFIX "/usr/" - return zypp::str::form("%s/share/icons/hicolor/%dx%d/apps/%s.png", - PREFIX, size, size, name.c_str() ); -} - - void YQPackageSelector::basicLayout() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPackageSelector.h new/libyui-qt-pkg-2.45.26/src/YQPackageSelector.h --- old/libyui-qt-pkg-2.45.25/src/YQPackageSelector.h 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPackageSelector.h 2019-02-14 15:45:13.000000000 +0100 @@ -287,12 +287,6 @@ */ void normalCursor(); -public: - /** - * returns the full path for an icon of a given size - */ - static std::string iconPath( const std::string &name, int size ); - protected: // Layout methods - create and layout widgets diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPackageSelectorHelp.cc new/libyui-qt-pkg-2.45.26/src/YQPackageSelectorHelp.cc --- old/libyui-qt-pkg-2.45.25/src/YQPackageSelectorHelp.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPackageSelectorHelp.cc 2019-02-14 15:45:13.000000000 +0100 @@ -52,6 +52,7 @@ #include "utf8.h" #include "YQi18n.h" +#include "YQUI.h" #include <Libyui_config.h> @@ -247,11 +248,7 @@ const QString & summary, const QString & explanation ) { - QIcon icon; - if (QIcon::hasThemeIcon( imgFileName )) - icon = QIcon::fromTheme( imgFileName, QIcon(":/" + imgFileName) ); - else - icon = QIcon(":/" + imgFileName); + QIcon icon = YQUI::ui()->loadIcon( imgFileName.toStdString() ); QPixmap pixmap = icon.pixmap(16); QString html = "<tr valign='top'>"; QByteArray byteArray; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgChangesDialog.cc new/libyui-qt-pkg-2.45.26/src/YQPkgChangesDialog.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgChangesDialog.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgChangesDialog.cc 2019-02-14 15:45:13.000000000 +0100 @@ -97,9 +97,7 @@ QLabel * iconLabel = new QLabel( this ); Q_CHECK_PTR( iconLabel ); hbox->addWidget(iconLabel); -#ifdef FIXME - iconLabel->setPixmap( QApplication::style().stylePixmap( QStyle::SP_MessageBoxInformation ) ); -#endif + iconLabel->setPixmap( YQUI::ui()->loadIcon( "dialog-information" ).pixmap(64) ); iconLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert // Label for the message diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgDescriptionView.cc new/libyui-qt-pkg-2.45.26/src/YQPkgDescriptionView.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgDescriptionView.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgDescriptionView.cc 2019-02-14 15:45:13.000000000 +0100 @@ -51,16 +51,11 @@ #include "YQPkgDescriptionDialog.h" #include "YQi18n.h" #include "utf8.h" +#include "YQUI.h" +#include <qbuffer.h> #define DESKTOP_TRANSLATIONS "desktop_translations" #define DESKTOPFILEDIR "\\/share\\/applications\\/.*\\.desktop$" // RegExp -#define ICONSIZE "32x32" -#define ICONPATH "/usr/share/icons/locolor/" ICONSIZE "/apps/" \ - << "/usr/share/icons/hicolor/" ICONSIZE "/apps/" \ - << "/usr/share/icons/oxygen/" ICONSIZE "/apps/" \ - << "/usr/share/icons/Tango/" ICONSIZE "/apps/" \ - << "/usr/share/icons/gnome/" ICONSIZE "/apps/" \ - << "/opt/kde3/share/icons/hicolor/" ICONSIZE "/apps/"; @@ -245,12 +240,16 @@ { desktopEntries = readDesktopFile( desktopFiles[i] ); - QString desktopIcon = findDesktopIcon ( desktopEntries["Icon"] ); + QIcon icon = YQUI::ui()->loadIcon( desktopEntries["Icon"].toStdString() ); - if ( ! desktopIcon.isEmpty() ) + if ( ! icon.isNull() ) { + QPixmap pixmap = icon.pixmap(32); + QByteArray byteArray; + QBuffer buffer(&byteArray); + pixmap.save(&buffer, "PNG"); html += "<tr><td valign='middle' align='center'>"; - html += QString( "<img src=\"" ) + desktopIcon + QString( "\">" ); + html += QString("<td><img src=\"data:image/png;base64,") + byteArray.toBase64() + QString( "\">" ); html += "</td><td valign='middle' align='left'>"; html += "<b>" + desktopEntries["Name"] + "</b>"; html += "</td></tr>"; @@ -269,24 +268,6 @@ } -QString -YQPkgDescriptionView::findDesktopIcon ( const QString& iconName ) const -{ - QStringList path; - path << ICONPATH; - - for ( int i=0; i < path.size(); ++i ) - { - QString fullName = path[i] + iconName + ".png"; - QFile file(fullName); - if ( file.exists() ) - return fullName; - } - - return QString(); -} - - QMap<QString, QString> YQPkgDescriptionView::readDesktopFile( const QString & fileName ) const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgDiskUsageWarningDialog.cc new/libyui-qt-pkg-2.45.26/src/YQPkgDiskUsageWarningDialog.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgDiskUsageWarningDialog.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgDiskUsageWarningDialog.cc 2019-02-14 15:45:13.000000000 +0100 @@ -93,9 +93,7 @@ QLabel * iconLabel = new QLabel( this ); Q_CHECK_PTR( iconLabel ); hbox->addWidget(iconLabel); -#ifdef FIXME - iconLabel->setPixmap( QApplication::style().stylePixmap( QStyle::SP_MessageBoxWarning ) ); -#endif + iconLabel->setPixmap( YQUI::ui()->loadIcon( "dialog-warning" ).pixmap(64) ); iconLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert // Label for the message diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgList.cc new/libyui-qt-pkg-2.45.26/src/YQPkgList.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgList.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgList.cc 2019-02-14 15:45:13.000000000 +0100 @@ -65,6 +65,7 @@ #include "YQApplication.h" #define SINGLE_VERSION_COL 1 +#define STATUS_ICON_SIZE 16 YQPkgList::YQPkgList( QWidget * parent ) @@ -114,7 +115,7 @@ sortByColumn( statusCol(), Qt::AscendingOrder ); setAllColumnsShowFocus( true ); - setIconSize( QSize( 22, 16 ) ); + setIconSize( QSize( STATUS_ICON_SIZE, STATUS_ICON_SIZE ) ); header()->setSectionResizeMode( QHeaderView::Interactive ); @@ -322,15 +323,15 @@ const ZyppObj candidate = selectable->candidateObj(); const ZyppObj installed = selectable->installedObj(); // Status icon: - _optimalColWidth_statusIcon = 28; + _optimalColWidth_statusIcon = STATUS_ICON_SIZE; // Name: qstr = QString::fromUtf8( zyppPkg->name().c_str() ); - qstr_width = fm.boundingRect( qstr ).width() + 8; + qstr_width = fm.boundingRect( qstr ).width() + ( STATUS_ICON_SIZE / 2 ); if (qstr_width > _optimalColWidth_name) _optimalColWidth_name = qstr_width; // Summary: qstr = QString::fromUtf8( zyppPkg->summary().c_str() ); - qstr_width = fm.boundingRect( qstr ).width() + 8; + qstr_width = fm.boundingRect( qstr ).width() + ( STATUS_ICON_SIZE / 2 ); if (qstr_width > _optimalColWidth_summary) _optimalColWidth_summary = qstr_width; // Version(s): @@ -346,7 +347,7 @@ qstr += " "; qstr += "(" + QString::fromUtf8( candidate->edition().c_str() ) + ")"; } - qstr_width = fm.boundingRect( qstr ).width() + 8; + qstr_width = fm.boundingRect( qstr ).width() + ( STATUS_ICON_SIZE / 2 ); if (qstr_width > _optimalColWidth_version) _optimalColWidth_version = qstr_width; } @@ -355,21 +356,21 @@ if (candidate) { qstr = QString::fromUtf8( candidate->edition().c_str() ); - qstr_width = fm.boundingRect( qstr ).width() + 8; + qstr_width = fm.boundingRect( qstr ).width() + ( STATUS_ICON_SIZE / 2 ); if (qstr_width > _optimalColWidth_version) _optimalColWidth_version = qstr_width; } if (installed) { qstr = QString::fromUtf8( installed->edition().c_str() ); - qstr_width = fm.boundingRect( qstr ).width() + 8; + qstr_width = fm.boundingRect( qstr ).width() + ( STATUS_ICON_SIZE / 2 ); if (qstr_width > _optimalColWidth_instVersion) _optimalColWidth_instVersion = qstr_width; } } // Size: qstr = QString::fromUtf8( zyppPkg->installSize().asString().c_str() ); - qstr_width = fm.boundingRect( qstr ).width() + 8; + qstr_width = fm.boundingRect( qstr ).width() + ( STATUS_ICON_SIZE / 2 ); if (qstr_width > _optimalColWidth_size) _optimalColWidth_size = qstr_width; } @@ -384,7 +385,7 @@ int statusIconColWidth = _optimalColWidth_statusIcon; if (statusIconColWidth == 0) - statusIconColWidth = 28; + statusIconColWidth = STATUS_ICON_SIZE; optimalWidthsSum = _optimalColWidth_statusIcon + _optimalColWidth_name + _optimalColWidth_summary + _optimalColWidth_version + _optimalColWidth_size; if ( instVersionCol() != versionCol() ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgObjList.cc new/libyui-qt-pkg-2.45.26/src/YQPkgObjList.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgObjList.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgObjList.cc 2019-02-14 15:45:13.000000000 +0100 @@ -121,7 +121,7 @@ connect( this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT (slotCustomContextMenu(const QPoint&))); - setIconSize( QSize( 22, 16 ) ); + setIconSize( QSize( 16, 16 ) ); setContextMenuPolicy(Qt::CustomContextMenu); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgPackageKitGroupsFilterView.cc new/libyui-qt-pkg-2.45.26/src/YQPkgPackageKitGroupsFilterView.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgPackageKitGroupsFilterView.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgPackageKitGroupsFilterView.cc 2019-02-14 15:45:13.000000000 +0100 @@ -51,6 +51,7 @@ #include "YQPkgPackageKitGroupsFilterView.h" #include "YQi18n.h" +#include "YQUI.h" #include "utf8.h" @@ -428,15 +429,7 @@ setFont(0,f); string iconName = groupIcon( group ); - QString icon = QString::fromStdString(iconName); - if ( QIcon::hasThemeIcon(icon) ) - { - setIcon( 0, QIcon::fromTheme(icon) ); - } - else - { - setIcon( 0, QIcon( QString( YQPackageSelector::iconPath( iconName, 32 ).c_str() ) ) ); - } + setIcon( 0, YQUI::ui()->loadIcon( iconName ) ); setText( 0, translatedText( group ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgPatternList.cc new/libyui-qt-pkg-2.45.26/src/YQPkgPatternList.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgPatternList.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgPatternList.cc 2019-02-14 15:45:13.000000000 +0100 @@ -468,24 +468,11 @@ if (_zyppPattern) { - string icon = _zyppPattern->icon().asString(); - // HACK most patterns have wrong default icon - if ( (icon == zypp::Pathname("yast-system").asString()) || - icon.empty() ) - icon = "pattern-generic"; - - - QString iconName = QString::fromStdString(icon); - if ( QIcon::hasThemeIcon(iconName) ) - { - setIcon( _patternList->iconCol(), QIcon::fromTheme(iconName) ); - } - else - { - std::string iconpath = YQPackageSelector::iconPath(icon, 32); - setIcon(_patternList->iconCol(), QIcon(QString(iconpath.c_str()))); - } + string iconName = _zyppPattern->icon().basename(); + if ( iconName.empty() ) + iconName = "pattern-generic"; + setIcon( _patternList->iconCol(), YQUI::ui()->loadIcon( iconName ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgRepoList.cc new/libyui-qt-pkg-2.45.26/src/YQPkgRepoList.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgRepoList.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgRepoList.cc 2019-02-14 15:45:13.000000000 +0100 @@ -53,6 +53,7 @@ #include "YQPkgFilters.h" #include "YQi18n.h" #include "utf8.h" +#include "YQUI.h" using std::string; using std::list; @@ -264,12 +265,7 @@ if ( repo.isSystemRepo() ) iconName = "preferences-system"; - if ( QIcon::hasThemeIcon(iconName) ) - { - setIcon( 0, QIcon::fromTheme(iconName) ); - } - else - setIcon( 0, QIcon( iconPath.sprintf("/usr/share/icons/hicolor/32x32/apps/%s.png", iconName.toUtf8().data()) )); + setIcon( 0, YQUI::ui()->loadIcon( iconName.toStdString() ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgSelDescriptionView.cc new/libyui-qt-pkg-2.45.26/src/YQPkgSelDescriptionView.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgSelDescriptionView.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgSelDescriptionView.cc 2019-02-14 15:45:13.000000000 +0100 @@ -48,6 +48,7 @@ #include "YQUI.h" #include "YQi18n.h" #include "utf8.h" +#include <qbuffer.h> using std::endl; using std::list; @@ -107,51 +108,21 @@ if ( summary.isEmpty() ) // No summary? summary = fromUTF8( zyppObj->name() ); // Use name instead (internal only normally) - QString icon = pattern ? pattern->icon().asString().c_str() : ""; + QString iconName = pattern ? pattern->icon().asString().c_str() : ""; - if ( icon.isEmpty() ) + if ( iconName.isEmpty() ) { - icon = zyppObj->name().c_str(); - icon.replace( ' ', '_' ); + iconName = zyppObj->name().c_str(); + iconName.replace( ' ', '_' ); } - if ( ! icon.isEmpty() ) + if ( ! iconName.isEmpty() ) { - if ( icon.startsWith( "./" ) ) - icon.replace( QRegExp( "^\\./" ), "" ); + if ( iconName.startsWith( "./" ) ) + iconName.replace( QRegExp( "^\\./" ), "" ); - if ( ! icon.endsWith( ".png", Qt::CaseInsensitive ) && - ! icon.endsWith( ".jpg", Qt::CaseInsensitive ) ) - icon += ".png"; - - QString origIconName = icon; - - if ( ! icon.contains( "/" ) ) // no path at all - { - // Look in icon directories: - // - // /usr/share/YaST2/theme/current/icons/32x32/apps/ - // /usr/share/YaST2/theme/current/icons/48x48/apps/ - - QString iconBaseName = icon; - icon = findIcon( QString( THEMEDIR ) + "/icons/32x32/apps/" + iconBaseName ); - - if ( icon.isEmpty() ) - icon = findIcon( QString( THEMEDIR ) + "/icons/48x48/apps/" + iconBaseName ); - } - else if ( ! icon.startsWith( "/" ) ) // relative path - { - // Use path relative to theme directory: - // - // /usr/share/YaST2/theme/current/ + icon - - icon = findIcon( QString( THEMEDIR ) + "/" + icon ); - } - - if ( pattern && icon.isEmpty() ) - yuiWarning() << "No icon for pattern " << zyppObj->name() - << " - icon name: " << origIconName - << endl; + if ( pattern && iconName.isEmpty() ) + yuiWarning() << "No icon for pattern " << zyppObj->name() << endl; } @@ -162,32 +133,18 @@ + "</td></tr>" + "</table>"; - if ( ! icon.isEmpty() ) + if ( ! iconName.isEmpty() ) { + QIcon icon = YQUI::ui()->loadIcon( iconName.toStdString() ); + QPixmap pixmap = icon.pixmap(16); + QByteArray byteArray; + QBuffer buffer(&byteArray); + pixmap.save(&buffer, "PNG"); html = QString( "<table width='100%'><tr>" ) - + "<td><img src=\"" + icon + "\"></td>" + + "<td><img src=\"data:image/png;base64," + byteArray.toBase64() + "\"/></td>" + "<td width='100%'>" + html + "</td>" + "</tr></table>"; } return html; } - - - -QString -YQPkgSelDescriptionView::findIcon( const QString & icon ) const -{ - if ( access( qPrintable( icon ), R_OK ) == 0 ) - { - yuiDebug() << "Found icon " << icon << endl; - return icon; - } - else - { - yuiDebug() << "No icon " << icon << endl; - return ""; - } -} - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgServiceList.cc new/libyui-qt-pkg-2.45.26/src/YQPkgServiceList.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgServiceList.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgServiceList.cc 2019-02-14 15:45:13.000000000 +0100 @@ -37,6 +37,7 @@ #include "YQPkgServiceList.h" #include "YQPkgFilters.h" #include "YQi18n.h" +#include "YQUI.h" #include "utf8.h" using std::string; @@ -214,15 +215,7 @@ setToolTip( nameCol(), infoToolTip); - QString iconPath; - QString iconName = "yast-update"; - - if ( QIcon::hasThemeIcon(iconName) ) - { - setIcon( 0, QIcon::fromTheme(iconName) ); - } - else - setIcon( 0, QIcon( iconPath.sprintf("/usr/share/icons/hicolor/48x48/apps/%s.png", iconName.toUtf8().data()) )); + setIcon( 0, YQUI::ui()->loadIcon( "yast-update" ) ); } YQPkgServiceListItem::~YQPkgServiceListItem() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-pkg-2.45.25/src/YQPkgVersionsView.cc new/libyui-qt-pkg-2.45.26/src/YQPkgVersionsView.cc --- old/libyui-qt-pkg-2.45.25/src/YQPkgVersionsView.cc 2018-12-17 13:31:12.000000000 +0100 +++ new/libyui-qt-pkg-2.45.26/src/YQPkgVersionsView.cc 2019-02-14 15:45:13.000000000 +0100 @@ -60,8 +60,6 @@ #include "YQi18n.h" #include "utf8.h" -#define ICONOFFSET 3 // the status icons have an asymmetrical transparent border - using std::endl; YQPkgVersionsView::YQPkgVersionsView( QWidget * parent ) @@ -677,7 +675,7 @@ QPixmap icon = statusIcon( _selectable->pickStatus(_zyppPoolItem) ); QPoint start = elementRect.center() - icon.rect().center(); - QRect rect = QRect(start.x() - ICONOFFSET, start.y(), icon.width(), icon.height()); + QRect rect = QRect(start.x(), start.y(), icon.width(), icon.height()); p.drawItemPixmap( rect, 0, icon ); }
