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