mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 13:04:28 -04:00
Implement stop/cancel on LibrariesUpdateCoordinator
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include <QtCore>
|
||||
|
||||
class YACReaderLibraries;
|
||||
class LibraryCreator;
|
||||
|
||||
class LibrariesUpdateCoordinator : public QObject
|
||||
{
|
||||
@ -13,6 +14,7 @@ public:
|
||||
LibrariesUpdateCoordinator(QSettings *settings, YACReaderLibraries &libraries, QObject *parent = 0);
|
||||
|
||||
void updateLibraries();
|
||||
void cancel();
|
||||
|
||||
signals:
|
||||
void updateStarted();
|
||||
@ -29,6 +31,8 @@ private:
|
||||
QTimer *timer;
|
||||
QElapsedTimer elapsedTimer;
|
||||
std::future<void> updateFuture;
|
||||
bool canceled;
|
||||
std::weak_ptr<LibraryCreator> currentLibraryCreator;
|
||||
};
|
||||
|
||||
#endif // LIBRARIES_UPDATE_COORDINATOR_H
|
||||
|
Reference in New Issue
Block a user