Changeset View
Changeset View
Standalone View
Standalone View
krusader/Archive/krarchandler.cpp
Show First 20 Lines • Show All 325 Lines • ▼ Show 20 Line(s) | 235 | { | |||
---|---|---|---|---|---|
326 | if (type == "ace" && QFile("/dev/ptmx").exists()) // Don't remove, unace crashes if missing!!! | 326 | if (type == "ace" && QFile("/dev/ptmx").exists()) // Don't remove, unace crashes if missing!!! | ||
327 | proc.setStandardInputFile("/dev/ptmx"); | 327 | proc.setStandardInputFile("/dev/ptmx"); | ||
328 | 328 | | |||
329 | proc.setWorkingDirectory(dest); | 329 | proc.setWorkingDirectory(dest); | ||
330 | 330 | | |||
331 | // tell the user to wait | 331 | // tell the user to wait | ||
332 | observer->subJobStarted(i18n("Unpacking File(s)"), count); | 332 | observer->subJobStarted(i18n("Unpacking File(s)"), count); | ||
333 | if (count != 0) { | 333 | if (count != 0) { | ||
334 | connect(&proc, SIGNAL(newOutputLines(int)), | 334 | connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress); | ||
335 | observer, SLOT(incrementProgress(int))); | | |||
336 | if (type == "rpm") | 335 | if (type == "rpm") | ||
337 | connect(&proc, SIGNAL(newErrorLines(int)), | 336 | connect(&proc, &KrLinecountingProcess::newErrorLines, observer, &KRarcObserver::incrementProgress); | ||
338 | observer, SLOT(incrementProgress(int))); | | |||
339 | } | 337 | } | ||
340 | 338 | | |||
341 | // start the unpacking process | 339 | // start the unpacking process | ||
342 | proc.start(); | 340 | proc.start(); | ||
343 | // TODO make use of asynchronous process starting. waitForStarted(int msec = 30000) is blocking | 341 | // TODO make use of asynchronous process starting. waitForStarted(int msec = 30000) is blocking | ||
344 | // it would be better to connect to started(), error() and finished() | 342 | // it would be better to connect to started(), error() and finished() | ||
345 | if (proc.waitForStarted()) | 343 | if (proc.waitForStarted()) | ||
346 | while (proc.state() == QProcess::Running) { | 344 | while (proc.state() == QProcess::Running) { | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 365 | { | |||
402 | proc << packer << archive; | 400 | proc << packer << archive; | ||
403 | 401 | | |||
404 | if (type == "ace" && QFile("/dev/ptmx").exists()) // Don't remove, unace crashes if missing!!! | 402 | if (type == "ace" && QFile("/dev/ptmx").exists()) // Don't remove, unace crashes if missing!!! | ||
405 | proc.setStandardInputFile("/dev/ptmx"); | 403 | proc.setStandardInputFile("/dev/ptmx"); | ||
406 | 404 | | |||
407 | // tell the user to wait | 405 | // tell the user to wait | ||
408 | observer->subJobStarted(i18n("Testing Archive"), count); | 406 | observer->subJobStarted(i18n("Testing Archive"), count); | ||
409 | if (count != 0) | 407 | if (count != 0) | ||
410 | connect(&proc, SIGNAL(newOutputLines(int)), | 408 | connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress); | ||
411 | observer, SLOT(incrementProgress(int))); | | |||
412 | 409 | | |||
413 | // start the unpacking process | 410 | // start the unpacking process | ||
414 | proc.start(); | 411 | proc.start(); | ||
415 | // TODO make use of asynchronous process starting. waitForStarted(int msec = 30000) is blocking | 412 | // TODO make use of asynchronous process starting. waitForStarted(int msec = 30000) is blocking | ||
416 | // it would be better to connect to started(), error() and finished() | 413 | // it would be better to connect to started(), error() and finished() | ||
417 | if (proc.waitForStarted()) | 414 | if (proc.waitForStarted()) | ||
418 | while (proc.state() == QProcess::Running) { | 415 | while (proc.state() == QProcess::Running) { | ||
419 | observer->processEvents(); | 416 | observer->processEvents(); | ||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 431 | { | |||
530 | 527 | | |||
531 | for (QStringList::Iterator file = fileNames.begin(); file != fileNames.end(); ++file) { | 528 | for (QStringList::Iterator file = fileNames.begin(); file != fileNames.end(); ++file) { | ||
532 | proc << *file; | 529 | proc << *file; | ||
533 | } | 530 | } | ||
534 | 531 | | |||
535 | // tell the user to wait | 532 | // tell the user to wait | ||
536 | observer->subJobStarted(i18n("Packing File(s)"), count); | 533 | observer->subJobStarted(i18n("Packing File(s)"), count); | ||
537 | if (count != 0) | 534 | if (count != 0) | ||
538 | connect(&proc, SIGNAL(newOutputLines(int)), | 535 | connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress); | ||
539 | observer, SLOT(incrementProgress(int))); | | |||
540 | 536 | | |||
541 | // start the packing process | 537 | // start the packing process | ||
542 | proc.start(); | 538 | proc.start(); | ||
543 | // TODO make use of asynchronous process starting. waitForStarted(int msec = 30000) is blocking | 539 | // TODO make use of asynchronous process starting. waitForStarted(int msec = 30000) is blocking | ||
544 | // it would be better to connect to started(), error() and finished() | 540 | // it would be better to connect to started(), error() and finished() | ||
545 | if (proc.waitForStarted()) | 541 | if (proc.waitForStarted()) | ||
546 | while (proc.state() == QProcess::Running) { | 542 | while (proc.state() == QProcess::Running) { | ||
547 | observer->processEvents(); | 543 | observer->processEvents(); | ||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |