summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/packagelistview.cpp
Unidiff
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,81 +1,81 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 9// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
10#include "packagelistview.h" 10#include "packagelistview.h"
11 11
12#include <qpopupmenu.h> 12#include <qpopupmenu.h>
13#include <qaction.h> 13#include <qaction.h>
14 14
15#include "listviewitemoipkg.h" 15#include "listviewitemoipkg.h"
16#include "packagelistitem.h" 16#include "packagelistitem.h"
17#include "pksettings.h" 17#include "pksettings.h"
18 18
19PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s) 19PackageListView::PackageListView(QWidget *p, const char* n, PackageManagerSettings *s)
20 : QListView(p,n) 20 : QListView(p,n)
21{ 21{
22 settings = s; 22 settings = s;
23 popupTimer = new QTimer( this ); 23 popupTimer = new QTimer( this );
24 setSelectionMode(QListView::NoSelection); 24 setSelectionMode(QListView::NoSelection);
25 addColumn( tr("Package") ); 25 addColumn( tr("Package") );
26 setRootIsDecorated( true ); 26 setRootIsDecorated( true );
27 27
28 connect( popupTimer, SIGNAL(timeout()), 28 connect( popupTimer, SIGNAL(timeout()),
29 this, SLOT(showPopup()) ); 29 this, SLOT(showPopup()) );
30 connect( this, SIGNAL( pressed( QListViewItem* ) ), 30 connect( this, SIGNAL( pressed(QListViewItem*) ),
31 this, SLOT( setCurrent( QListViewItem* ) ) ); 31 this, SLOT( setCurrent(QListViewItem*) ) );
32 connect( this, SIGNAL( clicked( QListViewItem* ) ), 32 connect( this, SIGNAL( clicked(QListViewItem*) ),
33 this, SLOT( stopTimer( QListViewItem* ) ) ); 33 this, SLOT( stopTimer(QListViewItem*) ) );
34 34
35} 35}
36 36
37//PackageListView::~PackageListView() 37//PackageListView::~PackageListView()
38//{ 38//{
39//} 39//}
40 40
41void PackageListView::setCurrent( QListViewItem* p ) 41void PackageListView::setCurrent( QListViewItem* p )
42{ 42{
43 qDebug("PackageListView::setCurrent "); 43 qDebug("PackageListView::setCurrent ");
44 activeItem = (ListViewItemOipkg*)p; 44 activeItem = (ListViewItemOipkg*)p;
45 45
46 if ( activeItem != 0 ) popupTimer->start( 750, true ); 46 if ( activeItem != 0 ) popupTimer->start( 750, true );
47 47
48// if ( activeItem->getType() != ListViewItemOipkg::Package ){ 48// if ( activeItem->getType() != ListViewItemOipkg::Package ){
49// qDebug("PackageListView::setCurrent !p "); 49// qDebug("PackageListView::setCurrent !p ");
50// activePackage = 0; 50// activePackage = 0;
51 // activePackageListItem = 0; 51 // activePackageListItem = 0;
52// qDebug("PackageListView::setCurrent returning "); 52// qDebug("PackageListView::setCurrent returning ");
53// return; 53// return;
54// }; 54// };
55// activePackageListItem = (PackageListItem*)p; 55// activePackageListItem = (PackageListItem*)p;
56// activePackage = activePackageListItem->getPackage(); 56// activePackage = activePackageListItem->getPackage();
57// if (activePackage == 0 ) 57// if (activePackage == 0 )
58// { 58// {
59// qDebug("PackageListView::setCurrent if (!activePackage)"); 59// qDebug("PackageListView::setCurrent if (!activePackage)");
60// return; 60// return;
61// } 61// }
62 62
63 63
64 qDebug("PackageListView::setCurrent popupTimer->start"); 64 qDebug("PackageListView::setCurrent popupTimer->start");
65} 65}
66 66
67 67
68void PackageListView::showPopup() 68void PackageListView::showPopup()
69{ 69{
70 qDebug("PackageListView::showPopup"); 70 qDebug("PackageListView::showPopup");
71 QPopupMenu *popup = activeItem->getPopupMenu(); 71 QPopupMenu *popup = activeItem->getPopupMenu();
72 if (popup == 0) return; 72 if (popup == 0) return;
73 popup->popup( QCursor::pos() ); 73 popup->popup( QCursor::pos() );
74 qDebug("PackageListView::showPopup"); 74 qDebug("PackageListView::showPopup");
75} 75}
76 76
77void PackageListView::stopTimer( QListViewItem* ) 77void PackageListView::stopTimer( QListViewItem* )
78{ 78{
79 popupTimer->stop(); 79 popupTimer->stop();
80} 80}
81 81