Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 6ef6d19..0401a5b 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -223,98 +223,100 @@ void PmIpkg::commit() | |||
223 | for (uint i=0; i < to_remove.count(); i++) | 223 | for (uint i=0; i < to_remove.count(); i++) |
224 | { | 224 | { |
225 | sizecount += 1; | 225 | sizecount += 1; |
226 | installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); | 226 | installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); |
227 | } | 227 | } |
228 | for (uint i=0; i < to_install.count(); i++) | 228 | for (uint i=0; i < to_install.count(); i++) |
229 | { | 229 | { |
230 | sizecount += to_install.at(i)->size().toInt(); | 230 | sizecount += to_install.at(i)->size().toInt(); |
231 | installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); | 231 | installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); |
232 | } | 232 | } |
233 | runwindow->progress->setTotalSteps(sizecount); | 233 | runwindow->progress->setTotalSteps(sizecount); |
234 | qDebug("Install size %i",sizecount); | 234 | qDebug("Install size %i",sizecount); |
235 | installDialog->showMaximized(); | 235 | installDialog->showMaximized(); |
236 | installDialog->show(); | 236 | installDialog->show(); |
237 | if ( installDialog->exec() ) | 237 | if ( installDialog->exec() ) |
238 | { | 238 | { |
239 | doIt(); | 239 | doIt(); |
240 | runwindow->showMaximized(); | 240 | runwindow->showMaximized(); |
241 | runwindow->show(); | 241 | runwindow->show(); |
242 | } | 242 | } |
243 | installDialog->close(); | 243 | installDialog->close(); |
244 | out(tr("\nAll done.")); | 244 | out(tr("\nAll done.")); |
245 | } | 245 | } |
246 | 246 | ||
247 | void PmIpkg::doIt() | 247 | void PmIpkg::doIt() |
248 | { | 248 | { |
249 | runwindow->progress->setProgress(0); | 249 | runwindow->progress->setProgress(0); |
250 | show(); | 250 | show(); |
251 | remove(); | 251 | remove(); |
252 | install(); | 252 | install(); |
253 | } | 253 | } |
254 | 254 | ||
255 | 255 | ||
256 | void PmIpkg::remove() | 256 | void PmIpkg::remove() |
257 | { | 257 | { |
258 | if ( to_remove.count() == 0 ) return; | 258 | if ( to_remove.count() == 0 ) return; |
259 | 259 | ||
260 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); | 260 | out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); |
261 | 261 | ||
262 | QStringList *fileList; | 262 | QStringList *fileList; |
263 | for (uint i=0; i < to_remove.count(); i++) | 263 | for (uint i=0; i < to_remove.count(); i++) |
264 | { | 264 | { |
265 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); | 265 | if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); |
266 | if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) | 266 | if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) |
267 | { | 267 | { |
268 | runwindow->progress->setProgress( 1 ); | 268 | runwindow->progress->setProgress( 1 ); |
269 | linkOpp = removeLink; | 269 | linkOpp = removeLink; |
270 | to_remove.at(i)->processed(); | 270 | to_remove.at(i)->processed(); |
271 | pvDebug(4,"link "+QString::number(i)); | ||
271 | if ( to_remove.at(i)->link() ) | 272 | if ( to_remove.at(i)->link() ) |
272 | processFileList( fileList, to_remove.at(i)->dest() ); | 273 | processFileList( fileList, to_remove.at(i)->dest() ); |
274 | pvDebug(4,"take "+QString::number(i)); | ||
273 | to_remove.take( i ); | 275 | to_remove.take( i ); |
274 | 276 | ||
275 | out("\n"); | 277 | out("\n"); |
276 | }else{ | 278 | }else{ |
277 | out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); | 279 | out(tr("Error while removing")+to_remove.at(i)->name()+"\n"); |
278 | if ( to_remove.at(i)->link() ) | 280 | if ( to_remove.at(i)->link() ) |
279 | processFileList( fileList, to_remove.at(i)->dest() ); | 281 | processFileList( fileList, to_remove.at(i)->dest() ); |
280 | } | 282 | } |
281 | if ( to_remove.at(i)->link() ) | 283 | if ( to_remove.at(i)->link() ) |
282 | processFileList( fileList, to_remove.at(i)->dest() ); | 284 | processFileList( fileList, to_remove.at(i)->dest() ); |
283 | if ( to_remove.at(i)->link() )delete fileList; | 285 | if ( to_remove.at(i)->link() )delete fileList; |
284 | } | 286 | } |
285 | to_remove.clear(); | 287 | to_remove.clear(); |
286 | out("\n"); | 288 | out("\n"); |
287 | } | 289 | } |
288 | 290 | ||
289 | 291 | ||
290 | void PmIpkg::install() | 292 | void PmIpkg::install() |
291 | { | 293 | { |
292 | if ( to_install.count() == 0 ) return; | 294 | if ( to_install.count() == 0 ) return; |
293 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); | 295 | out(tr("Installing")+"\n"+tr("please wait")+"\n"); |
294 | for (uint i=0; i < to_install.count(); i++) | 296 | for (uint i=0; i < to_install.count(); i++) |
295 | { | 297 | { |
296 | qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug | 298 | qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug |
297 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) | 299 | if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) |
298 | { | 300 | { |
299 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); | 301 | runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); |
300 | to_install.at(i)->processed(); | 302 | to_install.at(i)->processed(); |
301 | linkOpp = createLink; | 303 | linkOpp = createLink; |
302 | if ( to_install.at(i)->link() ) | 304 | if ( to_install.at(i)->link() ) |
303 | makeLinks( to_install.at(i) ); | 305 | makeLinks( to_install.at(i) ); |
304 | to_install.take( i ); | 306 | to_install.take( i ); |
305 | out("\n"); | 307 | out("\n"); |
306 | }else{ | 308 | }else{ |
307 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); | 309 | out(tr("Error while installing")+to_install.at(i)->name()+"\n"); |
308 | linkOpp = createLink; | 310 | linkOpp = createLink; |
309 | if ( to_install.at(i)->link() ) | 311 | if ( to_install.at(i)->link() ) |
310 | makeLinks( to_install.at(i) ); | 312 | makeLinks( to_install.at(i) ); |
311 | } | 313 | } |
312 | } | 314 | } |
313 | out("\n"); | 315 | out("\n"); |
314 | to_install.clear(); | 316 | to_install.clear(); |
315 | } | 317 | } |
316 | 318 | ||
317 | void PmIpkg::createLinks( const QString &dest ) | 319 | void PmIpkg::createLinks( const QString &dest ) |
318 | { | 320 | { |
319 | pvDebug(2,"PmIpkg::createLinks "+dest); | 321 | pvDebug(2,"PmIpkg::createLinks "+dest); |
320 | linkOpp=createLink; | 322 | linkOpp=createLink; |