mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 01:45:36 -04:00
Back to QFutureWatcher, but we allocate/destroy it ourselves.
This reverts commit c64eef54f6584b26f14933f0c8e600d5ad2dacbb.
This commit is contained in:
parent
496d917d94
commit
fbb293c15a
1 changed files with 10 additions and 4 deletions
|
@ -49,7 +49,8 @@
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QTimer>
|
#include <QFutureWatcher>
|
||||||
|
#include <QtConcurrent/QtConcurrent>
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
hasRootPartition( Device* device )
|
hasRootPartition( Device* device )
|
||||||
|
@ -531,11 +532,16 @@ PartitionCoreModule::revertDevice( Device* dev )
|
||||||
void
|
void
|
||||||
PartitionCoreModule::asyncRevertDevice( Device* dev, std::function< void() > callback )
|
PartitionCoreModule::asyncRevertDevice( Device* dev, std::function< void() > callback )
|
||||||
{
|
{
|
||||||
QTimer::singleShot( 0, this, [=]
|
QFutureWatcher< void >* watcher = new QFutureWatcher< void >();
|
||||||
|
connect( watcher, &QFutureWatcher< void >::finished,
|
||||||
|
this, [ watcher, callback ]
|
||||||
{
|
{
|
||||||
revertDevice( dev );
|
callback();
|
||||||
QTimer::singleShot( 0, callback );
|
watcher->deleteLater();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
QFuture< void > future = QtConcurrent::run( this, &PartitionCoreModule::revertDevice, dev );
|
||||||
|
watcher->setFuture( future );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue