Maybe a plain QTimer is enough.
This commit is contained in:
parent
cd8b7619d0
commit
d635709833
@ -49,8 +49,7 @@
|
||||
#include <QStandardItemModel>
|
||||
#include <QDir>
|
||||
#include <QProcess>
|
||||
#include <QFutureWatcher>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
#include <QTimer>
|
||||
|
||||
static bool
|
||||
hasRootPartition( Device* device )
|
||||
@ -532,12 +531,11 @@ PartitionCoreModule::revertDevice( Device* dev )
|
||||
void
|
||||
PartitionCoreModule::asyncRevertDevice( Device* dev, std::function< void() > callback )
|
||||
{
|
||||
QFutureWatcher< void > watcher;
|
||||
connect( &watcher, &QFutureWatcher< void >::finished,
|
||||
callback );
|
||||
|
||||
QFuture< void > future = QtConcurrent::run( this, &PartitionCoreModule::revertDevice, dev );
|
||||
watcher.setFuture( future );
|
||||
QTimer::singleShot( 0, this, [=]
|
||||
{
|
||||
revertDevice( dev );
|
||||
QTimer::singleShot( 0, callback );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user