source: src-qt4/pc-softwaremanager/pbiDBAccess.h @ 4be3e27

releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 4be3e27 was 4be3e27, checked in by Ken Moore <ken@…>, 7 months ago

Add the mime detection to the AppCafe? backend

  • Property mode set to 100644
File size: 2.1 KB
Line 
1#ifndef _APPCAFE_PBI_DATABASE_ACCESS_H
2#define _APPCAFE_PBI_DATABASE_ACCESS_H
3
4#include <QString>
5#include <QStringList>
6#include <QDir>
7#include <QFile>
8#include <QFileInfo>
9#include <QTextStream>
10#include <QDebug>
11#include <QProcess>
12#include <QProcessEnvironment>
13#include <QDateTime>
14
15#include "extras.h"
16
17class PBIDBAccess{
18public:
19
20        PBIDBAccess(){
21          DBDir = new QDir();
22          proc = new QProcess;
23          proc->setProcessEnvironment( QProcessEnvironment::systemEnvironment() );
24          proc->setProcessChannelMode(QProcess::MergedChannels);
25        }
26        ~PBIDBAccess(){}
27        bool setDBPath(QString); //must be set before anything else!!
28        void setRootCMDPrefix(QString); //required to run any of the DB modification functions
29        //Repository Management
30        bool setRepo(QString repoNum);
31        bool currentRepoInvalid();
32        QString currentRepo(){ return currentRepoNumber; }
33        void reloadRepoList();
34        QStringList availableRepos(); //returns list of repoNumbers
35        QStringList repoInfo(QString repoNum);
36        QStringList repoMirrors(QString repoNum);
37        //Main access functions
38        QStringList installed(); // return list of ID strings for installed PBI's
39        QStringList installedPbiInfo(QString pbiID);
40        bool installedPbiNeedsRoot(QString pbiID);
41        bool installedPbiAutoUpdate(QString pbiID);
42        bool installedPbiHasXdgDesktop(QString installPath);
43        bool installedPbiHasXdgMenu(QString installPath);
44        bool installedPbiHasXdgMime(QString installPath);
45        QString indexFilePath();
46        QString metaFilePath();
47        QStringList parseIndexLine(QString line);
48        QStringList parseAppMetaLine(QString line);
49        QStringList parseCatMetaLine(QString line);
50        QString remoteToLocalIcon(QString name, QString remoteIconPath);
51        // Database Modification functions
52        bool addRepoFile(QString rpofilepath);
53        bool removeRepo(QString repoNum);
54        bool moveRepoUp(QString repoNum);
55        bool moveRepoDown(QString repoNum);
56        bool setRepoMirrors(QString repoNum, QStringList mirrors);
57       
58private:
59        QString currentRepoNumber, currentRepoID, DBPath, cmdPrefix;
60        QStringList repoList;
61        QDir *DBDir;
62        QProcess *proc;
63
64        QString readOneLineFile(QString);
65        QString getIDFromNum(QString);
66        QString runCMD(QString);
67        QString cleanupDescription(QStringList tmp);
68};
69
70#endif
Note: See TracBrowser for help on using the repository browser.