summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp52
1 files changed, 25 insertions, 27 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 9f6429a..fe200f5 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -207,40 +207,37 @@ void PmIpkg::processLinkDir( QString file, QString dest )
if ( !QFile::exists( file ) && toRemoveLink.isSymLink() )
unlink( linkFile );
}
}
}
-void PmIpkg::commit( PackageList pl )
+void PmIpkg::loadList( PackageList pl )
{
- int sizecount = 0;
- to_install.clear();
- to_remove.clear();
- QString rem="<b>"+tr("To remove:")+"</b><br>\n";
- QString inst="<b>"+tr("To install:")+"</b><br>\n";
for( Package *pack = pl.first();pack ; (pack = pl.next()) )
- {
- if ( pack && (pack->name() != "") && pack)
- {
- if ( pack->toInstall() )
- {
+ {
+ if ( pack && (pack->name() != "") && pack)
+ {
+ if ( pack->toInstall() )
to_install.append( pack );
- sizecount += pack->size().toInt();
- inst += pack->name()+"\t("+tr("on ")+pack->dest()+")<br>";
- }
- if ( pack->toRemove() )
- {
+ if ( pack->toRemove() )
to_remove.append( pack );
- sizecount += 1;
- rem += pack->name()+"<br>";
- }
- }
- }
+ }
+ }
+}
+void PmIpkg::commit( PackageList pl )
+{
+ sizecount = 0;
+ QString rem="<b>"+tr("To remove:")+"</b><br>\n";
+ QString inst="<b>"+tr("To install:")+"</b><br>\n";
+ loadList(pl);
+ for (uint i=0; i < to_remove.count(); i++)
+ sizecount += 1;
+ for (uint i=0; i < to_install.count(); i++)
+ sizecount += to_install.at(i)->size().toInt();
startDialog();
-
}
void PmIpkg::startDialog()
{
installDialog = new QDialog(0,0,true);
QGridLayout *RunWindowLayout = new QGridLayout( installDialog );
@@ -263,25 +260,25 @@ void PmIpkg::startDialog()
for (Package *it=to_install.first(); it != 0; it=to_install.next() )
{
toInstallItem->insertItem( new PackageListItem(plv, it,settings) );
}
QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" );
- GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().hasHeightForWidth() ) );
+ GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) );
GroupBox1->setTitle( tr( "Ipkg options" ) );
GroupBox1->setColumnLayout(0, Qt::Vertical );
GroupBox1->layout()->setSpacing( 0 );
GroupBox1->layout()->setMargin( 0 );
QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
GroupBox1Layout->setAlignment( Qt::AlignTop );
GroupBox1Layout->setSpacing( 3 );
GroupBox1Layout->setMargin( 3 );
-
_force_depends = new QCheckBox( GroupBox1, "_force_depends" );
_force_depends->setText( tr( "-force-depends" ) );
_force_depends->setAutoResize( TRUE );
+ _force_depends->setChecked(true);
GroupBox1Layout->addWidget( _force_depends, 0, 0 );
_force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" );
_force_reinstall->setText( tr( "-force-reinstall" ) );
_force_reinstall->setAutoResize( TRUE );
GroupBox1Layout->addWidget( _force_reinstall, 1, 0 );
_force_remove = new QCheckBox( GroupBox1, "_force_remove" );
@@ -316,26 +313,27 @@ void PmIpkg::remove()
{
if ( to_remove.count() == 0 ) return;
out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>");
QStringList *fileList;
- for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
- {
+ for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
+ {
if ( it->link() )fileList = getList( it->name(), it->dest() );
if ( runIpkg("remove " + it->name()) == 0)
{
runwindow->progress->setProgress( 1 + runwindow->progress->progress() );
linkOpp = removeLink;
if ( it->link() )
{
out( "<br>removing links<br>" );
out( "for package "+it->name()+" in "+it->dest()+"<br>" );
processFileList( fileList, it->dest() );
}
it->processed();
+
out("<br><hr>");
}else{
out("<b>"+tr("Error while removing")+"</b><hr>"+it->name());
}
pvDebug(2,"delete File List");
if ( it->link() )delete fileList;
@@ -348,13 +346,13 @@ void PmIpkg::install()
{
if ( to_install.count() == 0 ) return;
out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>");
for (Package *it=to_install.first(); it != 0; it=to_install.next() )
{
- if ( runIpkg("install " + it->getPackageName(), it->dest() ) == 0 )
+ if ( runIpkg("install " + it->installName(), it->dest() ) == 0 )
{
runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress());
linkOpp = createLink;
if ( it->link() )
{
out( "<br>creating links<br>" );