author | alwin <alwin> | 2005-03-10 13:48:45 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-10 13:48:45 (UTC) |
commit | 95a99e7b75eddc5629e839698b762f594be42b9f (patch) (unidiff) | |
tree | b054fc1d0731e80955f6b9fe32a51d71bdfa15cc | |
parent | 8e618d7a6d195cb737946e89370d5c60f92e8f86 (diff) | |
download | opie-95a99e7b75eddc5629e839698b762f594be42b9f.zip opie-95a99e7b75eddc5629e839698b762f594be42b9f.tar.gz opie-95a99e7b75eddc5629e839698b762f594be42b9f.tar.bz2 |
another stupid crasher fixed
-rw-r--r-- | noncore/net/mail/accountview.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index d01d6bb..faa42c3 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -24,97 +24,96 @@ AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | |||
24 | setSelectionMode(Single); | 24 | setSelectionMode(Single); |
25 | m_rightPressed = false; | 25 | m_rightPressed = false; |
26 | 26 | ||
27 | connect( this, SIGNAL( selectionChanged(QListViewItem*) ), | 27 | connect( this, SIGNAL( selectionChanged(QListViewItem*) ), |
28 | SLOT( slotSelectionChanged(QListViewItem*) ) ); | 28 | SLOT( slotSelectionChanged(QListViewItem*) ) ); |
29 | connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 29 | connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
30 | SLOT( slotMouseButton(int,QListViewItem*,const QPoint&,int) ) ); | 30 | SLOT( slotMouseButton(int,QListViewItem*,const QPoint&,int) ) ); |
31 | connect( this, SIGNAL(clicked(QListViewItem*) ),this, | 31 | connect( this, SIGNAL(clicked(QListViewItem*) ),this, |
32 | SLOT( slotMouseClicked(QListViewItem*) ) ); | 32 | SLOT( slotMouseClicked(QListViewItem*) ) ); |
33 | m_currentItem = 0; | 33 | m_currentItem = 0; |
34 | } | 34 | } |
35 | 35 | ||
36 | AccountView::~AccountView() | 36 | AccountView::~AccountView() |
37 | { | 37 | { |
38 | imapAccounts.clear(); | 38 | imapAccounts.clear(); |
39 | mhAccounts.clear(); | 39 | mhAccounts.clear(); |
40 | } | 40 | } |
41 | 41 | ||
42 | void AccountView::slotSelectionChanged(QListViewItem*item) | 42 | void AccountView::slotSelectionChanged(QListViewItem*item) |
43 | { | 43 | { |
44 | odebug << "AccountView: Selection changed" << oendl; | 44 | odebug << "AccountView: Selection changed" << oendl; |
45 | if (!item) { | 45 | if (!item) { |
46 | emit serverSelected(0); | 46 | emit serverSelected(0); |
47 | return; | 47 | return; |
48 | } | 48 | } |
49 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 49 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
50 | 50 | ||
51 | emit serverSelected(view->isServer()); | 51 | emit serverSelected(view->isServer()); |
52 | } | 52 | } |
53 | 53 | ||
54 | void AccountView::slotContextMenu(int id) | 54 | void AccountView::slotContextMenu(int id) |
55 | { | 55 | { |
56 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 56 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
57 | if (!view) return; | 57 | if (!view) return; |
58 | view->contextMenuSelected(id); | 58 | view->contextMenuSelected(id); |
59 | } | 59 | } |
60 | 60 | ||
61 | void AccountView::slotRightButton(int button, QListViewItem * item,const QPoint&,int) | 61 | void AccountView::slotRightButton(int button, QListViewItem * item,const QPoint&,int) |
62 | { | 62 | { |
63 | m_rightPressed = true; | 63 | m_rightPressed = true; |
64 | if (!item) return; | 64 | if (!item) return; |
65 | AccountViewItem *view = static_cast<AccountViewItem *>(item); | 65 | AccountViewItem *view = static_cast<AccountViewItem *>(item); |
66 | QPopupMenu*m = view->getContextMenu(); | 66 | QPopupMenu*m = view->getContextMenu(); |
67 | if (!m) return; | 67 | if (!m) return; |
68 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); | 68 | connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); |
69 | m->setFocus(); | 69 | m->setFocus(); |
70 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 70 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
71 | delete m; | 71 | delete m; |
72 | setSelected(item,true); | ||
73 | } | 72 | } |
74 | 73 | ||
75 | void AccountView::slotLeftButton(int button, QListViewItem * item,const QPoint&,int) | 74 | void AccountView::slotLeftButton(int button, QListViewItem * item,const QPoint&,int) |
76 | { | 75 | { |
77 | m_rightPressed = false; | 76 | m_rightPressed = false; |
78 | } | 77 | } |
79 | 78 | ||
80 | void AccountView::slotMouseClicked(QListViewItem*item) | 79 | void AccountView::slotMouseClicked(QListViewItem*item) |
81 | { | 80 | { |
82 | if (m_rightPressed) return; | 81 | if (m_rightPressed) return; |
83 | if (!item || m_currentItem == item) return; | 82 | if (!item || m_currentItem == item) return; |
84 | /* ### ToDo check settings if on single tab it should open */ | 83 | /* ### ToDo check settings if on single tab it should open */ |
85 | m_currentItem = item; | 84 | m_currentItem = item; |
86 | refresh(m_currentItem); | 85 | refresh(m_currentItem); |
87 | } | 86 | } |
88 | 87 | ||
89 | void AccountView::slotMouseButton(int button, QListViewItem * item,const QPoint&pos,int column) | 88 | void AccountView::slotMouseButton(int button, QListViewItem * item,const QPoint&pos,int column) |
90 | { | 89 | { |
91 | if (button==1) { | 90 | if (button==1) { |
92 | slotLeftButton(button,item,pos,column); | 91 | slotLeftButton(button,item,pos,column); |
93 | } else if (button==2) { | 92 | } else if (button==2) { |
94 | slotRightButton(button,item,pos,column); | 93 | slotRightButton(button,item,pos,column); |
95 | } | 94 | } |
96 | } | 95 | } |
97 | 96 | ||
98 | void AccountView::populate( QList<Account> list ) | 97 | void AccountView::populate( QList<Account> list ) |
99 | { | 98 | { |
100 | clear(); | 99 | clear(); |
101 | 100 | ||
102 | imapAccounts.clear(); | 101 | imapAccounts.clear(); |
103 | mhAccounts.clear(); | 102 | mhAccounts.clear(); |
104 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); | 103 | mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); |
105 | 104 | ||
106 | Account *it; | 105 | Account *it; |
107 | for ( it = list.first(); it; it = list.next() ) { | 106 | for ( it = list.first(); it; it = list.next() ) { |
108 | if ( it->getType() == MAILLIB::A_IMAP ) { | 107 | if ( it->getType() == MAILLIB::A_IMAP ) { |
109 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); | 108 | IMAPaccount *imap = static_cast<IMAPaccount *>(it); |
110 | odebug << "added IMAP " + imap->getAccountName() << oendl; | 109 | odebug << "added IMAP " + imap->getAccountName() << oendl; |
111 | imapAccounts.append(new IMAPviewItem( imap, this )); | 110 | imapAccounts.append(new IMAPviewItem( imap, this )); |
112 | } else if ( it->getType() == MAILLIB::A_POP3 ) { | 111 | } else if ( it->getType() == MAILLIB::A_POP3 ) { |
113 | POP3account *pop3 = static_cast<POP3account *>(it); | 112 | POP3account *pop3 = static_cast<POP3account *>(it); |
114 | odebug << "added POP3 " + pop3->getAccountName() << oendl; | 113 | odebug << "added POP3 " + pop3->getAccountName() << oendl; |
115 | /* must not be hold 'cause it isn't required */ | 114 | /* must not be hold 'cause it isn't required */ |
116 | (void) new POP3viewItem( pop3, this ); | 115 | (void) new POP3viewItem( pop3, this ); |
117 | } else if ( it->getType() == MAILLIB::A_NNTP ) { | 116 | } else if ( it->getType() == MAILLIB::A_NNTP ) { |
118 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); | 117 | NNTPaccount *nntp = static_cast<NNTPaccount *>(it); |
119 | odebug << "added NNTP " + nntp->getAccountName() << oendl; | 118 | odebug << "added NNTP " + nntp->getAccountName() << oendl; |
120 | /* must not be hold 'cause it isn't required */ | 119 | /* must not be hold 'cause it isn't required */ |