aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2016-12-14 21:54:31 +0000
committerWeblate <noreply@weblate.org>2016-12-14 21:54:31 +0000
commitb965af1625a4296f8ff6d3a1663cae23b73d334f (patch)
tree459685dd1da8c75f67772762aa062d80dfc148f0 /src-qt5/desktop-utils/lumina-archiver/TarBackend.h
parentTranslated using Weblate (lumina_DESKTOP@fr (generated)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-b965af1625a4296f8ff6d3a1663cae23b73d334f.tar.gz
lumina-b965af1625a4296f8ff6d3a1663cae23b73d334f.tar.bz2
lumina-b965af1625a4296f8ff6d3a1663cae23b73d334f.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/desktop-utils/lumina-archiver/TarBackend.h')
-rw-r--r--src-qt5/desktop-utils/lumina-archiver/TarBackend.h68
1 files changed, 68 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..ac2cb61f
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h
@@ -0,0 +1,68 @@
+//===========================================
+// 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);
+ bool isLink(QString file);
+ QString linkTo(QString file);
+
+ //Modification routines
+ void startAdd(QStringList paths);
+ void startRemove(QStringList paths);
+ void startExtract(QString path, bool overwrite, QString file=""); //path to dir, overwrite, optional file to extract (everything otherwise)
+ void startExtract(QString path, bool overwrite, QStringList files);
+
+ void startViewFile(QString path);
+
+ //Special process
+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(bool, QString); //success, text
+};
+
+#endif
bgstack15