-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more tests, replaced some unnecessary raw pointers with smart p…
…ointers
- Loading branch information
1 parent
e809a1a
commit f2b5f36
Showing
125 changed files
with
2,502 additions
and
1,388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ Item { | |
padding: 0 | ||
|
||
onClosed: { | ||
edit_mode = false | ||
root.edit_mode = false | ||
} | ||
|
||
onAccepted: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
#pragma once | ||
|
||
#include "filecacheentry.h" | ||
#include <QMap> | ||
#include <QObject> | ||
#include <QByteArray> | ||
#include <QHash> | ||
#include <QString> | ||
#include <memory> | ||
|
||
class FileCache : public QObject | ||
class FileCache | ||
{ | ||
Q_OBJECT | ||
public: | ||
using QObject::QObject; | ||
explicit FileCache(int expirationTimeMs = DEFAULT_EXPIRATION_TIME_MS); | ||
|
||
bool tryGetData(const QString &path, QByteArray &data); | ||
bool createOrUpdateEntry(const QString &path, const QByteArray &data); | ||
bool removeEntry(const QString &path); | ||
bool moveEntry(const QString &oldPath, const QString &newPath); | ||
bool copyEntry(const QString &path, const QString ©); | ||
bool checkEntry(const QString &path); | ||
auto tryGetData(const QString &path, QByteArray &data) -> bool; | ||
auto createOrUpdateEntry(const QString &path, const QByteArray &data) -> bool; | ||
auto removeEntry(const QString &path) -> bool; | ||
auto moveEntry(const QString &oldPath, const QString &newPath) -> bool; | ||
auto copyEntry(const QString &path, const QString ©) -> bool; | ||
auto checkEntry(const QString &path) -> bool; | ||
|
||
void printEntries() const; | ||
|
||
private: | ||
QMap<QString, FileCacheEntry *> m_entries; | ||
QHash<QString, std::shared_ptr<FileCacheEntry>> m_entries; | ||
int m_expirationTimeMs; | ||
|
||
static constexpr int DEFAULT_EXPIRATION_TIME_MS = 30000; | ||
}; |
Oops, something went wrong.