summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelistview.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/oipkg/packagelistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp8
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);
}