qTbot
0.89.ee6949a
qTbot is base back end library for your c++ Qt projects.
filewaiter.cpp
Go to the documentation of this file.
1
//#
2
//# Copyright (C) 2023-2024 QuasarApp.
3
//# Distributed under the GPLv3 software license, see the accompanying
4
//# Everyone is permitted to copy and distribute verbatim copies
5
//# of this license document, but changing it is not allowed.
6
//#
7
#include "
filewaiter.h
"
8
namespace
qTbot
{
9
10
FileWaiter::FileWaiter
()
11
{
12
13
}
14
15
void
FileWaiter::wait
(
const
QSharedPointer<iFile> &file) {
16
if
(!file->isFinished()) {
17
auto
address =
reinterpret_cast<
size_t
>
(file.get());
18
19
_files[address] = file;
20
21
22
connect(file.get(), &
qTbot::iFile::finishedChanged
,
this
, &FileWaiter::handleFileFinished,
23
Qt::QueuedConnection);
24
}
25
}
26
27
void
FileWaiter::handleFileFinished() {
28
auto
address =
reinterpret_cast<
size_t
>
(sender());
29
30
_files.remove(address);
31
32
}
33
34
}
qTbot::FileWaiter::FileWaiter
FileWaiter()
Definition
filewaiter.cpp:10
qTbot::FileWaiter::wait
void wait(const QSharedPointer< iFile > &file)
wait This method add shared pointer of file in to local storage, and remove it from this when file ch...
Definition
filewaiter.cpp:15
qTbot::iFile::finishedChanged
void finishedChanged()
Signal emitted when the associated finished changes.
filewaiter.h
qTbot
Definition
telegramdeletemessage.cpp:8
src
qTbot
src
public
qTbot
filewaiter.cpp
Generated by
1.9.8