summaryrefslogtreecommitdiff
path: root/noncore/net/mail/accountview.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index c2185f2..64557ee 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,71 +1,71 @@
1 1
2#include "accountview.h" 2#include "accountview.h"
3#include "accountitem.h" 3#include "accountitem.h"
4#include "selectstore.h" 4#include "selectstore.h"
5 5
6/* OPIE */ 6/* OPIE */
7#include <libmailwrapper/settings.h> 7#include <libmailwrapper/settings.h>
8#include <libmailwrapper/mailwrapper.h> 8#include <libmailwrapper/mailwrapper.h>
9#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
10#include <libmailwrapper/abstractmail.h> 10#include <libmailwrapper/abstractmail.h>
11#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12 12
13/* QT */ 13/* QT */
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15#include <qpopupmenu.h> 15#include <qpopupmenu.h>
16 16
17AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 17AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
18 : QListView( parent, name, flags ) 18 : QListView( parent, name, flags )
19{ 19{
20 connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), 20 connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
21 SLOT( refresh( QListViewItem * ) ) ); 21 SLOT( refresh(QListViewItem*) ) );
22 connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, 22 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
23 SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) ); 23 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) );
24 setSorting(0); 24 setSorting(0);
25} 25}
26 26
27AccountView::~AccountView() 27AccountView::~AccountView()
28{ 28{
29 imapAccounts.clear(); 29 imapAccounts.clear();
30 mhAccounts.clear(); 30 mhAccounts.clear();
31} 31}
32 32
33void AccountView::slotContextMenu(int id) 33void AccountView::slotContextMenu(int id)
34{ 34{
35 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); 35 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
36 if (!view) return; 36 if (!view) return;
37 view->contextMenuSelected(id); 37 view->contextMenuSelected(id);
38} 38}
39 39
40void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) 40void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int)
41{ 41{
42 if (button==1) {return;} 42 if (button==1) {return;}
43 if (!item) return; 43 if (!item) return;
44 AccountViewItem *view = static_cast<AccountViewItem *>(item); 44 AccountViewItem *view = static_cast<AccountViewItem *>(item);
45 QPopupMenu*m = view->getContextMenu(); 45 QPopupMenu*m = view->getContextMenu();
46 if (!m) return; 46 if (!m) return;
47 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); 47 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int)));
48 m->setFocus(); 48 m->setFocus();
49 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 49 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
50 delete m; 50 delete m;
51} 51}
52 52
53void AccountView::populate( QList<Account> list ) 53void AccountView::populate( QList<Account> list )
54{ 54{
55 clear(); 55 clear();
56 56
57 imapAccounts.clear(); 57 imapAccounts.clear();
58 mhAccounts.clear(); 58 mhAccounts.clear();
59 59
60 mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); 60 mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this));
61 61
62 Account *it; 62 Account *it;
63 for ( it = list.first(); it; it = list.next() ) 63 for ( it = list.first(); it; it = list.next() )
64 { 64 {
65 if ( it->getType().compare( "IMAP" ) == 0 ) 65 if ( it->getType().compare( "IMAP" ) == 0 )
66 { 66 {
67 IMAPaccount *imap = static_cast<IMAPaccount *>(it); 67 IMAPaccount *imap = static_cast<IMAPaccount *>(it);
68 qDebug( "added IMAP " + imap->getAccountName() ); 68 qDebug( "added IMAP " + imap->getAccountName() );
69 imapAccounts.append(new IMAPviewItem( imap, this )); 69 imapAccounts.append(new IMAPviewItem( imap, this ));
70 } 70 }
71 else if ( it->getType().compare( "POP3" ) == 0 ) 71 else if ( it->getType().compare( "POP3" ) == 0 )