-rw-r--r-- | noncore/unsupported/oipkg/main.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 65 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.h | 7 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 11 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistview.cpp | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 10 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 1 |
8 files changed, 59 insertions, 44 deletions
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp index 4af59b0..5cef2dc 100644 --- a/noncore/unsupported/oipkg/main.cpp +++ b/noncore/unsupported/oipkg/main.cpp @@ -1,19 +1,22 @@ #include "mainwindow.h" #include <qpe/qpeapplication.h> #include <qstring.h> +#include <qmessagebox.h> int debugLevel; int main( int argc, char ** argv ) { + debugLevel = 2; if (argc > 0) { debugLevel = QString ( argv[1] ).toInt(); } QPEApplication a( argc, argv ); MainWindow mw; + QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); a.showMainDocumentWidget( &mw ); return a.exec(); } diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 06828e0..4865c39 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp @@ -60,14 +60,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : connect( settings->removeLinksButton, SIGNAL( clicked()), SLOT(removeLinks()) ); connect( settings->createLinksButton, SIGNAL( clicked()), SLOT(createLinks()) ); -// rootLocal = new QCheckListItem(listViewPackages,tr("local")); -// rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); displayList(); } void MainWindow::makeMenu() { @@ -283,14 +281,17 @@ void MainWindow::displayList() // wait->hide(); filterList(); listViewPackages->clear(); Package *pack = packageList.first(); PackageListItem *item; +// if (!rootLocal) +// { QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); +// } while( pack ) { item = new PackageListItem( rootLocal, pack, settings ); pack = packageList.next(); } pack = packageListSearch.first(); diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 6bb53a9..0787ece 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp @@ -66,61 +66,61 @@ void Package::setValue( QString n, QString t ) if ( n == "Package" ) { _name = QString( t ); }else if ( n == "Installed-Size" ) { _size = t; - }else if ( n == "Priority") - { +// }else if ( n == "Priority") +// { }else if ( n == "Section") { setSection( t ); - }else if ( n == "Maintainer") - { - - }else if ( n == "Architecture") - { +// }else if ( n == "Maintainer") +// { +// +// }else if ( n == "Architecture") +// { }else if ( n == "Version") { - - }else if ( n == "Pre-Depends") - { - - }else if ( n == "Depends") - { + _version = t; +// }else if ( n == "Pre-Depends") +// { +// +// }else if ( n == "Depends") +// { }else if ( n == "Filename") { _fileName = t; - }else if ( n == "Size") - { - - }else if ( n == "MD5Sum") - { +// }else if ( n == "Size") +// { +// +// }else if ( n == "MD5Sum") +// { - } - if ( n == "Description") + }else if ( n == "Description") { setDesc( t ); - } - if ( n == "Status") + }else if ( n == "Status") { if ( installed() ) return; _status = t; - } - if ( t == "Essential") - { +// }else if ( n == "Essential") +// { + }else{ + _values.insert(n,new QString(t)); + } } -}; QString Package::name() { - return _name; + if (_displayName.isEmpty() ) return _name; + else return _displayName; } QString Package::installName() { if (_useFileName) return _fileName; @@ -150,12 +150,18 @@ QString Package::shortDesc() QString Package::size() { return _size; } + +QString Package::version() +{ + return _version; +} + QString Package::sizeUnits() { int i = _size.toInt(); int c = 0; QString ret; QStringList unit; @@ -347,6 +353,11 @@ void Package::parseIpkgFile( QString file) //} void Package::instalFromFile(bool iff) { _useFileName = iff; } + +void Package::setName(QString n) +{ + _displayName = n; +} diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index 4618c3a..2ca966d 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h @@ -29,12 +29,13 @@ class Package //: public QObject void setDesc( QString ); QString shortDesc(); QString desc(); QString size(); QString sizeUnits(); + QString version(); void setSection( QString ); QString section(); QString subSection(); QString details(); bool toProcess(); bool toInstall(); @@ -44,30 +45,32 @@ class Package //: public QObject void setDest( QString d ); void setOn(); bool link(); void setLink(bool); void parseIpkgFile( QString ); void instalFromFile(bool iff=true); + void setName(QString); public slots: -// QString getPackageName(); void toggleProcess(); private: PackageManagerSettings *settings; -// QString _packageName; + QString _displayName; QString _name; QString _fileName; bool _toProcess; bool _link; QString _status; QString _size; QString _section; QString _subsection; QString _shortDesc; QString _desc; + QString _version; QString _dest; + QDict<QString> _values; bool _useFileName; void parsePackage( QStringList ); void init(PackageManagerSettings *); }; diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index b892b30..be20c71 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp @@ -30,23 +30,32 @@ PackageList::~PackageList() { } /** Inserts a package into the list */ void PackageList::insertPackage( Package* pack ) { + if (!pack) return; Package* p = packageList.find( pack->name() ); if ( p ) { + if ( p->version() == pack->version() ) + { p->copyValues( pack ); delete pack; pack = p; }else{ + p->setName( pack->name()+"["+p->version()+"]" ); + pack->setName( pack->name()+"["+pack->version()+"]" ); + packageList.insert( pack->name(), pack ); + origPackageList.insert( pack->name(), pack ); + } + }else{ packageList.insert( pack->name(), pack ); origPackageList.insert( pack->name(), pack ); - empty=false; }; + empty=false; updateSections( pack ); } void PackageList::filterPackages( QString f ) { packageList.clear(); diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 610a0e1..36d081b 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp @@ -61,13 +61,12 @@ void PackageListView::showPopup() popupAction->setOn(true); }; } connect( destsMenu, SIGNAL( activated( int ) ), this, SLOT( changePackageDest( int ) ) ); }else{ -// popupActcat setOn( activePackage->toProcess() ); } popupMenu->popup( QCursor::pos() ); } void PackageListView::stopTimer( QListViewItem* ) { diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index fe200f5..1798c80 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp @@ -283,21 +283,12 @@ void PmIpkg::startDialog() GroupBox1Layout->addWidget( _force_reinstall, 1, 0 ); _force_remove = new QCheckBox( GroupBox1, "_force_remove" ); _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); _force_remove->setAutoResize( TRUE ); GroupBox1Layout->addWidget( _force_remove, 1, 0 ); RunWindowLayout->addWidget( GroupBox1 , 3, 0 ); - -// connect( doItButton, SIGNAL( clicked() ), -// this, SLOT( doIt() ) ); -// connect( installButton, SIGNAL( clicked() ), -// this, SLOT( install() ) ); -// connect( removeButton, SIGNAL( clicked() ), -// this, SLOT( remove() ) ); -// connect( cancelButton, SIGNAL( clicked() ), -// installDialog, SLOT( close() ) ); installDialog->showMaximized(); if ( installDialog->exec() ) doIt(); installDialog->close(); out(tr("<b>All done.</b>")); } @@ -332,13 +323,12 @@ void PmIpkg::remove() it->processed(); out("<br><hr>"); }else{ out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); } - pvDebug(2,"delete File List"); if ( it->link() )delete fileList; } out("<br>"); } diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 2b89023..fa00048 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h @@ -23,13 +23,12 @@ public: ~PmIpkg(); int linkOpp; void loadList( PackageList ); void commit( PackageList ); void update(); - // PackageList* getPackageList(); void showButtons(bool b=true); void show( bool buttons=true ); public slots: void doIt(); void install(); |