From 5260d9701ab34e4d53c2d26cd4a6f197f1d255f7 Mon Sep 17 00:00:00 2001 From: procount Date: Thu, 23 Nov 2017 23:10:21 +0000 Subject: [PATCH] Account for IOaccounting on multiDrives --- recovery/mainwindow.cpp | 1 + recovery/multiimagewritethread.cpp | 1 + recovery/multiimagewritethread.h | 3 ++- recovery/progressslideshowdialog.cpp | 7 +++++++ recovery/progressslideshowdialog.h | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/recovery/mainwindow.cpp b/recovery/mainwindow.cpp index a2d24242..81d18703 100644 --- a/recovery/mainwindow.cpp +++ b/recovery/mainwindow.cpp @@ -1583,6 +1583,7 @@ void MainWindow::startImageWrite() connect(imageWriteThread, SIGNAL(statusUpdate(QString)), _qpd, SLOT(setLabelText(QString))); connect(imageWriteThread, SIGNAL(runningMKFS()), _qpd, SLOT(pauseIOaccounting()), Qt::BlockingQueuedConnection); connect(imageWriteThread, SIGNAL(finishedMKFS()), _qpd , SLOT(resumeIOaccounting()), Qt::BlockingQueuedConnection); + connect(imageWriteThread, SIGNAL(newDrive(const QString&)), _qpd , SLOT(changeDrive(const QString&)), Qt::BlockingQueuedConnection); imageWriteThread->start(); hide(); _qpd->exec(); diff --git a/recovery/multiimagewritethread.cpp b/recovery/multiimagewritethread.cpp index 889df21f..811c437a 100644 --- a/recovery/multiimagewritethread.cpp +++ b/recovery/multiimagewritethread.cpp @@ -465,6 +465,7 @@ bool MultiImageWriteThread::processImage(OsInfo *image) } } QByteArray partdevice = p->partitionDevice(); + emit newDrive(partdevice); if (fstype == "raw") { diff --git a/recovery/multiimagewritethread.h b/recovery/multiimagewritethread.h index 82c117b0..0960a492 100644 --- a/recovery/multiimagewritethread.h +++ b/recovery/multiimagewritethread.h @@ -50,7 +50,8 @@ class MultiImageWriteThread : public QThread void completed(); void runningMKFS(); void finishedMKFS(); - + void newDrive(const QString&); + public slots: }; diff --git a/recovery/progressslideshowdialog.cpp b/recovery/progressslideshowdialog.cpp index 9a98f532..4ec52824 100644 --- a/recovery/progressslideshowdialog.cpp +++ b/recovery/progressslideshowdialog.cpp @@ -123,6 +123,13 @@ void ProgressSlideshowDialog::resumeIOaccounting() _iotimer.start(1000); } +void ProgressSlideshowDialog::changeDrive(const QString &drive) +{ + pauseIOaccounting(); + _drive = drive; + resumeIOaccounting(); +} + void ProgressSlideshowDialog::setMaximum(qint64 bytes) { _maxSectors = bytes/512; diff --git a/recovery/progressslideshowdialog.h b/recovery/progressslideshowdialog.h index e29333e4..1ef48ccb 100644 --- a/recovery/progressslideshowdialog.h +++ b/recovery/progressslideshowdialog.h @@ -35,6 +35,7 @@ public slots: void updateIOstats(); void pauseIOaccounting(); void resumeIOaccounting(); + void changeDrive(const QString &drive); protected: QString _drive;