Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 6e15ed4

Browse files
procountXECDesign
authored andcommitted
Account for IOaccounting on multiDrives (#462)
Fixes #459
1 parent d8a9752 commit 6e15ed4

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

recovery/mainwindow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,7 @@ void MainWindow::startImageWrite()
15831583
connect(imageWriteThread, SIGNAL(statusUpdate(QString)), _qpd, SLOT(setLabelText(QString)));
15841584
connect(imageWriteThread, SIGNAL(runningMKFS()), _qpd, SLOT(pauseIOaccounting()), Qt::BlockingQueuedConnection);
15851585
connect(imageWriteThread, SIGNAL(finishedMKFS()), _qpd , SLOT(resumeIOaccounting()), Qt::BlockingQueuedConnection);
1586+
connect(imageWriteThread, SIGNAL(newDrive(const QString&)), _qpd , SLOT(changeDrive(const QString&)), Qt::BlockingQueuedConnection);
15861587
imageWriteThread->start();
15871588
hide();
15881589
_qpd->exec();

recovery/multiimagewritethread.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ bool MultiImageWriteThread::processImage(OsInfo *image)
459459
}
460460

461461
QByteArray partdevice = p->partitionDevice();
462+
emit newDrive(partdevice);
462463

463464
if (fstype == "raw")
464465
{

recovery/multiimagewritethread.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class MultiImageWriteThread : public QThread
5252
void completed();
5353
void runningMKFS();
5454
void finishedMKFS();
55-
55+
void newDrive(const QString&);
56+
5657
public slots:
5758

5859
};

recovery/progressslideshowdialog.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ void ProgressSlideshowDialog::resumeIOaccounting()
123123
_iotimer.start(1000);
124124
}
125125

126+
void ProgressSlideshowDialog::changeDrive(const QString &drive)
127+
{
128+
pauseIOaccounting();
129+
_drive = drive;
130+
resumeIOaccounting();
131+
}
132+
126133
void ProgressSlideshowDialog::setMaximum(qint64 bytes)
127134
{
128135
_maxSectors = bytes/512;

recovery/progressslideshowdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public slots:
3535
void updateIOstats();
3636
void pauseIOaccounting();
3737
void resumeIOaccounting();
38+
void changeDrive(const QString &drive);
3839

3940
protected:
4041
QString _drive;

0 commit comments

Comments
 (0)