diff options
author | Ken Moore <ken@ixsystems.com> | 2016-11-12 14:33:38 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-11-12 14:33:38 -0500 |
commit | 877625d070f47cddfb8283351f373879deeda98b (patch) | |
tree | 1208a276b944f2502f96ac59d0da6dec305d9c14 /src-qt5/desktop-utils/lumina-archiver/TarBackend.h | |
parent | Speed up the initial loading of the desktop at start, and delay the auto-star... (diff) | |
download | lumina-877625d070f47cddfb8283351f373879deeda98b.tar.gz lumina-877625d070f47cddfb8283351f373879deeda98b.tar.bz2 lumina-877625d070f47cddfb8283351f373879deeda98b.zip |
New Desktop Utility: lumina-archiver
This is a pure Qt5 front-end to the "tar" utility for creating, viewing, and editing archives of various formats.
ChangeLog=YES
Diffstat (limited to 'src-qt5/desktop-utils/lumina-archiver/TarBackend.h')
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/TarBackend.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h new file mode 100644 index 00000000..11c61319 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h @@ -0,0 +1,62 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2016, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#ifndef _LUMINA_ARCHIVER_TAR_BACKEND_H +#define _LUMINA_ARCHIVER_TAR_BACKEND_H + +#include <QProcess> +#include <QString> +#include <QStringList> + +class Backend : public QObject{ + Q_OBJECT +public: + Backend(QObject *parent = 0); + ~Backend(); + + void loadFile(QString path); + bool canModify(); //run on the current file + + //Listing routines + QString currentFile(); + bool isWorking(); //is this currently still making changes? + + //Contents listing + QStringList heirarchy(); //returns all the file paths within the archive + double size(QString file); + double csize(QString file); + bool isDir(QString file); + + //Modification routines + void startAdd(QStringList paths); + void startRemove(QStringList paths); + void startExtract(QString path, bool overwrite); //path to dir + +public slots: + +private: + QProcess PROC; + + QString filepath, tmpfilepath; + QStringList flags; + QHash<QString, QStringList> contents; //<filepath, [attributes, size, compressed size] + + bool LIST, STARTING; + void parseLines(QStringList lines); + +private slots: + void startList(); + void procFinished(int retcode, QProcess::ExitStatus); + void processData(); + +signals: + void FileLoaded(); + void ProcessStarting(); + void ProgressUpdate(int, QString); //percentage, text + void ProcessFinished(); +}; + +#endif |