-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
jobremotetest.h
104 lines (82 loc) · 2.56 KB
/
jobremotetest.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
This file is part of the KDE project
SPDX-FileCopyrightText: 2004 David Faure <[email protected]>
SPDX-FileCopyrightText: 2008 Norbert Frese <[email protected]>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
/*
Please set KIO_JOBREMOTETEST_REMOTETMP to test other protocols than kio_file.
Don't forget the trailing slash!
*/
#ifndef JOBREMOTETEST_H
#define JOBREMOTETEST_H
#include <QObject>
#include <QString>
#include <kio/global.h>
#include <kio/udsentry.h>
namespace KIO
{
class Job;
class FileJob;
}
class KJob;
class JobRemoteTest : public QObject
{
Q_OBJECT
public:
JobRemoteTest()
{
}
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
// Remote tests
void putAndGet();
void openFileWriting();
void openFileReading();
void openFileRead0Bytes();
void openFileTruncating();
// void calculateRemainingSeconds();
Q_SIGNALS:
void exitLoop();
protected Q_SLOTS:
// void slotEntries( KIO::Job*, const KIO::UDSEntryList& lst );
void slotGetResult(KJob *);
void slotDataReq(KIO::Job *, QByteArray &);
void slotResult(KJob *);
void slotMimetype(KIO::Job *, const QString &);
void slotFileJobData(KIO::Job *job, const QByteArray &data);
void slotFileJobRedirection(KIO::Job *job, const QUrl &url);
void slotFileJobMimetype(KIO::Job *job, const QString &type);
void slotFileJobOpen(KIO::Job *job);
void slotFileJobWritten(KIO::Job *job, KIO::filesize_t written);
void slotFileJobPosition(KIO::Job *job, KIO::filesize_t offset);
void slotFileJobClose(KIO::Job *job);
void slotFileJob2Data(KIO::Job *job, const QByteArray &data);
void slotFileJob2Redirection(KIO::Job *job, const QUrl &url);
void slotFileJob2Mimetype(KIO::Job *job, const QString &type);
void slotFileJob2Open(KIO::Job *job);
void slotFileJob2Written(KIO::Job *job, KIO::filesize_t written);
void slotFileJob2Position(KIO::Job *job, KIO::filesize_t offset);
void slotFileJob3Open(KIO::Job *job);
void slotFileJob3Position(KIO::Job *job, KIO::filesize_t offset);
void slotFileJob3Data(KIO::Job *job, const QByteArray &data);
void slotFileJob4Open(KIO::Job *job);
void slotFileJob4Truncated(KIO::Job *job, KIO::filesize_t length);
private:
void enterLoop();
enum {
AlreadyExists = 1
};
int m_result;
bool m_closeSignalCalled;
QFile m_truncatedFile;
QByteArray m_data;
QStringList m_names;
int m_dataReqCount;
QString m_mimetype;
// openReadWrite test
KIO::FileJob *fileJob;
int m_rwCount;
};
#endif