summaryrefslogtreecommitdiffabout
path: root/kmicromail/accountview.cpp
authorzautrix <zautrix>2005-08-23 09:58:25 (UTC)
committer zautrix <zautrix>2005-08-23 09:58:25 (UTC)
commite34e096c0e1b799904643c753591833f3ff2ab95 (patch) (unidiff)
tree7599dafddcc8b7b918ee52c5dfa1fe162d3022d3 /kmicromail/accountview.cpp
parentcfda06568cbd0e67ba0188f00622b348b57b27c0 (diff)
downloadkdepimpi-e34e096c0e1b799904643c753591833f3ff2ab95.zip
kdepimpi-e34e096c0e1b799904643c753591833f3ff2ab95.tar.gz
kdepimpi-e34e096c0e1b799904643c753591833f3ff2ab95.tar.bz2
ompi fix
Diffstat (limited to 'kmicromail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/accountview.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp
index cef55ab..4879d57 100644
--- a/kmicromail/accountview.cpp
+++ b/kmicromail/accountview.cpp
@@ -76,53 +76,64 @@ void AccountView::populate( QList<Account> list )
76 if ( it->getType() == MAILLIB::A_IMAP ) 76 if ( it->getType() == MAILLIB::A_IMAP )
77 { 77 {
78 IMAPaccount *imap = static_cast<IMAPaccount *>(it); 78 IMAPaccount *imap = static_cast<IMAPaccount *>(it);
79 imapAccounts.append(new IMAPviewItem( imap, this )); 79 imapAccounts.append(new IMAPviewItem( imap, this ));
80 } 80 }
81 else if ( it->getType() == MAILLIB::A_POP3 ) 81 else if ( it->getType() == MAILLIB::A_POP3 )
82 { 82 {
83 POP3account *pop3 = static_cast<POP3account *>(it); 83 POP3account *pop3 = static_cast<POP3account *>(it);
84 /* must not be hold 'cause it isn't required */ 84 /* must not be hold 'cause it isn't required */
85 (void) new POP3viewItem( pop3, this ); 85 (void) new POP3viewItem( pop3, this );
86 } 86 }
87 else if ( it->getType() == MAILLIB::A_NNTP ) 87 else if ( it->getType() == MAILLIB::A_NNTP )
88 { 88 {
89 NNTPaccount *nntp = static_cast<NNTPaccount *>(it); 89 NNTPaccount *nntp = static_cast<NNTPaccount *>(it);
90 /* must not be hold 'cause it isn't required */ 90 /* must not be hold 'cause it isn't required */
91 (void) new NNTPviewItem( nntp, this ); 91 (void) new NNTPviewItem( nntp, this );
92 } 92 }
93 } 93 }
94} 94}
95 95
96void AccountView::refresh(QListViewItem *item) 96void AccountView::refresh(QListViewItem *item)
97{ 97{
98 if ( item ) 98 if ( item )
99 { 99 {
100 int result = KMessageBox::warningContinueCancel(this, 100 bool ask = true;
101 qDebug("text -%s- ",item->text( 0 ).latin1() );
102 if ( item->text( 0 ) == i18n (" Local Mailfolders") )
103 ask = false;
104 else {
105 if ( item->parent() )
106 if ( item->parent()->text( 0 ) == i18n (" Local Mailfolders") )
107 ask = false;
108 }
109 if ( ask ) {
110 int result = KMessageBox::warningContinueCancel(this,
101 i18n("Refresh\n%1\n?").arg( item->text(0) ), 111 i18n("Refresh\n%1\n?").arg( item->text(0) ),
102 i18n("Refresh"),i18n("Refresh"),i18n("Cancel"), 112 i18n("Refresh"),i18n("Refresh"),i18n("Cancel"),
103 true); 113 true);
104 if (result != KMessageBox::Continue) return; 114 if (result != KMessageBox::Continue) return;
115 }
105 m_currentItem = item; 116 m_currentItem = item;
106 topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ; 117 topLevelWidget()->setCaption( i18n ( "Refreshing %1 ... please wait" ). arg ( m_currentItem->text( 0 ) ) ) ;
107 QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) ); 118 QTimer::singleShot( 500, this, SLOT ( refreshCurrentSelected() ) );
108 119
109 } 120 }
110} 121}
111void AccountView::refreshOutgoing() 122void AccountView::refreshOutgoing()
112{ 123{
113 m_currentItem = currentItem(); 124 m_currentItem = currentItem();
114 if ( !m_currentItem ) return; 125 if ( !m_currentItem ) return;
115 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); 126 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem);
116 if ( !view->getFolder() ) 127 if ( !view->getFolder() )
117 return; 128 return;
118 QString bName = view->getFolder()->getDisplayName(); 129 QString bName = view->getFolder()->getDisplayName();
119 if (bName.startsWith("/")&&bName.length()>1) 130 if (bName.startsWith("/")&&bName.length()>1)
120 { 131 {
121 bName.replace(0,1,""); 132 bName.replace(0,1,"");
122 } 133 }
123 int pos = bName.findRev("/"); 134 int pos = bName.findRev("/");
124 if (pos > 0) 135 if (pos > 0)
125 { 136 {
126 bName.replace(0,pos+1,""); 137 bName.replace(0,pos+1,"");
127 } 138 }
128 //qDebug("name *%s* ",bName.lower().latin1() ); 139 //qDebug("name *%s* ",bName.lower().latin1() );