author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (side-by-side diff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/unsupported/oipkg/packagelistview.cpp | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/unsupported/oipkg/packagelistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/packagelistview.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 3c7435d..98ebf88 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp @@ -1,118 +1,118 @@ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ // (c) 2002 Patrick S. Vogt <tille@handhelds.org> #include "packagelistview.h" #include <qpopupmenu.h> #include <qaction.h> #include "listviewitemoipkg.h" #include "packagelistitem.h" #include "pksettings.h" PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) : QListView(p,n) { settings = s; popupTimer = new QTimer( this ); setSelectionMode(QListView::NoSelection); addColumn( tr("Package") ); setRootIsDecorated( true ); connect( popupTimer, SIGNAL(timeout()), this, SLOT(showPopup()) ); - connect( this, SIGNAL( pressed( QListViewItem* ) ), - this, SLOT( setCurrent( QListViewItem* ) ) ); - connect( this, SIGNAL( clicked( QListViewItem* ) ), - this, SLOT( stopTimer( QListViewItem* ) ) ); + connect( this, SIGNAL( pressed(QListViewItem*) ), + this, SLOT( setCurrent(QListViewItem*) ) ); + connect( this, SIGNAL( clicked(QListViewItem*) ), + this, SLOT( stopTimer(QListViewItem*) ) ); } //PackageListView::~PackageListView() //{ //} void PackageListView::setCurrent( QListViewItem* p ) { qDebug("PackageListView::setCurrent "); activeItem = (ListViewItemOipkg*)p; if ( activeItem != 0 ) popupTimer->start( 750, true ); // if ( activeItem->getType() != ListViewItemOipkg::Package ){ // qDebug("PackageListView::setCurrent !p "); // activePackage = 0; // activePackageListItem = 0; // qDebug("PackageListView::setCurrent returning "); // return; // }; // activePackageListItem = (PackageListItem*)p; // activePackage = activePackageListItem->getPackage(); // if (activePackage == 0 ) // { // qDebug("PackageListView::setCurrent if (!activePackage)"); // return; // } qDebug("PackageListView::setCurrent popupTimer->start"); } void PackageListView::showPopup() { qDebug("PackageListView::showPopup"); QPopupMenu *popup = activeItem->getPopupMenu(); if (popup == 0) return; popup->popup( QCursor::pos() ); qDebug("PackageListView::showPopup"); } void PackageListView::stopTimer( QListViewItem* ) { popupTimer->stop(); } void PackageListView::display() { QDictIterator<PackageList> list( PackageLists ); PackageList *packlist; OipkgPackage *pack; PackageListItem *item; ListViewItemOipkg *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); ListViewItemOipkg *item = new ListViewItemOipkg(this,n,ListViewItemOipkg::Feed); rootItems.insert(n, item); } |