2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Remove Q_OBJECT dependency from ApiWrap.

Also remove it from SingleDelayedCall -> SingleQueuedInvocation.
This commit is contained in:
John Preston
2017-04-06 19:49:42 +03:00
parent 5444b8166c
commit 835b1801bc
25 changed files with 136 additions and 152 deletions

View File

@@ -1535,7 +1535,7 @@ bool DocumentData::loaded(FilePathResolveType type) const {
void DocumentData::destroyLoaderDelayed(mtpFileLoader *newValue) const {
_loader->stop();
auto loader = std::unique_ptr<FileLoader>(std::exchange(_loader, newValue));
Messenger::Instance().delayedDestroyLoader(std::move(loader));
AuthSession::Current().downloader().delayedDestroyLoader(std::move(loader));
}
bool DocumentData::loading() const {
@@ -1620,10 +1620,10 @@ void DocumentData::save(const QString &toFile, ActionOnLoad action, const FullMs
void DocumentData::cancel() {
if (!loading()) return;
auto loader = std::exchange(_loader, CancelledMtpFileLoader);
auto loader = std::unique_ptr<FileLoader>(std::exchange(_loader, CancelledMtpFileLoader));
loader->cancel();
loader->stop();
Messenger::Instance().delayedDestroyLoader(std::unique_ptr<FileLoader>(loader));
AuthSession::Current().downloader().delayedDestroyLoader(std::move(loader));
notifyLayoutChanged();
if (auto main = App::main()) {