Skip to content

Commit

Permalink
fix sources to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandres committed Jun 14, 2012
1 parent 32e728e commit f3e7332
Show file tree
Hide file tree
Showing 21 changed files with 188 additions and 163 deletions.
1 change: 1 addition & 0 deletions src/YQPackageSelectorPluginImpl.cc
Expand Up @@ -46,6 +46,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define YUILogComponent "qt-pkg"
#include <YUILog.h>

using std::endl;

// Create YQPackageSelectorStart which reads the layout
// term of the package selection dialog, creates the widget
Expand Down
1 change: 1 addition & 0 deletions src/YQPatternSelector.cc
Expand Up @@ -66,6 +66,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define ALWAYS_SOLVE_IMMEDIATELY 1

using std::max;
using std::endl;
using std::string;

#define SPACING 6
Expand Down
45 changes: 23 additions & 22 deletions src/YQPkgChangesDialog.cc
Expand Up @@ -62,6 +62,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "YQUI.h"

using std::set;
using std::endl;
using std::string;

YQPkgChangesDialog::YQPkgChangesDialog( QWidget * parent,
Expand Down Expand Up @@ -113,9 +114,9 @@ YQPkgChangesDialog::YQPkgChangesDialog( QWidget * parent,
_filter->addItem(_("All"), QVariant::fromValue(Filters(FilterAll)));
_filter->addItem(_("Selected by the user"), QVariant::fromValue(Filters(FilterUser)));
_filter->addItem(_("Automatic Changes"), QVariant::fromValue(Filters(FilterAutomatic)));

_filter->setCurrentIndex(0);

layout->addWidget(_filter);
connect( _filter, SIGNAL(currentIndexChanged(int)),
SLOT(slotFilterChanged(int)));
Expand Down Expand Up @@ -173,7 +174,7 @@ YQPkgChangesDialog::slotFilterChanged( int index )
{
yuiMilestone() << "filter index changed to: " << index << endl;
QVariant v = _filter->itemData(index);

if ( v.isValid() && v.canConvert<Filters>() )
{
Filters f = v.value<Filters>();
Expand Down Expand Up @@ -203,15 +204,15 @@ YQPkgChangesDialog::setFilter( const QRegExp &regexp, Filters f )
QVariant v = _filter->itemData(k);
if ( v.isValid() && v.canConvert<Filters>() )
{

Filters setf = v.value<Filters>();
if ( setf == f )
index = k;
index = k;
}
}

if ( index != -1 )
{
{
// so we dont get called again
_filter->blockSignals(true);
// try to set the widget
Expand All @@ -235,7 +236,7 @@ YQPkgChangesDialog::filter( const QRegExp & regexp, Filters f )
bool byAuto = f.testFlag(FilterAutomatic);
bool byUser = f.testFlag(FilterUser);
bool byApp = f.testFlag(FilterUser);

int discard_regex = 0;
int discard_ignored = 0;
int discard_extra = 0;
Expand All @@ -256,13 +257,13 @@ YQPkgChangesDialog::filter( const QRegExp & regexp, Filters f )
if ( selectable->toModify() )
{
zypp::ResStatus::TransactByValue modifiedBy = selectable->modifiedBy();

if ( ( ( modifiedBy == zypp::ResStatus::SOLVER ) && byAuto ) ||
( ( modifiedBy == zypp::ResStatus::APPL_LOW ||
modifiedBy == zypp::ResStatus::APPL_HIGH ) && byApp ) ||
( ( modifiedBy == zypp::ResStatus::USER ) && byUser ) )
{
if ( regexp.isEmpty()
if ( regexp.isEmpty()
|| regexp.indexIn( selectable->name().c_str() ) >= 0 )
{
if ( ! contains( ignoredNames, selectable->name() ) )
Expand All @@ -277,15 +278,15 @@ YQPkgChangesDialog::filter( const QRegExp & regexp, Filters f )
{ discard_ignored++; }
}
else
{ discard_regex++; }
{ discard_regex++; }
}
else
{ discard_whomodified++; }

}
else
{ discard_notmodified++; }

}

yuiMilestone() << "Filter result summary: " << endl;
Expand All @@ -297,7 +298,7 @@ YQPkgChangesDialog::filter( const QRegExp & regexp, Filters f )
YQUI::ui()->normalCursor();
}

bool
bool
YQPkgChangesDialog::extraFilter( ZyppSel sel, ZyppPkg pkg )
{
return true;
Expand Down Expand Up @@ -329,15 +330,15 @@ YQPkgChangesDialog::showChangesDialog( QWidget * parent,
message,
acceptButtonLabel,
rejectButtonLabel );

dialog.setFilter(f);

if ( dialog.isEmpty() && o.testFlag(OptionAutoAcceptIfEmpty) )
{
yuiMilestone() << "No items to show in changes dialog, accepting it automatically" << endl;
return true;
}


dialog.exec();

Expand All @@ -359,7 +360,7 @@ YQPkgChangesDialog::showChangesDialog( QWidget * parent,
acceptButtonLabel,
rejectButtonLabel );
dialog.setFilter(regexp,f);

if ( dialog.isEmpty() && o.testFlag(OptionAutoAcceptIfEmpty) )
{
yuiMilestone() << "No items to show in dialog, accepting it automatically" << endl;
Expand All @@ -383,7 +384,7 @@ bool YQPkgUnsupportedPackagesDialog::extraFilter( ZyppSel sel, ZyppPkg pkg )
{
if (!pkg || !sel)
return false;

yuiDebug() << "UNSUPPORTED PKG: " << pkg << endl;
return pkg->maybeUnsupported() && sel->toInstall();
}
Expand All @@ -400,15 +401,15 @@ YQPkgUnsupportedPackagesDialog::showUnsupportedPackagesDialog( QWidget * parent,
message,
acceptButtonLabel,
rejectButtonLabel );

dialog.setFilter(f);

if ( dialog.isEmpty() && o.testFlag(OptionAutoAcceptIfEmpty) )
{
yuiMilestone() << "No items to show in unsupported packages dialog, accepting it automatically" << endl;
return true;
}

dialog.exec();

return dialog.result() == QDialog::Accepted;
Expand Down
1 change: 1 addition & 0 deletions src/YQPkgConflictDialog.cc
Expand Up @@ -77,6 +77,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#define SUPPRESS_BUSY_DIALOG_SECONDS 1.5

using std::endl;

YQPkgConflictDialog::YQPkgConflictDialog( QWidget * parent )
: QDialog( parent )
Expand Down
7 changes: 4 additions & 3 deletions src/YQPkgDescriptionView.cc
Expand Up @@ -65,11 +65,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,


using std::list;
using std::endl;
using std::string;
using namespace zypp;

YQPkgDescriptionView::YQPkgDescriptionView( QWidget * parent, bool showSupportability )
: YQPkgGenericDetailsView( parent )
: YQPkgGenericDetailsView( parent )
, _showSupportability ( showSupportability )
{
//FIXME setMimeSourceFactory( 0 );
Expand Down Expand Up @@ -244,7 +245,7 @@ YQPkgDescriptionView::applicationIconList( const list<string> & fileList ) const
{
desktopEntries = readDesktopFile( desktopFiles[i] );

QString desktopIcon = findDesktopIcon ( desktopEntries["Icon"] );
QString desktopIcon = findDesktopIcon ( desktopEntries["Icon"] );

if ( ! desktopIcon.isEmpty() )
{
Expand All @@ -260,7 +261,7 @@ YQPkgDescriptionView::applicationIconList( const list<string> & fileList ) const
{
html = _("This package contains: ")
+ "<table border='0'>"
+ html
+ html
+ "</table>";
}

Expand Down
1 change: 1 addition & 0 deletions src/YQPkgDiskUsageList.cc
Expand Up @@ -55,6 +55,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,


using std::set;
using std::endl;


// Warning ranges for "disk space is running out" or "disk space overflow".
Expand Down
38 changes: 20 additions & 18 deletions src/YQPkgHistoryDialog.cc
Expand Up @@ -74,6 +74,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#define FILENAME "/var/log/zypp/history"

using std::endl;

YQPkgHistoryDialog::YQPkgHistoryDialog( QWidget * parent )
: QDialog( parent )
{
Expand All @@ -90,9 +92,9 @@ YQPkgHistoryDialog::YQPkgHistoryDialog( QWidget * parent )
setLayout(layout);
layout->setMargin(MARGIN);
layout->setSpacing(SPACING);

setMinimumSize (300,400);

QLabel * label = new QLabel ( _("Show History (/var/log/zypp/history)" ), this );
label->setFixedHeight (label->sizeHint ().height ());
layout->addWidget (label);
Expand All @@ -106,7 +108,7 @@ YQPkgHistoryDialog::YQPkgHistoryDialog( QWidget * parent )
_dates = new QTreeWidget (splitter);
_dates->setColumnCount (1);
_dates->setHeaderLabels ( QStringList( _("Date") ) );

_actions = new QTreeWidget (splitter);
_actions->setColumnCount (2);
_actions->setHeaderLabels ( QStringList( _("Action") ) << _("Version/URL") );
Expand All @@ -133,7 +135,7 @@ YQPkgHistoryDialog::YQPkgHistoryDialog( QWidget * parent )

connect( button, SIGNAL( clicked() ),
this, SLOT ( accept() ) );

connect( _dates, SIGNAL( itemSelectionChanged () ),
this, SLOT ( moveToDate () ) );

Expand Down Expand Up @@ -170,7 +172,7 @@ QPixmap actionIcon (zypp::HistoryActionID id)
case zypp::HistoryActionID::REPO_ADD_e : return YQIconPool::treePlus ();
default: return QPixmap ();
}

return QPixmap ();
}

Expand All @@ -179,7 +181,7 @@ struct HistoryItemCollector
QTreeWidget* actions, * dates;
std::string _last;
QTreeWidgetItem* date_start;

bool operator()( const zypp::HistoryItem::Ptr & item_ptr )
{
std::string d = item_ptr->date.form("%e %B %Y");
Expand All @@ -191,44 +193,44 @@ struct HistoryItemCollector
actions-> insertTopLevelItem ( 0, date_start );
dates-> insertTopLevelItem ( 0, new QTreeWidgetItem (dates, QStringList(QString(d.c_str()))));
}

QStringList columns;
if ( item_ptr->action.toEnum () == zypp::HistoryActionID::INSTALL_e )
{
zypp::HistoryItemInstall* item = static_cast <zypp::HistoryItemInstall *> (item_ptr.get());
zypp::HistoryItemInstall* item = static_cast <zypp::HistoryItemInstall *> (item_ptr.get());

columns << QString(item->name.c_str());
columns << QString(item->edition.version().c_str());
} else
if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REMOVE_e )
{
zypp::HistoryItemRemove* item = static_cast <zypp::HistoryItemRemove *> (item_ptr.get());
zypp::HistoryItemRemove* item = static_cast <zypp::HistoryItemRemove *> (item_ptr.get());

columns << QString(item->name.c_str());
columns << QString(item->edition.version().c_str());
} else
if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_ADD_e )
{
zypp::HistoryItemRepoAdd* item = static_cast <zypp::HistoryItemRepoAdd *> (item_ptr.get());
zypp::HistoryItemRepoAdd* item = static_cast <zypp::HistoryItemRepoAdd *> (item_ptr.get());

columns << QString(item->alias.c_str());
columns << QString(item->url.asString().c_str());
} else
if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_REMOVE_e )
{
zypp::HistoryItemRepoRemove* item = static_cast <zypp::HistoryItemRepoRemove *> (item_ptr.get());
zypp::HistoryItemRepoRemove* item = static_cast <zypp::HistoryItemRepoRemove *> (item_ptr.get());

columns << QString(item->alias.c_str());
} else
if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_CHANGE_ALIAS_e )
{
zypp::HistoryItemRepoAliasChange* item = static_cast <zypp::HistoryItemRepoAliasChange *> (item_ptr.get());
zypp::HistoryItemRepoAliasChange* item = static_cast <zypp::HistoryItemRepoAliasChange *> (item_ptr.get());

columns << QString( (item->oldalias + " -> " + item->newalias).c_str());
} else
if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_CHANGE_URL_e )
{
zypp::HistoryItemRepoUrlChange* item = static_cast <zypp::HistoryItemRepoUrlChange *> (item_ptr.get());
zypp::HistoryItemRepoUrlChange* item = static_cast <zypp::HistoryItemRepoUrlChange *> (item_ptr.get());

columns << QString(item->alias.c_str());
columns << QString(item->newurl.asString().c_str());
Expand Down Expand Up @@ -271,7 +273,7 @@ YQPkgHistoryDialog::initialize()
blanks.fill( ' ', 50 - heading.length() );
heading += blanks;
}

msgBox.setText( heading );
msgBox.setIcon( QMessageBox::Warning );
msgBox.setInformativeText( fromUTF8( exception.asUserHistory() ) );
Expand All @@ -286,7 +288,7 @@ YQPkgHistoryDialog::moveToDate ()
if (signalsBlocked() ) return;
QString item = _dates->selectedItems().first()->text(0);
QList<QTreeWidgetItem *> items = _actions->findItems (item, Qt::MatchExactly, 0);

if( items.size () > 0 )
{
blockSignals(true);
Expand All @@ -302,13 +304,13 @@ YQPkgHistoryDialog::moveToAction ()
{
if (signalsBlocked() ) return;
QTreeWidgetItem* item = _actions->selectedItems().first();

// if this is not top-level item, better pick top-level one
if (item->parent ())
item = item->parent ();

QList<QTreeWidgetItem *> items = _dates->findItems (item->text(0), Qt::MatchExactly | Qt::MatchRecursive, 0);

if( items.size () > 0 )
{
blockSignals(true);
Expand Down

0 comments on commit f3e7332

Please sign in to comment.