Diffstat (limited to 'noncore/unsupported/oipkg/packagelistitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 45aaf1d..c743a49 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -3,15 +3,19 @@ | |||
3 | #include <qpe/resource.h> | 3 | #include <qpe/resource.h> |
4 | #include <qobject.h> | 4 | #include <qobject.h> |
5 | 5 | ||
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | 7 | ||
8 | static QPixmap *pm_uninstalled=0; | 8 | static QPixmap *pm_uninstalled=0; |
9 | static QPixmap *pm_uninstalled_old=0; | ||
9 | static QPixmap *pm_installed=0; | 10 | static QPixmap *pm_installed=0; |
11 | static QPixmap *pm_installed_old=0; | ||
10 | static QPixmap *pm_uninstall=0; | 12 | static QPixmap *pm_uninstall=0; |
11 | static QPixmap *pm_install=0; | 13 | static QPixmap *pm_install=0; |
14 | static QPixmap *pm_uninstalled_old_installed_new=0; | ||
15 | static QPixmap *pm_uninstalled_installed_old=0; | ||
12 | 16 | ||
13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) | 17 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) |
14 | :QCheckListItem(lv,pi->name(),CheckBox) | 18 | :QCheckListItem(lv,pi->name(),CheckBox) |
15 | { | 19 | { |
16 | init(pi,s); | 20 | init(pi,s); |
17 | } | 21 | } |
@@ -43,13 +47,17 @@ void PackageListItem::init( Package *pi, PackageManagerSettings *s) | |||
43 | } | 47 | } |
44 | displayDetails(); | 48 | displayDetails(); |
45 | 49 | ||
46 | if (!pm_uninstalled) | 50 | if (!pm_uninstalled) |
47 | { | 51 | { |
48 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); | 52 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); |
53 | pm_uninstalled_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOld")); | ||
54 | pm_uninstalled_old_installed_new = new QPixmap(Resource::loadPixmap("oipkg/uninstalledOldinstalledNew")); | ||
55 | pm_uninstalled_installed_old = new QPixmap(Resource::loadPixmap("oipkg/uninstalledInstalledOld")); | ||
49 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); | 56 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); |
57 | pm_installed_old = new QPixmap(Resource::loadPixmap("oipkg/installedOld")); | ||
50 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); | 58 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); |
51 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); | 59 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); |
52 | } | 60 | } |
53 | } | 61 | } |
54 | 62 | ||
55 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, | 63 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, |
@@ -90,18 +98,31 @@ void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg, | |||
90 | QListViewItem::paintFocus(p,cg,r); | 98 | QListViewItem::paintFocus(p,cg,r); |
91 | } | 99 | } |
92 | 100 | ||
93 | QPixmap PackageListItem::statePixmap() const | 101 | QPixmap PackageListItem::statePixmap() const |
94 | { | 102 | { |
95 | bool installed = package->installed(); | 103 | bool installed = package->installed(); |
104 | bool old = package->isOld(); | ||
105 | bool versions = package->hasVersions(); | ||
106 | bool verinstalled = package->otherInstalled(); | ||
96 | if ( !package->toProcess() ) { | 107 | if ( !package->toProcess() ) { |
97 | if ( !installed ) | 108 | if ( !installed ) |
98 | return *pm_uninstalled; | 109 | if (old) |
110 | { | ||
111 | if (verinstalled) return *pm_uninstalled_old_installed_new; | ||
112 | else return *pm_uninstalled_old; | ||
113 | } | ||
114 | else | ||
115 | { | ||
116 | if (verinstalled) return *pm_uninstalled_installed_old; | ||
117 | else return *pm_uninstalled; | ||
118 | } | ||
99 | else | 119 | else |
100 | return *pm_installed; | 120 | if (old) return *pm_installed_old; |
101 | } else { | 121 | else return *pm_installed; |
122 | } else { //toProcess() == true | ||
102 | if ( !installed ) | 123 | if ( !installed ) |
103 | return *pm_install; | 124 | return *pm_install; |
104 | else | 125 | else |
105 | return *pm_uninstall; | 126 | return *pm_uninstall; |
106 | } | 127 | } |
107 | } | 128 | } |