aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Qt/CMakeLists.txt4
-rw-r--r--src/Qt/helper.cpp27
-rw-r--r--src/Qt/helper.h8
-rw-r--r--src/Qt/qportage.cpp51
-rw-r--r--src/Qt/qportage.h40
5 files changed, 47 insertions, 83 deletions
diff --git a/src/Qt/CMakeLists.txt b/src/Qt/CMakeLists.txt
index 1ffc149..ab672ba 100644
--- a/src/Qt/CMakeLists.txt
+++ b/src/Qt/CMakeLists.txt
@@ -2,8 +2,8 @@ find_package(Qt4 REQUIRED)
include_directories(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ..)
remove_definitions(-std=c99)
-set(cpp-portage_SRCS helper.cpp qportage.cpp qportagesettings.cpp qpackageproperties.cpp qlistconverter.cpp)
-set(cpp-portage_HDRS helper.h qportage.h qportagesettings.h qpackageproperties.h qlistconverter.h)
+set(cpp-portage_SRCS qportage.cpp qportagesettings.cpp qpackageproperties.cpp qlistconverter.cpp)
+set(cpp-portage_HDRS qportage.h qportagesettings.h qpackageproperties.h qlistconverter.h)
QT4_WRAP_CPP(cpp-portage_MOC_SRCS ${cpp-portage_HDRS})
diff --git a/src/Qt/helper.cpp b/src/Qt/helper.cpp
deleted file mode 100644
index c745eae..0000000
--- a/src/Qt/helper.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "helper.h"
-
-QStringList CListToQStringList(StringList *clist)
-{
- QStringList list;
-
- for (int i=0; i<stringListCount(clist); i++) {
- list << stringListGetAt(clist, i);
- }
-
- return list;
-}
-
-StringList* QStringListToCList(const QStringList &list)
-{
- StringList *clist;
-
- clist = stringListCreate(list.count());
-
- if (clist) { // Not null
- for (int i=0; i<list.count(); i++) {
- stringListInsertAt(clist, i, list.at(i).toUtf8().data());
- }
- }
-
- return clist;
-}
diff --git a/src/Qt/helper.h b/src/Qt/helper.h
deleted file mode 100644
index 4979ffb..0000000
--- a/src/Qt/helper.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <QStringList>
-
-extern "C" {
-#include <stringlist.h>
-}
-
-QStringList CListToQStringList(StringList *);
-StringList* QStringListToCList(const QStringList&); \ No newline at end of file
diff --git a/src/Qt/qportage.cpp b/src/Qt/qportage.cpp
index 97359eb..cd9743c 100644
--- a/src/Qt/qportage.cpp
+++ b/src/Qt/qportage.cpp
@@ -18,11 +18,10 @@
*/
-#include "helper.h"
#include "qportage.h"
+#include "qlistconverter.h"
extern "C" {
-#include <stringlist.h>
#include <dataconnect.h>
}
@@ -43,130 +42,130 @@ QString portage::bestVersion(QStringList )
}
-QStringList portage::getAllNodes()
+QStringList portage::allNodes()
{
StringList *clist;
QStringList strlist;
clist = portageGetAllNodes();
- strlist = CListToQStringList(clist);
+ strlist = QListConverter::StringListToQStringList(clist);
stringListFree(clist);
return strlist;
}
-QString portage::getBestEbuild(const QString& )
+QString portage::bestEbuild(const QString& )
{
}
-QString portage::getDepEbuild(const QString& )
+QString portage::depEbuild(const QString& )
{
}
-int portage::getHardMasked(const QString& , QStringList& , QStringList& )
+int portage::hardMasked(const QString& , QStringList& , QStringList& )
{
}
-QStringList portage::getInstalledFiles(const QString &package)
+QStringList portage::installedFiles(const QString &package)
{
StringList *clist;
QStringList strlist;
clist = portageGetInstalledFiles(package.toUtf8().data());
- strlist = CListToQStringList(clist);
+ strlist = QListConverter::StringListToQStringList(clist);
stringListFree(clist);
return strlist;
}
-QStringList portage::getInstalledList()
+QStringList portage::installedList()
{
StringList *clist;
QStringList strlist;
clist = portageGetInstalledList();
- strlist = CListToQStringList(clist);
+ strlist = QListConverter::StringListToQStringList(clist);
stringListFree(clist);
return strlist;
}
-QString portage::getMaskingReason(const QString& )
+QString portage::maskingReason(const QString& )
{
}
-QStringList portage::getMaskingStatus(const QString& )
+QStringList portage::maskingStatus(const QString& )
{
}
-QString portage::getOverlay(const QString& )
+QString portage::overlay(const QString& )
{
}
-QString portage::getOverlayNameFromPath(const QString& )
+QString portage::overlayNameFromPath(const QString& )
{
}
-QString portage::getOverlayNameFromPkg(const QString& )
+QString portage::overlayNameFromPkg(const QString& )
{
}
-long int portage::getPackageSizeInt(const QString& )
+long int portage::packageSizeInt(const QString& )
{
}
-QString portage::getPackageSizeString(const QString& )
+QString portage::packageSizeString(const QString& )
{
}
-QString portage::getPath(const QString &package, int )
+QString portage::path(const QString &package, int )
{
}
-PackageProperties* portage::getProperties(const QString &package)
+PackageProperties* portage::properties(const QString &package)
{
return portageGetProperties(package.toUtf8().data());
}
-QStringList portage::getResolvedPkgs()
+QStringList portage::resolvedPkgs()
{
StringList *clist;
QStringList strlist;
clist = portageGetResolvedPkgs();
- strlist = CListToQStringList(clist);
+ strlist = QListConverter::StringListToQStringList(clist);
stringListFree(clist);
return strlist;
}
-QStringList portage::getUnresolvedPkgs()
+QStringList portage::unresolvedPkgs()
{
StringList *clist;
QStringList strlist;
clist = portageGetUnresolvedPkgs();
- strlist = CListToQStringList(clist);
+ strlist = QListConverter::StringListToQStringList(clist);
stringListFree(clist);
return strlist;
}
-QStringList portage::getVersions(const QString &package, bool include_masked)
+QStringList portage::versions(const QString &package, bool include_masked)
{
StringList *clist = portageGetVersions(package.toUtf8().data(), include_masked);
- QStringList strlist = CListToQStringList(clist);
+ QStringList strlist = QListConverter::StringListToQStringList(clist);
stringListFree(clist);
return strlist;
diff --git a/src/Qt/qportage.h b/src/Qt/qportage.h
index 8cdd7b3..d67558b 100644
--- a/src/Qt/qportage.h
+++ b/src/Qt/qportage.h
@@ -35,30 +35,30 @@ class portage : public QObject
explicit portage(QObject* parent = 0);
virtual ~portage();
- QStringList getVersions(const QString&, bool);
- int getHardMasked(const QString&, QStringList&, QStringList&);
- QStringList getInstalledFiles(const QString&);
+ QStringList versions(const QString&, bool);
+ int hardMasked(const QString&, QStringList&, QStringList&);
+ QStringList installedFiles(const QString&);
- QString bestVersion(QStringList);
- QString getBestEbuild(const QString&);
- QString getDepEbuild(const QString&);
+ QString bestVersion(QStringList);
+ QString bestEbuild(const QString&);
+ QString depEbuild(const QString&);
- QStringList getMaskingStatus(const QString&);
- QString getMaskingReason(const QString&);
+ QStringList maskingStatus(const QString&);
+ QString maskingReason(const QString&);
- long int getPackageSizeInt(const QString&);
- QString getPackageSizeString(const QString&);
- PackageProperties* getProperties(const QString&);
- bool isOverlay(const QString&);
- QString getOverlay(const QString&);
- QString getOverlayNameFromPath(const QString&);
- QString getOverlayNameFromPkg(const QString&);
- QString getPath(const QString&, int);
+ long int packageSizeInt(const QString&);
+ QString packageSizeString(const QString&);
+ PackageProperties* properties(const QString&);
+ bool isOverlay(const QString&);
+ QString overlay(const QString&);
+ QString overlayNameFromPath(const QString&);
+ QString overlayNameFromPkg(const QString&);
+ QString path(const QString&, int);
- QStringList getResolvedPkgs();
- QStringList getUnresolvedPkgs();
- QStringList getAllNodes();
- QStringList getInstalledList();
+ QStringList resolvedPkgs();
+ QStringList unresolvedPkgs();
+ QStringList allNodes();
+ QStringList installedList();
}; // End of class