-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcache.h
73 lines (64 loc) · 2.69 KB
/
cache.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
/****************************************************************************
* Copyright (c) 2007-2008 Vlad Codrea *
* Copyright (c) 2015 Thomas Fischer *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License. *
* *
****************************************************************************/
#ifndef CACHE_H
#define CACHE_H
#include <QString>
#include <QList>
#include <QMutex>
#include <kurl.h>
#include <kio/filejob.h>
#include <kfileitem.h>
class FileJobData
{
public:
FileJobData(KIO::FileJob* aFileJob);
~FileJobData();
KIO::FileJob* fileJob;
QTime qTime;
//bool inUse;
QMutex jobMutex;
bool jobIsAnnulled;
};
/*class Cache : public QObject
{
Q_OBJECT
public:
enum NodeType {regularType, innerStubType, leafStubType};
Cache(KFileItem* item);
Cache(const QString& rootOfRelPath, NodeType nodeType);
~Cache();
KFileItem* item() const {return m_item;}
void insert(KFileItem* newItem);
bool setExtraData(const KUrl& url, const uint64_t& key,
KIO::FileJob* fileJob);
bool releaseJob(const uint64_t& fileHandleId);
Cache* find(const KUrl &url);
QMap<uint64_t, FileJobData*> jobsMap() const {return fhIdtoFileJob;}
void removeExpired();
bool cachedChildren;
QTime* lastUpdated;
private:
int findIdxOfChildFromFileName(const QString& fileName);
int setItem(KFileItem* newItem);
QString stripBegSlashes(const QString& path);
KFileItem* m_item;
QList<Cache*> children;
NodeType m_nodeType;
QMap<uint64_t, FileJobData*> fhIdtoFileJob;
};*/
#endif /* CACHE_H */