author | tille <tille> | 2002-05-01 14:00:09 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-01 14:00:09 (UTC) |
commit | e729a9bdd9f37f4bd610d10122f002a0540c93ed (patch) (unidiff) | |
tree | a23696d8742a36b57256281dc7e2f7848407be61 /noncore/unsupported/oipkg/pmipkg.cpp | |
parent | 7e5615473c1d103db66f42ae60bf9ed57d52566c (diff) | |
download | opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.zip opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.tar.gz opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.tar.bz2 |
added ipkgfind remote query
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 52 |
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 | |||
@@ -210,34 +210,31 @@ void PmIpkg::processLinkDir( QString file, QString dest ) | |||
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | void PmIpkg::commit( PackageList pl ) | 213 | void PmIpkg::loadList( PackageList pl ) |
214 | { | 214 | { |
215 | int sizecount = 0; | ||
216 | to_install.clear(); | ||
217 | to_remove.clear(); | ||
218 | QString rem="<b>"+tr("To remove:")+"</b><br>\n"; | ||
219 | QString inst="<b>"+tr("To install:")+"</b><br>\n"; | ||
220 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 215 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) |
221 | { | 216 | { |
222 | if ( pack && (pack->name() != "") && pack) | 217 | if ( pack && (pack->name() != "") && pack) |
223 | { | 218 | { |
224 | if ( pack->toInstall() ) | 219 | if ( pack->toInstall() ) |
225 | { | ||
226 | to_install.append( pack ); | 220 | to_install.append( pack ); |
227 | sizecount += pack->size().toInt(); | 221 | if ( pack->toRemove() ) |
228 | inst += pack->name()+"\t("+tr("on ")+pack->dest()+")<br>"; | ||
229 | } | ||
230 | if ( pack->toRemove() ) | ||
231 | { | ||
232 | to_remove.append( pack ); | 222 | to_remove.append( pack ); |
233 | sizecount += 1; | 223 | } |
234 | rem += pack->name()+"<br>"; | 224 | } |
235 | } | 225 | } |
236 | } | ||
237 | } | ||
238 | 226 | ||
227 | void PmIpkg::commit( PackageList pl ) | ||
228 | { | ||
229 | sizecount = 0; | ||
230 | QString rem="<b>"+tr("To remove:")+"</b><br>\n"; | ||
231 | QString inst="<b>"+tr("To install:")+"</b><br>\n"; | ||
232 | loadList(pl); | ||
233 | for (uint i=0; i < to_remove.count(); i++) | ||
234 | sizecount += 1; | ||
235 | for (uint i=0; i < to_install.count(); i++) | ||
236 | sizecount += to_install.at(i)->size().toInt(); | ||
239 | startDialog(); | 237 | startDialog(); |
240 | |||
241 | } | 238 | } |
242 | 239 | ||
243 | void PmIpkg::startDialog() | 240 | void PmIpkg::startDialog() |
@@ -266,7 +263,7 @@ void PmIpkg::startDialog() | |||
266 | } | 263 | } |
267 | 264 | ||
268 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); | 265 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); |
269 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().hasHeightForWidth() ) ); | 266 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) ); |
270 | GroupBox1->setTitle( tr( "Ipkg options" ) ); | 267 | GroupBox1->setTitle( tr( "Ipkg options" ) ); |
271 | GroupBox1->setColumnLayout(0, Qt::Vertical ); | 268 | GroupBox1->setColumnLayout(0, Qt::Vertical ); |
272 | GroupBox1->layout()->setSpacing( 0 ); | 269 | GroupBox1->layout()->setSpacing( 0 ); |
@@ -275,10 +272,10 @@ void PmIpkg::startDialog() | |||
275 | GroupBox1Layout->setAlignment( Qt::AlignTop ); | 272 | GroupBox1Layout->setAlignment( Qt::AlignTop ); |
276 | GroupBox1Layout->setSpacing( 3 ); | 273 | GroupBox1Layout->setSpacing( 3 ); |
277 | GroupBox1Layout->setMargin( 3 ); | 274 | GroupBox1Layout->setMargin( 3 ); |
278 | |||
279 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); | 275 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); |
280 | _force_depends->setText( tr( "-force-depends" ) ); | 276 | _force_depends->setText( tr( "-force-depends" ) ); |
281 | _force_depends->setAutoResize( TRUE ); | 277 | _force_depends->setAutoResize( TRUE ); |
278 | _force_depends->setChecked(true); | ||
282 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); | 279 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); |
283 | _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" ); | 280 | _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" ); |
284 | _force_reinstall->setText( tr( "-force-reinstall" ) ); | 281 | _force_reinstall->setText( tr( "-force-reinstall" ) ); |
@@ -319,8 +316,8 @@ void PmIpkg::remove() | |||
319 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); | 316 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); |
320 | 317 | ||
321 | QStringList *fileList; | 318 | QStringList *fileList; |
322 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 319 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) |
323 | { | 320 | { |
324 | if ( it->link() )fileList = getList( it->name(), it->dest() ); | 321 | if ( it->link() )fileList = getList( it->name(), it->dest() ); |
325 | if ( runIpkg("remove " + it->name()) == 0) | 322 | if ( runIpkg("remove " + it->name()) == 0) |
326 | { | 323 | { |
@@ -333,6 +330,7 @@ void PmIpkg::remove() | |||
333 | processFileList( fileList, it->dest() ); | 330 | processFileList( fileList, it->dest() ); |
334 | } | 331 | } |
335 | it->processed(); | 332 | it->processed(); |
333 | |||
336 | out("<br><hr>"); | 334 | out("<br><hr>"); |
337 | }else{ | 335 | }else{ |
338 | out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); | 336 | out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); |
@@ -351,7 +349,7 @@ void PmIpkg::install() | |||
351 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | 349 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) |
352 | { | 350 | { |
353 | 351 | ||
354 | if ( runIpkg("install " + it->getPackageName(), it->dest() ) == 0 ) | 352 | if ( runIpkg("install " + it->installName(), it->dest() ) == 0 ) |
355 | { | 353 | { |
356 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); | 354 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); |
357 | linkOpp = createLink; | 355 | linkOpp = createLink; |