summaryrefslogtreecommitdiff
authortille <tille>2002-05-01 22:56:23 (UTC)
committer tille <tille>2002-05-01 22:56:23 (UTC)
commita3397118d3c384655bedb40210db96ca34adc0c9 (patch) (side-by-side diff)
tree3b8d46e0e9d1203801783a7dbf92400a4ed8652a
parent89b16f3378b783be9058852528e066dcadea953d (diff)
downloadopie-a3397118d3c384655bedb40210db96ca34adc0c9.zip
opie-a3397118d3c384655bedb40210db96ca34adc0c9.tar.gz
opie-a3397118d3c384655bedb40210db96ca34adc0c9.tar.bz2
fixed close of local & ipkgfind
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp39
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp36
-rw-r--r--noncore/unsupported/oipkg/packagelistview.h7
3 files changed, 63 insertions, 19 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index 4865c39..0422d65 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -40,3 +40,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
setCentralWidget( listViewPackages );
-
+ listViewPackages->addList( tr("local"), &packageList );
+ listViewPackages->addList( tr("ipkgfind"), &packageListSearch );
// wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton);
@@ -282,22 +283,22 @@ void MainWindow::displayList()
filterList();
- listViewPackages->clear();
- Package *pack = packageList.first();
- PackageListItem *item;
-
-// if (!rootLocal)
+ listViewPackages->display();
+//// if (!rootLocal)
+//// {
+// QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local"));
+// QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind"));
+//// }
+// listViewPackages->clear();
+// Package *pack = packageList.first();
+// PackageListItem *item;
+// while( pack )
// {
- QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local"));
- QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind"));
+// item = new PackageListItem( rootLocal, pack, settings );
+// pack = packageList.next();
+// }
+// pack = packageListSearch.first();
+// while( pack )
+// {
+// item = new PackageListItem( rootSearch, pack, settings );
+// pack = packageListSearch.next();
// }
- while( pack )
- {
- item = new PackageListItem( rootLocal, pack, settings );
- pack = packageList.next();
- }
- pack = packageListSearch.first();
- while( pack )
- {
- item = new PackageListItem( rootSearch, pack, settings );
- pack = packageListSearch.next();
- }
}
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index 26b1ce7..5137c64 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -96 +96,37 @@ void PackageListView::toggleProcess()
}
+
+void PackageListView::display()
+{
+ QDictIterator<PackageList> list( PackageLists );
+ PackageList *packlist;
+ Package *pack;
+ PackageListItem *item;
+ QCheckListItem *rootItem;
+ QListViewItem* it;
+ QListViewItem* itdel;
+ while ( list.current() ) {
+ packlist = list.current();
+ rootItem = rootItems.find( list.currentKey() );
+ //rootItem->clear();
+ it=rootItem->firstChild();
+ while ( it )
+ {
+ itdel = it;
+ it = it->nextSibling();
+ delete itdel;
+ }
+ pack = packlist->first();
+ while( pack )
+ {
+ item = new PackageListItem( rootItem, pack, settings );
+ pack = packlist->next();
+ }
+ ++list;
+ }
+}
+
+void PackageListView::addList( QString n, PackageList* pl)
+{
+ PackageLists.insert(n, pl);
+ rootItems.insert(n, new QCheckListItem(this,n));
+}
diff --git a/noncore/unsupported/oipkg/packagelistview.h b/noncore/unsupported/oipkg/packagelistview.h
index d371a34..00c0320 100644
--- a/noncore/unsupported/oipkg/packagelistview.h
+++ b/noncore/unsupported/oipkg/packagelistview.h
@@ -22,2 +22,4 @@
#include <qaction.h>
+#include <qdict.h>
+#include <qstring.h>
#include <qtimer.h>
@@ -25,2 +27,3 @@
#include <qpopupmenu.h>
+#include "packagelist.h"
#include "debug.h"
@@ -37,2 +40,3 @@ public:
PackageListView(QWidget*, const char*, PackageManagerSettings*);
+ void addList( QString, PackageList* );
// ~PackageListView();
@@ -40,2 +44,4 @@ public:
private:
+ QDict<PackageList> PackageLists;
+ QDict<QCheckListItem> rootItems;
PackageManagerSettings *settings;
@@ -51,2 +57,3 @@ public slots:
void toggleProcess();
+ void display();
};