From c81f3f6bd05c726d36f9dcec714397f0179f490b Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Fri, 27 Jun 2008 21:33:48 -0300 Subject: Redo the getGroups, make the groupsEnum a single enum not 2^ Fixed the ui to use the getGroups correctly Reorgized the gui dirs... --- lib/Daemon.cpp | 12 +++-------- lib/Daemon.h | 2 +- lib/Groups.h | 58 ++++++++++++++++++++++++++--------------------------- lib/Transaction.cpp | 2 +- lib/Transaction.h | 2 +- 5 files changed, 35 insertions(+), 41 deletions(-) (limited to 'lib') diff --git a/lib/Daemon.cpp b/lib/Daemon.cpp index 22dcd9a..f0a5a03 100644 --- a/lib/Daemon.cpp +++ b/lib/Daemon.cpp @@ -45,17 +45,11 @@ void Daemon::getBackendDetails(QString &name, QString &author) { } QStringList Daemon::getFilters() { - QString filters = proxy->GetFilters(); - return filters.split(";"); + return QString(proxy->GetFilters()).split(";"); } -Groups::Value Daemon::getGroups() { - QStringList groups = QString(proxy->GetGroups()).split(";"); - unsigned int ret = 0; - for(int i = 0 ; i < groups.size() ; ++i) { - ret |= EnumFromString(groups.at(i)); - } - return (Groups::Value) ret; +QStringList Daemon::getGroups() { + return QString(proxy->GetGroups()).split(";"); } QStringList Daemon::getTransactionList() { diff --git a/lib/Daemon.h b/lib/Daemon.h index a76df94..6a1ad49 100644 --- a/lib/Daemon.h +++ b/lib/Daemon.h @@ -37,7 +37,7 @@ public: unsigned int getActions(); void getBackendDetails(QString &name, QString &author); QStringList getFilters(); - Groups::Value getGroups(); + QStringList getGroups(); QStringList getTransactionList(); uint getTimeSinceAction(Role::Value role); diff --git a/lib/Groups.h b/lib/Groups.h index 8f63d17..fe4e28f 100644 --- a/lib/Groups.h +++ b/lib/Groups.h @@ -25,35 +25,35 @@ class Groups : public QObject { public: typedef enum { - Accessibility = 1 << 0, - Accessories = 1 << 1, - Admin_tools = 1 << 2, - Communication = 1 << 3, - Desktop_gnome = 1 << 4, - Desktop_kde = 1 << 5, - Desktop_other = 1 << 6, - Desktop_xfce = 1 << 7, - Education = 1 << 8, - Fonts = 1 << 9, - Games = 1 << 10, - Graphics = 1 << 11, - Internet = 1 << 12, - Legacy = 1 << 13, - Localization = 1 << 14, - Maps = 1 << 15, - Multimedia = 1 << 16, - Network = 1 << 17, - Office = 1 << 18, - Other = 1 << 19, - Power_management = 1 << 20, - Programming = 1 << 21, - Publishing = 1 << 22, - Repos = 1 << 23, - Security = 1 << 24, - Servers = 1 << 25, - System = 1 << 26, - Virtualization = 1 << 27, - Unknown = 1 << 28 + Accessibility, + Accessories, + Admin_tools, + Communication, + Desktop_gnome, + Desktop_kde, + Desktop_other, + Desktop_xfce, + Education, + Fonts, + Games, + Graphics, + Internet, + Legacy, + Localization, + Maps, + Multimedia, + Network, + Office, + Other, + Power_management, + Programming, + Publishing, + Repos, + Security, + Servers, + System, + Virtualization, + Unknown } Value; }; diff --git a/lib/Transaction.cpp b/lib/Transaction.cpp index 9e34c22..498fba8 100644 --- a/lib/Transaction.cpp +++ b/lib/Transaction.cpp @@ -278,7 +278,7 @@ void Transaction::Package_cb(const QString &info, const QString &package_id, con } void Transaction::Details_cb(const QString &package_id, const QString &license, const QString &group, const QString &detail, const QString &url, qulonglong size) { - emit Details(new Package(package_id), license, (Groups::Value)EnumFromString(group), detail, url, size); + emit Details(new Package(package_id), license, group, detail, url, size); } void Transaction::Files_cb(const QString &pid, const QString &file_list) { diff --git a/lib/Transaction.h b/lib/Transaction.h index f331726..b6a49b6 100644 --- a/lib/Transaction.h +++ b/lib/Transaction.h @@ -83,7 +83,7 @@ public: signals: void GotPackage(Package *p); - void Details(Package *p, const QString& license, Groups::Value group, const QString& detail, const QString& url, qulonglong size); + void Details(Package *p, const QString &license, const QString &group, const QString &detail, const QString &url, qulonglong size); void Files(Package *p, QStringList files); void Finished(Exit::Value status, uint runtime); void ProgressChanged(uint percentage, uint subpercentage, uint elapsed, uint remaining); -- cgit v1.2.3