Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7889336
kazv-io.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
997 B
Referenced Files
None
Subscribers
None
kazv-io.hpp
View Options
#include
<QObject>
#include
<QUrl>
#include
<KIO/Job>
#include
<QtQml>
#include
<KIO/TransferJob>
#include
<QPointer>
#include
<QSaveFile>
#include
<QByteArray>
class
KazvIO
:
public
QObject
{
Q_OBJECT
QML_ELEMENT
// Progress in decimal form, from 0 to 1
Q_PROPERTY
(
float
progress
READ
progress
NOTIFY
progressChanged
)
Q_PROPERTY
(
QUrl
fileUrl
READ
fileUrl
WRITE
setFileUrl
NOTIFY
fileUrlChanged
)
public
:
KazvIO
();
Q_INVOKABLE
void
download
(
QUrl
url
);
Q_INVOKABLE
void
suspend
();
Q_INVOKABLE
void
resume
();
Q_INVOKABLE
void
cancel
();
float
progress
();
QUrl
fileUrl
();
void
setFileUrl
(
QUrl
fileUrl
);
signals
:
void
progressChanged
();
void
fileUrlChanged
();
void
result
();
private
:
QPointer
<
KIO
::
TransferJob
>
m_job
;
float
m_progress
=
0
;
QUrl
m_fileUrl
;
QSaveFile
m_file
;
void
updatePercent
(
KJob
*
job
,
unsigned
long
percent
);
void
write
(
KJob
*
job
,
const
QByteArray
&
data
);
void
emitResult
(
KJob
*
job
);
};
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Thu, Oct 2, 2:28 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
486943
Default Alt Text
kazv-io.hpp (997 B)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment