Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 96 |
1 files changed, 32 insertions, 64 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index be9d6da..fd8279b 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -58,11 +58,11 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest ) cmd += " -force-defaults "; - if (_force_depends) + if (installDialog->_force_depends) { - if (_force_depends->isChecked()) + if (installDialog->_force_depends->isChecked()) cmd += " -force-depends "; - if (_force_reinstall->isChecked()) + if (installDialog->_force_reinstall->isChecked()) cmd += " -force-reinstall "; - if (_force_remove->isChecked()) + if (installDialog->_force_remove->isChecked()) cmd += " -force-removal-of-essential-packages "; } @@ -174,18 +174,15 @@ void PmIpkg::processLinkDir( QString file, QString dest ) if (linkOpp==createLink) destDir.mkdir( destFile, true ); QDir d( file ); - d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); +// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); QFileInfo *fi; + qDebug( "while %i",list->count()); while ( (fi=it.current()) ) { + pvDebug(4, "processLinkDir "+fi->absFilePath()); processLinkDir( fi->absFilePath(), dest ); ++it; } -// if (linkOpp==removeLink) -// { -// pvDebug(2,"remove destDir "+ destFile ); -// destDir.remove( destFile, true ); -// } } else if ( fileInfo.isFile() ) @@ -202,8 +199,10 @@ void PmIpkg::processLinkDir( QString file, QString dest ) if( linkOpp==removeLink ) { - pvDebug(4,"removing "+destFile+" no "+file); QFileInfo toRemoveLink( destFile ); if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) + { + pvDebug(4,"removing "+destFile+" no "+file); unlink( linkFile ); + } } } @@ -224,10 +223,7 @@ void PmIpkg::loadList( PackageList pl ) } -void PmIpkg::commit( PackageList pl ) +void PmIpkg::commit() { int 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; @@ -240,55 +236,24 @@ void PmIpkg::commit( PackageList pl ) void PmIpkg::startDialog() { - installDialog = new QDialog(0,0,true); - QGridLayout *RunWindowLayout = new QGridLayout( installDialog ); - RunWindowLayout->setSpacing( 2 ); - RunWindowLayout->setMargin( 2 ); - - PackageListView *plv = new PackageListView(installDialog, "install",settings); - plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) ); - RunWindowLayout->addWidget( plv, 1, 0 ); - QCheckListItem *toRemoveItem; - toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") ); - toRemoveItem->setOpen( true ); - for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) - { - toRemoveItem->insertItem( new PackageListItem(plv, it,settings) ); - } - QCheckListItem *toInstallItem; - toInstallItem = new QCheckListItem( plv, QObject::tr("To install") ); - toInstallItem->setOpen( true ); - 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().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" ); - _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); - _force_remove->setAutoResize( TRUE ); - GroupBox1Layout->addWidget( _force_remove, 1, 0 ); - RunWindowLayout->addWidget( GroupBox1 , 3, 0 ); + installDialog = new InstallDialog(settings,0,0,true); + QCheckListItem *toRemoveItem; + toRemoveItem= new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To remove") ); + toRemoveItem->setOpen( true ); + for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) + { + toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) ); + } + QCheckListItem *toInstallItem; + toInstallItem = new QCheckListItem( installDialog->ListViewPackages, QObject::tr("To install") ); + toInstallItem->setOpen( true ); + for (Package *it=to_install.first(); it != 0; it=to_install.next() ) + { + toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, it,settings) ); + } installDialog->showMaximized(); if ( installDialog->exec() ) doIt(); installDialog->close(); out(tr("<b>All done.</b>")); + to_install.clear(); } @@ -358,4 +323,5 @@ void PmIpkg::install() } out("<br>"); + to_install.clear(); } @@ -366,5 +332,6 @@ void PmIpkg::createLinks( const QString &dest ) QString url = settings->getDestinationUrlByName( dest ); url = url==""?dest:url; - processLinkDir( "/", url ); + processLinkDir( "/opt", url ); + processLinkDir( "/usr", url ); } @@ -375,5 +342,6 @@ void PmIpkg::removeLinks( const QString &dest ) QString url = settings->getDestinationUrlByName( dest ); url = url==""?dest:url; - processLinkDir( "/", url ); + processLinkDir( "/opt", url ); + processLinkDir( "/usr", url ); } |