diff --git a/.gitignore b/.gitignore index f89ce3b..e125466 100644 --- a/.gitignore +++ b/.gitignore @@ -41,12 +41,18 @@ CMakeCache.txt CMakeFiles /CMakeLists.txt Makefile -cmake_install.cmake install_manifest.txt +**/*.cmake # CMake project-bindir build*/ +# Misc +CMakeDoxyfile.in +Doxyfile +libyui-qt-pkg.pc +src/yui-qt-pkg_autogen + # Archives # It's better to unpack these files and commit the raw source because # git has its own built in compression methods. diff --git a/VERSION.cmake b/VERSION.cmake index 30c49c0..44b9c3b 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1,6 +1,6 @@ SET( VERSION_MAJOR "2" ) SET( VERSION_MINOR "45" ) -SET( VERSION_PATCH "22" ) +SET( VERSION_PATCH "23" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) ##### This is need for the libyui core, ONLY. diff --git a/package/libyui-qt-pkg-doc.spec b/package/libyui-qt-pkg-doc.spec index a3adecf..dd3b41e 100644 --- a/package/libyui-qt-pkg-doc.spec +++ b/package/libyui-qt-pkg-doc.spec @@ -20,7 +20,7 @@ %define so_version 9 Name: %{parent}-doc -Version: 2.45.22 +Version: 2.45.23 Release: 0 Source: %{parent}-%{version}.tar.bz2 diff --git a/package/libyui-qt-pkg.changes b/package/libyui-qt-pkg.changes index 6c78915..416fcf7 100644 --- a/package/libyui-qt-pkg.changes +++ b/package/libyui-qt-pkg.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Nov 6 15:21:12 UTC 2018 - Stefan Hundhammer + +- Better error handling for missing icons (bsc#1114654): + Error message in the y2log plus displaying a small red square for + missing icons. +- 2.45.23 + ------------------------------------------------------------------- Mon Oct 29 06:00:36 UTC 2018 - Stasiek Michalski diff --git a/package/libyui-qt-pkg.spec b/package/libyui-qt-pkg.spec index 7f79405..91e6568 100644 --- a/package/libyui-qt-pkg.spec +++ b/package/libyui-qt-pkg.spec @@ -17,7 +17,7 @@ Name: libyui-qt-pkg -Version: 2.45.22 +Version: 2.45.23 Release: 0 Source: %{name}-%{version}.tar.bz2 diff --git a/src/YQIconPool.cc b/src/YQIconPool.cc index 4e031f1..2f1bbed 100644 --- a/src/YQIconPool.cc +++ b/src/YQIconPool.cc @@ -42,9 +42,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #define YUILogComponent "qt-ui" #include "YUILog.h" +#include "utf8.h" #include "YQIconPool.h" +using std::endl; + YQIconPool * YQIconPool::_iconPool = 0; @@ -113,19 +116,46 @@ YQIconPool::cachedIcon( const QString icon_name, const bool enabled ) if ( !iconPixmap ) { - if ( QIcon::hasThemeIcon(icon_name) ) - { - QIcon icon = QIcon::fromTheme(icon_name, QIcon( ":/" + icon_name )); - iconPixmap = icon.pixmap(QSize(16,16), enabled ? QIcon::Normal : QIcon::Disabled); - } - else + iconPixmap = loadIcon( icon_name, enabled ); + + if ( !iconPixmap ) { - QIcon icon = QIcon( ":/" + icon_name ); - iconPixmap = icon.pixmap(QSize(16,16), enabled ? QIcon::Normal : QIcon::Disabled); + // Create an icon for the cache to avoid more than one complaint + // and to have a clearly visible error icon (a small red square) + iconPixmap = QPixmap( 8, 8 ); + iconPixmap.fill( Qt::red ); } } - _iconCache.insert( icon_name + enabled, iconPixmap); + _iconCache.insert( icon_name + enabled, iconPixmap ); + + return iconPixmap; +} + + +QPixmap +YQIconPool::loadIcon( const QString icon_name, const bool enabled ) +{ + QPixmap iconPixmap = _iconCache[ icon_name + enabled ]; + + if ( QIcon::hasThemeIcon( icon_name ) ) + { + yuiDebug() << "Loading theme icon " << icon_name << endl; + + QIcon icon = QIcon::fromTheme( icon_name, QIcon( ":/" + icon_name ) ); + iconPixmap = icon.pixmap( QSize( 16, 16 ), enabled ? QIcon::Normal : QIcon::Disabled ); + } + else + { + yuiDebug() << "Loading built-in icon " << icon_name << endl; + + QIcon icon = QIcon( ":/" + icon_name ); + iconPixmap = icon.pixmap( QSize( 16, 16 ), enabled ? QIcon::Normal : QIcon::Disabled ); + } + + if ( !iconPixmap ) + yuiError() << "Could not load icon " << icon_name << endl; + return iconPixmap; } diff --git a/src/YQIconPool.h b/src/YQIconPool.h index e3edfd4..588a9ec 100644 --- a/src/YQIconPool.h +++ b/src/YQIconPool.h @@ -70,12 +70,12 @@ class YQIconPool static QPixmap disabledPkgProtected(); static QPixmap disabledPkgTaboo(); static QPixmap disabledPkgUpdate(); - + static QPixmap normalPkgConflict(); static QPixmap treePlus(); static QPixmap treeMinus(); - + static QPixmap warningSign(); static QPixmap pkgSatisfied(); @@ -92,12 +92,20 @@ class YQIconPool static YQIconPool * iconPool(); /** - * Return the cached icon for 'xpm_data' ( an included XPM file ). - * If the icon isn't in the cache yet, create it and store it in the - * cache. + * Return the cached icon for 'icon_name'. If the icon isn't in the cache + * yet, load it and store it in the cache. + * + * Return a red square as an error icon if there is no icon by that name. **/ QPixmap cachedIcon(const QString icon_name, const bool enabled ); + /** + * Load the icon for 'icon_name' from the icon theme or, if that fails, + * from the compiled-in icons (using the Qt resource system). Return a null + * pixmap if there is no such icon. + **/ + QPixmap loadIcon( const QString icon_name, const bool enabled ); + private: /** @@ -111,7 +119,7 @@ class YQIconPool **/ virtual ~YQIconPool(); - + // // Data members // diff --git a/src/YQPackageSelector.cc b/src/YQPackageSelector.cc index 6d50ab3..cb8fa45 100644 --- a/src/YQPackageSelector.cc +++ b/src/YQPackageSelector.cc @@ -1850,4 +1850,3 @@ void YQPackageSelector::normalCursor() } -#include "YQPackageSelector.moc" diff --git a/src/YQPackageSelectorBase.cc b/src/YQPackageSelectorBase.cc index 99da961..70d1398 100644 --- a/src/YQPackageSelectorBase.cc +++ b/src/YQPackageSelectorBase.cc @@ -514,4 +514,3 @@ YQPkgSelWmCloseHandler::filter( YEvent * event ) } -#include "YQPackageSelectorBase.moc" diff --git a/src/YQPatternSelector.cc b/src/YQPatternSelector.cc index e11244e..6a0c190 100644 --- a/src/YQPatternSelector.cc +++ b/src/YQPatternSelector.cc @@ -341,4 +341,3 @@ YQPatternSelector::debugTrace() -#include "YQPatternSelector.moc" diff --git a/src/YQPkgChangeLogView.cc b/src/YQPkgChangeLogView.cc index 01ddc52..8f5448e 100644 --- a/src/YQPkgChangeLogView.cc +++ b/src/YQPkgChangeLogView.cc @@ -148,4 +148,3 @@ QString YQPkgChangeLogView::notDisplayedChanges(int missing, const std::string & return msg.arg(QString::number(missing), cmd); } -#include "YQPkgChangeLogView.moc" diff --git a/src/YQPkgChangesDialog.cc b/src/YQPkgChangesDialog.cc index 7489a99..368790f 100644 --- a/src/YQPkgChangesDialog.cc +++ b/src/YQPkgChangesDialog.cc @@ -416,4 +416,3 @@ YQPkgUnsupportedPackagesDialog::showUnsupportedPackagesDialog( QWidget * parent, } -#include "YQPkgChangesDialog.moc" diff --git a/src/YQPkgConflictDialog.cc b/src/YQPkgConflictDialog.cc index 3d50ee1..77510b5 100644 --- a/src/YQPkgConflictDialog.cc +++ b/src/YQPkgConflictDialog.cc @@ -444,4 +444,3 @@ YQPkgConflictDialog::keyPressEvent( QKeyEvent * event ) -#include "YQPkgConflictDialog.moc" diff --git a/src/YQPkgConflictList.cc b/src/YQPkgConflictList.cc index 3d51635..9bdd44d 100644 --- a/src/YQPkgConflictList.cc +++ b/src/YQPkgConflictList.cc @@ -416,4 +416,3 @@ YQPkgConflict::saveToFile( QFile &file ) const file.write( "\n\n" ); } -#include "YQPkgConflictList.moc" diff --git a/src/YQPkgDependenciesView.cc b/src/YQPkgDependenciesView.cc index 3b9db2c..ae1e908 100644 --- a/src/YQPkgDependenciesView.cc +++ b/src/YQPkgDependenciesView.cc @@ -202,4 +202,3 @@ YQPkgDependenciesView::htmlLines( const zypp::Capabilities & capSet ) } -#include "YQPkgDependenciesView.moc" diff --git a/src/YQPkgDescriptionDialog.cc b/src/YQPkgDescriptionDialog.cc index 6863ad0..676383c 100644 --- a/src/YQPkgDescriptionDialog.cc +++ b/src/YQPkgDescriptionDialog.cc @@ -199,4 +199,3 @@ YQPkgDescriptionDialog::showDescriptionDialog( const QString & pkgName ) -#include "YQPkgDescriptionDialog.moc" diff --git a/src/YQPkgDescriptionView.cc b/src/YQPkgDescriptionView.cc index d5fd850..b3734af 100644 --- a/src/YQPkgDescriptionView.cc +++ b/src/YQPkgDescriptionView.cc @@ -359,4 +359,3 @@ void YQPkgDescriptionView::initLang() } -#include "YQPkgDescriptionView.moc" diff --git a/src/YQPkgDiskUsageList.cc b/src/YQPkgDiskUsageList.cc index 5ca7cd0..b04f7ab 100644 --- a/src/YQPkgDiskUsageList.cc +++ b/src/YQPkgDiskUsageList.cc @@ -428,4 +428,3 @@ YQPkgWarningRangeNotifier::needWarning() const -#include "YQPkgDiskUsageList.moc" diff --git a/src/YQPkgDiskUsageWarningDialog.cc b/src/YQPkgDiskUsageWarningDialog.cc index 240113f..01b8323 100644 --- a/src/YQPkgDiskUsageWarningDialog.cc +++ b/src/YQPkgDiskUsageWarningDialog.cc @@ -180,4 +180,3 @@ YQPkgDiskUsageWarningDialog::diskUsageWarning( const QString & message, -#include "YQPkgDiskUsageWarningDialog.moc" diff --git a/src/YQPkgFileListView.cc b/src/YQPkgFileListView.cc index a6c2d24..193df28 100644 --- a/src/YQPkgFileListView.cc +++ b/src/YQPkgFileListView.cc @@ -134,4 +134,3 @@ QString YQPkgFileListView::formatFileList( const list & fileList ) const } -#include "YQPkgFileListView.moc" diff --git a/src/YQPkgFilterTab.cc b/src/YQPkgFilterTab.cc index 6a915f1..6ab515e 100644 --- a/src/YQPkgFilterTab.cc +++ b/src/YQPkgFilterTab.cc @@ -728,4 +728,3 @@ YQPkgFilterTab::saveSettings() -#include "YQPkgFilterTab.moc" diff --git a/src/YQPkgGenericDetailsView.cc b/src/YQPkgGenericDetailsView.cc index df54a3b..3163c03 100644 --- a/src/YQPkgGenericDetailsView.cc +++ b/src/YQPkgGenericDetailsView.cc @@ -261,4 +261,3 @@ YQPkgGenericDetailsView::hcell( QString contents ) } -#include "YQPkgGenericDetailsView.moc" diff --git a/src/YQPkgHistoryDialog.cc b/src/YQPkgHistoryDialog.cc index c7af49b..e00aeae 100644 --- a/src/YQPkgHistoryDialog.cc +++ b/src/YQPkgHistoryDialog.cc @@ -319,4 +319,3 @@ YQPkgHistoryDialog::moveToAction () } } -#include "YQPkgHistoryDialog.moc" diff --git a/src/YQPkgLangList.cc b/src/YQPkgLangList.cc index 2b5dce9..a6967e3 100644 --- a/src/YQPkgLangList.cc +++ b/src/YQPkgLangList.cc @@ -330,4 +330,3 @@ bool YQPkgLangListItem::operator<( const QTreeWidgetItem & otherListViewItem ) c return QY2ListViewItem::operator<( otherListViewItem ); } -#include "YQPkgLangList.moc" diff --git a/src/YQPkgList.cc b/src/YQPkgList.cc index a638602..56202a4 100644 --- a/src/YQPkgList.cc +++ b/src/YQPkgList.cc @@ -965,4 +965,3 @@ bool YQPkgListItem::operator< ( const QTreeWidgetItem & otherListViewItem ) cons return YQPkgObjListItem::operator<( otherListViewItem ); } -#include "YQPkgList.moc" diff --git a/src/YQPkgObjList.cc b/src/YQPkgObjList.cc index 802bf8e..fb31812 100644 --- a/src/YQPkgObjList.cc +++ b/src/YQPkgObjList.cc @@ -394,7 +394,12 @@ YQPkgObjList::createActions() actionSetCurrentKeepInstalled = createAction( S_KeepInstalled, "[<], [-]" ); actionSetCurrentDelete = createAction( S_Del, "[-]" ); actionSetCurrentUpdate = createAction( S_Update, "[>], [+]" ); - actionSetCurrentUpdateForce = createAction( _( "Update unconditionally" ), statusIcon( S_Update, true ) ,statusIcon( S_Update, false ) , "", true ) ; + + actionSetCurrentUpdateForce = createAction( _( "Update unconditionally" ), + statusIcon( S_Update, true ), + statusIcon( S_Update, false ) , + "", + true ) ; @@ -557,7 +562,7 @@ void YQPkgObjList::updateActions( YQPkgObjListItem * item ) { if ( !item) - item = dynamic_cast ( currentItem() ); + item = dynamic_cast ( currentItem() ); if ( item ) { @@ -799,6 +804,7 @@ YQPkgObjList::logExcludeStatistics() } } + void YQPkgObjList::applyExcludeRules( QTreeWidgetItem * listViewItem ) { @@ -1655,7 +1661,7 @@ void YQPkgObjList::slotCustomContextMenu(const QPoint& pos) QMenu * contextMenu = ! item->selectable()->installedEmpty() ? - installedContextMenu() : notInstalledContextMenu(); + installedContextMenu() : notInstalledContextMenu(); if ( contextMenu ) contextMenu->popup( viewport()->mapToGlobal( pos ) ); @@ -1675,4 +1681,3 @@ QTreeWidgetItem * YQPkgObjList::ExcludedItems::oldParentItem( QTreeWidgetItem * -#include "YQPkgObjList.moc" diff --git a/src/YQPkgPackageKitGroupsFilterView.cc b/src/YQPkgPackageKitGroupsFilterView.cc index 8151fd1..442ee67 100644 --- a/src/YQPkgPackageKitGroupsFilterView.cc +++ b/src/YQPkgPackageKitGroupsFilterView.cc @@ -232,8 +232,6 @@ YQPkgPackageKitGroupsFilterView::fillGroups() group = itg->second; } - //std::cout << it.asString() << std::endl; - if ( _groupsMap.find(group) == _groupsMap.end() ) { _groupsMap[group] = new YQPkgPackageKitGroup( this, group ); @@ -462,4 +460,3 @@ YQPkgPackageKitGroup::operator< ( const QTreeWidgetItem & otherListViewItem ) co } -#include "YQPkgPackageKitGroupsFilterView.moc" diff --git a/src/YQPkgPatchFilterView.cc b/src/YQPkgPatchFilterView.cc index c95548e..8f662b9 100644 --- a/src/YQPkgPatchFilterView.cc +++ b/src/YQPkgPatchFilterView.cc @@ -225,4 +225,3 @@ YQPkgPatchFilterView::fillPatchList() } -#include "YQPkgPatchFilterView.moc" diff --git a/src/YQPkgPatchList.cc b/src/YQPkgPatchList.cc index 5b999f4..64643a1 100644 --- a/src/YQPkgPatchList.cc +++ b/src/YQPkgPatchList.cc @@ -672,4 +672,3 @@ bool YQPkgPatchCategoryItem::operator< ( const QTreeWidgetItem & otherListViewIt -#include "YQPkgPatchList.moc" diff --git a/src/YQPkgPatternList.cc b/src/YQPkgPatternList.cc index 8b1c3fe..83b1034 100644 --- a/src/YQPkgPatternList.cc +++ b/src/YQPkgPatternList.cc @@ -61,42 +61,45 @@ with this program; if not, write to the Free Software Foundation, Inc., using std::string; using std::set; + class YQPkgPatternItemDelegate : public QItemDelegate { - YQPkgPatternList *_view; + YQPkgPatternList *_view; + public: - YQPkgPatternItemDelegate( YQPkgPatternList *parent ) : QItemDelegate( parent ), _view( parent ) { + + YQPkgPatternItemDelegate( YQPkgPatternList *parent ) : QItemDelegate( parent ), _view( parent ) + { } + virtual void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const { painter->save(); YQPkgPatternCategoryItem *citem = dynamic_cast(_view->itemFromIndex(index)); + // special painting for category items if ( citem ) { - //std::cout << "printing category: " << index.column() << std::endl; QFont f = painter->font(); - f.setWeight(QFont::Bold); + f.setWeight( QFont::Bold ); QFontMetrics fm(f); f.setPixelSize( (int) ( fm.height() * 1.1 ) ); - citem->setFont(_view->summaryCol(), f); + citem->setFont( _view->summaryCol(), f ); - QItemDelegate::paint(painter, option, index); + QItemDelegate::paint( painter, option, index ); painter->restore(); return; } - - YQPkgPatternListItem *item = dynamic_cast(_view->itemFromIndex(index)); + YQPkgPatternListItem *item = dynamic_cast( _view->itemFromIndex( index ) ); + if ( item ) { //if ( index.column() == _view->howmanyCol() ) if ( false ) { - //std::cout << "printing percentage: " << index.column() << std::endl; - QColor background = option.palette.color(QPalette::Window); painter->setBackground( background ); @@ -107,7 +110,7 @@ class YQPkgPatternItemDelegate : public QItemDelegate QColor fillColor = option.palette.color(QPalette::Mid); if ( percent > 100.0 ) percent = 100.0; - if ( percent < 0.0 ) percent = 0.0; + if ( percent < 0.0 ) percent = 0.0; int x = option.rect.left() + 1; int y = option.rect.top() + 1; int w = option.rect.width() - 2; @@ -116,21 +119,19 @@ class YQPkgPatternItemDelegate : public QItemDelegate if ( w > 0 ) { fillWidth = (int) ( w * percent / 100.0 ); - //std::cout << "percent: " << percent << " fillw: " << fillWidth << " x: " << x << " y: " << y << "w: " << w << " h: " << h << std::endl; // Fill the desired percentage. - painter->fillRect( x, y, fillWidth, h, - fillColor ); + painter->fillRect( x, y, fillWidth, h, fillColor ); - QString percentageText; + QString percentageText; percentageText.sprintf("%d/%d", item->installedPackages(), item->totalPackages()); - painter->setPen( _view->palette().color( QPalette::Base ) ); - painter->drawText( QRect( x, y, - w, h ), - Qt::AlignHCenter, percentageText ); - painter->restore(); + painter->setPen( _view->palette().color( QPalette::Base ) ); + painter->drawText( QRect( x, y, + w, h ), + Qt::AlignHCenter, percentageText ); + painter->restore(); } painter->restore(); return; @@ -138,11 +139,9 @@ class YQPkgPatternItemDelegate : public QItemDelegate } else { - //std::cout << "printing other: " << index.column() << std::endl; painter->restore(); QItemDelegate::paint(painter, option, index); } - } } }; @@ -176,8 +175,8 @@ YQPkgPatternList::YQPkgPatternList( QWidget * parent, bool autoFill, bool autoFi setIndentation(0); - setItemDelegateForColumn( _iconCol, new YQPkgPatternItemDelegate( this ) ); - setItemDelegateForColumn( _statusCol, new YQPkgPatternItemDelegate( this ) ); + setItemDelegateForColumn( _iconCol, new YQPkgPatternItemDelegate( this ) ); + setItemDelegateForColumn( _statusCol, new YQPkgPatternItemDelegate( this ) ); setItemDelegateForColumn( _summaryCol, new YQPkgPatternItemDelegate( this ) ); //setItemDelegateForColumn( _howmanyCol, new YQPkgPatternItemDelegate(this) ); @@ -195,9 +194,9 @@ YQPkgPatternList::YQPkgPatternList( QWidget * parent, bool autoFill, bool autoFi setAllColumnsShowFocus( true ); - header()->setSectionResizeMode( statusCol(), QHeaderView::Fixed ); + header()->setSectionResizeMode( statusCol(), QHeaderView::Fixed ); header()->setSectionResizeMode( summaryCol(), QHeaderView::Stretch ); - header()->setSectionResizeMode( howmanyCol(), QHeaderView::Fixed ); + header()->setSectionResizeMode( howmanyCol(), QHeaderView::Fixed ); header()->resizeSection( statusCol(), 25 ); setColumnWidth( statusCol(), 25 ); @@ -210,8 +209,9 @@ YQPkgPatternList::YQPkgPatternList( QWidget * parent, bool autoFill, bool autoFi if ( autoFilter ) { - connect( this, SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ), - this, SLOT ( filter() ) ); + connect( this, SIGNAL( currentItemChanged( QTreeWidgetItem *, + QTreeWidgetItem * ) ), + this, SLOT ( filter() ) ); } setIconSize(QSize(32,32)); @@ -223,6 +223,7 @@ YQPkgPatternList::YQPkgPatternList( QWidget * parent, bool autoFill, bool autoFi fillList(); selectSomething(); } + yuiDebug() << "Creating pattern list done" << std::endl; } @@ -307,32 +308,32 @@ YQPkgPatternList::filter() if ( selection() ) // The seleted QListViewItem { - ZyppPattern zyppPattern = selection()->zyppPattern(); + ZyppPattern zyppPattern = selection()->zyppPattern(); - if ( zyppPattern ) - { - int total = 0; - int installed = 0; - - zypp::Pattern::Contents c(zyppPattern->contents()); - for ( zypp::Pattern::Contents::Selectable_iterator it = c.selectableBegin(); - it != c.selectableEnd(); - ++it ) - { - ZyppPkg zyppPkg = tryCastToZyppPkg( (*it)->theObj() ); - if ( zyppPkg ) - { - if ( (*it)->installedSize() > 0 ) - ++installed; - ++total; + if ( zyppPattern ) + { + int total = 0; + int installed = 0; - emit filterMatch( *it, zyppPkg ); - } - } - selection()->setInstalledPackages(installed); - selection()->setTotalPackages(total); - selection()->resetToolTip(); - } + zypp::Pattern::Contents c(zyppPattern->contents()); + for ( zypp::Pattern::Contents::Selectable_iterator it = c.selectableBegin(); + it != c.selectableEnd(); + ++it ) + { + ZyppPkg zyppPkg = tryCastToZyppPkg( (*it)->theObj() ); + if ( zyppPkg ) + { + if ( (*it)->installedSize() > 0 ) + ++installed; + ++total; + + emit filterMatch( *it, zyppPkg ); + } + } + selection()->setInstalledPackages(installed); + selection()->setTotalPackages(total); + selection()->resetToolTip(); + } } emit filterFinished(); @@ -355,11 +356,11 @@ YQPkgPatternList::addPatternItem( ZyppSel selectable, if ( cat ) { - item = new YQPkgPatternListItem( this, cat, selectable, zyppPattern ); + item = new YQPkgPatternListItem( this, cat, selectable, zyppPattern ); } else { - item = new YQPkgPatternListItem( this, selectable, zyppPattern ); + item = new YQPkgPatternListItem( this, selectable, zyppPattern ); } resizeColumnToContents(_howmanyCol); @@ -393,18 +394,18 @@ YQPkgPatternList::pkgObjClicked( int button, if ( categoryItem ) { - if ( button == Qt::LeftButton ) - { - if ( col == 0 ) - { - categoryItem->setExpanded( ! categoryItem->isExpanded() ); - } - } + if ( button == Qt::LeftButton ) + { + if ( col == 0 ) + { + categoryItem->setExpanded( ! categoryItem->isExpanded() ); + } + } } else { - YQPkgObjList::pkgObjClicked( button, listViewItem, col, pos ); + YQPkgObjList::pkgObjClicked( button, listViewItem, col, pos ); } } @@ -432,6 +433,7 @@ YQPkgPatternList::selectSomething() #endif } + YQPkgPatternListItem::YQPkgPatternListItem( YQPkgPatternList * patternList, ZyppSel selectable, ZyppPattern zyppPattern ) @@ -466,25 +468,24 @@ YQPkgPatternListItem::init() 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"; + 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()))); + } - - //std::cout << icon << " | "<< iconpath << std::endl; - 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()))); - } - } @@ -526,7 +527,7 @@ YQPkgPatternListItem::cycleStatus() break; case S_AutoInstall: - newStatus = S_NoInst; + newStatus = S_NoInst; break; default: @@ -560,12 +561,13 @@ YQPkgPatternListItem::resetToolTip() if ( totalPackages() > 0 ) { - infoToolTip += ("

