-rw-r--r-- | kmicromail/accountview.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index d1d4f7e..eea1f65 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp | |||
@@ -12,27 +12,29 @@ | |||
12 | #include <qpe/qpeapplication.h> | 12 | #include <qpe/qpeapplication.h> |
13 | 13 | ||
14 | /* QT */ | 14 | /* QT */ |
15 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
16 | #include <qpopupmenu.h> | 16 | #include <q3popupmenu.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qtimer.h> | 18 | #include <qtimer.h> |
19 | #include <qspinbox.h> | 19 | #include <qspinbox.h> |
20 | //Added by qt3to4: | ||
21 | #include <Q3ValueList> | ||
20 | #include <klocale.h> | 22 | #include <klocale.h> |
21 | #include <kmessagebox.h> | 23 | #include <kmessagebox.h> |
22 | 24 | ||
23 | using namespace Opie::Core; | 25 | using namespace Opie::Core; |
24 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 26 | AccountView::AccountView( QWidget *parent, const char *name, Qt::WFlags flags ) |
25 | : QListView( parent, name, flags ) | 27 | : Q3ListView( parent, name, flags ) |
26 | { | 28 | { |
27 | //connect( this, SIGNAL( selectionChanged(QListViewItem*) ), | 29 | //connect( this, SIGNAL( selectionChanged(QListViewItem*) ), |
28 | // SLOT( refresh(QListViewItem*) ) ); | 30 | // SLOT( refresh(QListViewItem*) ) ); |
29 | connect( this, SIGNAL( clicked(QListViewItem*) ), | 31 | connect( this, SIGNAL( clicked(Q3ListViewItem*) ), |
30 | SLOT( refresh(QListViewItem*) ) ); | 32 | SLOT( refresh(Q3ListViewItem*) ) ); |
31 | connect( this, SIGNAL( returnPressed(QListViewItem*) ), | 33 | connect( this, SIGNAL( returnPressed(Q3ListViewItem*) ), |
32 | SLOT( refresh(QListViewItem*) ) ); | 34 | SLOT( refresh(Q3ListViewItem*) ) ); |
33 | connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 35 | connect( this, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this, |
34 | SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); | 36 | SLOT( slotHold(int,Q3ListViewItem*,const QPoint&,int) ) ); |
35 | setSorting(0); | 37 | setSorting(0); |
36 | } | 38 | } |
37 | 39 | ||
38 | AccountView::~AccountView() | 40 | AccountView::~AccountView() |
@@ -47,14 +49,14 @@ void AccountView::slotContextMenu(int id) | |||
47 | if (!view) return; | 49 | if (!view) return; |
48 | view->contextMenuSelected(id); | 50 | view->contextMenuSelected(id); |
49 | } | 51 | } |
50 | 52 | ||
51 | void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) | 53 | void AccountView::slotHold(int button, Q3ListViewItem * item,const QPoint&,int) |
52 | { | 54 | { |
53 | if (button==1) {return;} | 55 | if (button==1) {return;} |
54 | if (!item) return; | 56 | if (!item) return; |
55 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 57 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
56 | QPopupMenu*m = view->getContextMenu(); | 58 | Q3PopupMenu*m = view->getContextMenu(); |
57 | if (!m) return; | 59 | if (!m) return; |
58 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); | 60 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); |
59 | m->setFocus(); | 61 | m->setFocus(); |
60 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 62 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
@@ -92,9 +94,9 @@ void AccountView::populate( QList<Account> list ) | |||
92 | } | 94 | } |
93 | } | 95 | } |
94 | } | 96 | } |
95 | 97 | ||
96 | void AccountView::refresh(QListViewItem *item) | 98 | void AccountView::refresh(Q3ListViewItem *item) |
97 | { | 99 | { |
98 | if ( item ) | 100 | if ( item ) |
99 | { | 101 | { |
100 | bool ask = true; | 102 | bool ask = true; |
@@ -144,9 +146,9 @@ void AccountView::refreshOutgoing() | |||
144 | } | 146 | } |
145 | void AccountView::refreshCurrentSelected() | 147 | void AccountView::refreshCurrentSelected() |
146 | { | 148 | { |
147 | if ( !m_currentItem ) return; | 149 | if ( !m_currentItem ) return; |
148 | QValueList<RecMailP> headerlist; | 150 | Q3ValueList<RecMailP> headerlist; |
149 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); | 151 | AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); |
150 | view->refresh(headerlist); | 152 | view->refresh(headerlist); |
151 | emit refreshMailview(headerlist); | 153 | emit refreshMailview(headerlist); |
152 | topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ; | 154 | topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ; |
@@ -165,9 +167,9 @@ void AccountView::refreshAll() | |||
165 | } | 167 | } |
166 | 168 | ||
167 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) | 169 | RecBodyP AccountView::fetchBody(const RecMailP&aMail) |
168 | { | 170 | { |
169 | QListViewItem*item = selectedItem (); | 171 | Q3ListViewItem*item = selectedItem (); |
170 | if (!item) return new RecBody(); | 172 | if (!item) return new RecBody(); |
171 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 173 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
172 | return view->fetchBody(aMail); | 174 | return view->fetchBody(aMail); |
173 | } | 175 | } |