Diffstat (limited to 'noncore/unsupported/oipkg/packagelistitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 0c7c928..b7af9a6 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -1,39 +1,50 @@ | |||
1 | #include "packagelistitem.h" | 1 | #include "packagelistitem.h" |
2 | 2 | ||
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_installed=0; | 9 | static QPixmap *pm_installed=0; |
10 | static QPixmap *pm_uninstall=0; | 10 | static QPixmap *pm_uninstall=0; |
11 | static QPixmap *pm_install=0; | 11 | static QPixmap *pm_install=0; |
12 | 12 | ||
13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) | 13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) |
14 | :QCheckListItem(lv,pi->name(),CheckBox) | 14 | :QCheckListItem(lv,pi->name(),CheckBox) |
15 | { | 15 | { |
16 | init(pi,s); | ||
17 | } | ||
18 | |||
19 | PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) | ||
20 | :QCheckListItem(lvi,pi->name(),CheckBox) | ||
21 | { | ||
22 | init(pi,s); | ||
23 | } | ||
24 | |||
25 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) | ||
26 | { | ||
16 | package = pi; | 27 | package = pi; |
17 | settings = s; | 28 | settings = s; |
18 | setExpandable( true ); | 29 | setExpandable( true ); |
19 | QCheckListItem *item; | 30 | QCheckListItem *item; |
20 | nameItem = new QCheckListItem( this, "" ); | 31 | nameItem = new QCheckListItem( this, "" ); |
21 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); | 32 | item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); |
22 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); | 33 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); |
23 | destItem = new QCheckListItem( this, "" ); | 34 | destItem = new QCheckListItem( this, "" ); |
24 | linkItem = new QCheckListItem( this, "" ); | 35 | linkItem = new QCheckListItem( this, "" ); |
25 | displayDetails(); | 36 | displayDetails(); |
26 | 37 | ||
27 | if (!pm_uninstalled) | 38 | if (!pm_uninstalled) |
28 | { | 39 | { |
29 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); | 40 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); |
30 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); | 41 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); |
31 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); | 42 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); |
32 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); | 43 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); |
33 | } | 44 | } |
34 | } | 45 | } |
35 | 46 | ||
36 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, | 47 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, |
37 | int column, int width, int alignment ) | 48 | int column, int width, int alignment ) |
38 | { | 49 | { |
39 | if ( !p ) | 50 | if ( !p ) |