" + zypp::str::form("%d / %d", installedPackages(), totalPackages() ) + "

"); + infoToolTip += ("

" + zypp::str::form("%d / %d", installedPackages(), totalPackages() ) + "

"); } setToolTip(_patternList->summaryCol(), fromUTF8(infoToolTip)); } + void YQPkgPatternListItem::applyChanges() { @@ -577,15 +579,12 @@ bool YQPkgPatternListItem::operator< ( const QTreeWidgetItem & otherListViewItem { const YQPkgPatternListItem * otherPatternListitem = dynamic_cast(&otherListViewItem); - //std::cout << _zyppPattern->order()<< " | " << otherPatternListitem->zyppPattern()->order() << std::endl; - - if ( _zyppPattern && otherPatternListitem && otherPatternListitem->zyppPattern() ) { - if ( _zyppPattern->order() != otherPatternListitem->zyppPattern()->order() ) - return _zyppPattern->order() < otherPatternListitem->zyppPattern()->order(); - else - return _zyppPattern->name() < otherPatternListitem->zyppPattern()->name(); + if ( _zyppPattern->order() != otherPatternListitem->zyppPattern()->order() ) + return _zyppPattern->order() < otherPatternListitem->zyppPattern()->order(); + else + return _zyppPattern->name() < otherPatternListitem->zyppPattern()->name(); } const YQPkgPatternCategoryItem * otherCategoryItem = dynamic_cast(&otherListViewItem); @@ -596,6 +595,7 @@ bool YQPkgPatternListItem::operator< ( const QTreeWidgetItem & otherListViewItem return QTreeWidgetItem::operator<( otherListViewItem ); } + YQPkgPatternCategoryItem::YQPkgPatternCategoryItem( YQPkgPatternList * patternList, const QString & category ) : QY2ListViewItem( patternList ) @@ -613,6 +613,7 @@ YQPkgPatternCategoryItem::~YQPkgPatternCategoryItem() // NOP } + void YQPkgPatternCategoryItem::addPattern( ZyppPattern pattern ) { @@ -640,9 +641,9 @@ void YQPkgPatternCategoryItem::setTreeIcon() { setIcon( 0, - isExpanded() ? - YQIconPool::arrowDown() : - YQIconPool::arrowRight() ); + isExpanded() ? + YQIconPool::arrowDown() : + YQIconPool::arrowRight() ); } @@ -652,7 +653,7 @@ bool YQPkgPatternCategoryItem::operator< ( const QTreeWidgetItem & otherListView const YQPkgPatternCategoryItem * otherCategoryItem = dynamic_cast(&otherListViewItem); if ( _firstPattern && otherCategoryItem && otherCategoryItem->firstPattern() ) - return _firstPattern->order() < otherCategoryItem->firstPattern()->order(); + return _firstPattern->order() < otherCategoryItem->firstPattern()->order(); const YQPkgPatternListItem * otherPatternListitem = dynamic_cast(&otherListViewItem); @@ -665,4 +666,3 @@ bool YQPkgPatternCategoryItem::operator< ( const QTreeWidgetItem & otherListView -#include "YQPkgPatternList.moc" diff --git a/src/YQPkgProductDialog.cc b/src/YQPkgProductDialog.cc index 93dfd7d..53842b1 100644 --- a/src/YQPkgProductDialog.cc +++ b/src/YQPkgProductDialog.cc @@ -177,4 +177,3 @@ YQPkgProductDialog::showProductDialog( QWidget* parent) -#include "YQPkgProductDialog.moc" diff --git a/src/YQPkgProductList.cc b/src/YQPkgProductList.cc index aa44e8f..79b1e4d 100644 --- a/src/YQPkgProductList.cc +++ b/src/YQPkgProductList.cc @@ -173,4 +173,3 @@ YQPkgProductListItem::applyChanges() -#include "YQPkgProductList.moc" diff --git a/src/YQPkgRepoFilterView.cc b/src/YQPkgRepoFilterView.cc index 5b4c5f6..94ebe45 100644 --- a/src/YQPkgRepoFilterView.cc +++ b/src/YQPkgRepoFilterView.cc @@ -91,4 +91,3 @@ void YQPkgRepoFilterView::primaryFilterIfVisible() _repoList->filterIfVisible(); } -#include "YQPkgRepoFilterView.moc" diff --git a/src/YQPkgRepoList.cc b/src/YQPkgRepoList.cc index f6adf9b..a87754a 100644 --- a/src/YQPkgRepoList.cc +++ b/src/YQPkgRepoList.cc @@ -297,4 +297,3 @@ YQPkgRepoListItem::operator< ( const QTreeWidgetItem & other ) const return zyppRepo().info().name() < otherItem->zyppRepo().info().name(); } -#include "YQPkgRepoList.moc" diff --git a/src/YQPkgSearchFilterView.cc b/src/YQPkgSearchFilterView.cc index defc6bb..fe0186a 100644 --- a/src/YQPkgSearchFilterView.cc +++ b/src/YQPkgSearchFilterView.cc @@ -464,4 +464,3 @@ YQPkgSearchFilterView::check( const zypp::Capabilities& capSet, const QRegExp & return false; } -#include "YQPkgSearchFilterView.moc" diff --git a/src/YQPkgSecondaryFilterView.cc b/src/YQPkgSecondaryFilterView.cc index 09ed1b4..8dd3058 100644 --- a/src/YQPkgSecondaryFilterView.cc +++ b/src/YQPkgSecondaryFilterView.cc @@ -193,4 +193,3 @@ YQPkgSecondaryFilterView::secondaryFilterMatch( ZyppSel selectable, return true; } -#include "YQPkgSecondaryFilterView.moc" diff --git a/src/YQPkgSelDescriptionView.cc b/src/YQPkgSelDescriptionView.cc index 97d648e..9843e41 100644 --- a/src/YQPkgSelDescriptionView.cc +++ b/src/YQPkgSelDescriptionView.cc @@ -191,4 +191,3 @@ YQPkgSelDescriptionView::findIcon( const QString & icon ) const } -#include "YQPkgSelDescriptionView.moc" diff --git a/src/YQPkgSelList.cc b/src/YQPkgSelList.cc index 8e20f26..c805d7b 100644 --- a/src/YQPkgSelList.cc +++ b/src/YQPkgSelList.cc @@ -256,4 +256,3 @@ YQPkgSelListItem::compare( QTreeWidgetItem * otherListViewItem, -#include "YQPkgSelList.moc" diff --git a/src/YQPkgServiceFilterView.cc b/src/YQPkgServiceFilterView.cc index f346a6d..f9fd9b5 100644 --- a/src/YQPkgServiceFilterView.cc +++ b/src/YQPkgServiceFilterView.cc @@ -63,4 +63,3 @@ bool YQPkgServiceFilterView::any_service() return ret; } -#include "YQPkgServiceFilterView.moc" diff --git a/src/YQPkgServiceList.cc b/src/YQPkgServiceList.cc index 1ac8c55..cca23dc 100644 --- a/src/YQPkgServiceList.cc +++ b/src/YQPkgServiceList.cc @@ -248,4 +248,3 @@ YQPkgServiceListItem::operator< ( const QTreeWidgetItem & other ) const return QString::compare(fromUTF8(zyppServiceName()), fromUTF8(otherItem->zyppServiceName()), Qt::CaseInsensitive) < 0; } -#include "YQPkgServiceList.moc" diff --git a/src/YQPkgStatusFilterView.cc b/src/YQPkgStatusFilterView.cc index 00ca221..90e7707 100644 --- a/src/YQPkgStatusFilterView.cc +++ b/src/YQPkgStatusFilterView.cc @@ -313,4 +313,3 @@ void YQPkgStatusFilterView::showNotInstalled() -#include "YQPkgStatusFilterView.moc" diff --git a/src/YQPkgTechnicalDetailsView.cc b/src/YQPkgTechnicalDetailsView.cc index 2f07ede..bd9d3fd 100644 --- a/src/YQPkgTechnicalDetailsView.cc +++ b/src/YQPkgTechnicalDetailsView.cc @@ -218,4 +218,3 @@ YQPkgTechnicalDetailsView::complexTable( ZyppSel selectable, } -#include "YQPkgTechnicalDetailsView.moc" diff --git a/src/YQPkgTextDialog.cc b/src/YQPkgTextDialog.cc index 1831771..9d9e558 100644 --- a/src/YQPkgTextDialog.cc +++ b/src/YQPkgTextDialog.cc @@ -350,4 +350,3 @@ YQPkgTextDialog::htmlHeading( ZyppSel selectable ) -#include "YQPkgTextDialog.moc" diff --git a/src/YQPkgUpdateProblemFilterView.cc b/src/YQPkgUpdateProblemFilterView.cc index 51fbfd9..f277f77 100644 --- a/src/YQPkgUpdateProblemFilterView.cc +++ b/src/YQPkgUpdateProblemFilterView.cc @@ -133,4 +133,3 @@ YQPkgUpdateProblemFilterView::haveProblematicPackages() } -#include "YQPkgUpdateProblemFilterView.moc" diff --git a/src/YQPkgVersionsView.cc b/src/YQPkgVersionsView.cc index 731b84c..eae6e4c 100644 --- a/src/YQPkgVersionsView.cc +++ b/src/YQPkgVersionsView.cc @@ -709,4 +709,3 @@ QPixmap YQPkgMultiVersion::statusIcon( ZyppStatus status ) -#include "YQPkgVersionsView.moc" diff --git a/src/YQSimplePatchSelector.cc b/src/YQSimplePatchSelector.cc index 42ca2a3..7e4b712 100644 --- a/src/YQSimplePatchSelector.cc +++ b/src/YQSimplePatchSelector.cc @@ -280,4 +280,3 @@ YQSimplePatchSelector::debugTrace() -#include "YQSimplePatchSelector.moc"