mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Remove Q_OBJECT dependency from ApiWrap.
Also remove it from SingleDelayedCall -> SingleQueuedInvocation.
This commit is contained in:
@@ -29,6 +29,15 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
namespace Storage {
|
||||
|
||||
Downloader::Downloader()
|
||||
: _delayedLoadersDestroyer([this] { _delayedDestroyedLoaders.clear(); }) {
|
||||
}
|
||||
|
||||
void Downloader::delayedDestroyLoader(std::unique_ptr<FileLoader> loader) {
|
||||
_delayedDestroyedLoaders.push_back(std::move(loader));
|
||||
_delayedLoadersDestroyer.call();
|
||||
}
|
||||
|
||||
void Downloader::clearPriorities() {
|
||||
++_priority;
|
||||
}
|
||||
|
@@ -27,11 +27,15 @@ namespace Storage {
|
||||
|
||||
class Downloader final {
|
||||
public:
|
||||
Downloader();
|
||||
|
||||
int currentPriority() const {
|
||||
return _priority;
|
||||
}
|
||||
void clearPriorities();
|
||||
|
||||
void delayedDestroyLoader(std::unique_ptr<FileLoader> loader);
|
||||
|
||||
base::Observable<void> &taskFinished() {
|
||||
return _taskFinishedObservable;
|
||||
}
|
||||
@@ -40,6 +44,9 @@ private:
|
||||
base::Observable<void> _taskFinishedObservable;
|
||||
int _priority = 1;
|
||||
|
||||
SingleQueuedInvokation _delayedLoadersDestroyer;
|
||||
std::vector<std::unique_ptr<FileLoader>> _delayedDestroyedLoaders;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Storage
|
||||
|
Reference in New Issue
Block a user