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.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index f0a163e..0052061 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -45,72 +45,72 @@ void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int)
45 AccountViewItem *view = static_cast<AccountViewItem *>(item); 45 AccountViewItem *view = static_cast<AccountViewItem *>(item);
46 QPopupMenu*m = view->getContextMenu(); 46 QPopupMenu*m = view->getContextMenu();
47 if (!m) return; 47 if (!m) return;
48 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); 48 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int)));
49 m->setFocus(); 49 m->setFocus();
50 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 50 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
51 delete m; 51 delete m;
52} 52}
53 53
54void AccountView::populate( QList<Account> list ) 54void AccountView::populate( QList<Account> list )
55{ 55{
56 clear(); 56 clear();
57 57
58 imapAccounts.clear(); 58 imapAccounts.clear();
59 mhAccounts.clear(); 59 mhAccounts.clear();
60 60
61 mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); 61 mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this));
62 62
63 Account *it; 63 Account *it;
64 for ( it = list.first(); it; it = list.next() ) 64 for ( it = list.first(); it; it = list.next() )
65 { 65 {
66 if ( it->getType() == MAILLIB::A_IMAP ) 66 if ( it->getType() == MAILLIB::A_IMAP )
67 { 67 {
68 IMAPaccount *imap = static_cast<IMAPaccount *>(it); 68 IMAPaccount *imap = static_cast<IMAPaccount *>(it);
69 qDebug( "added IMAP " + imap->getAccountName() ); 69 odebug << "added IMAP " + imap->getAccountName() << oendl;
70 imapAccounts.append(new IMAPviewItem( imap, this )); 70 imapAccounts.append(new IMAPviewItem( imap, this ));
71 } 71 }
72 else if ( it->getType() == MAILLIB::A_POP3 ) 72 else if ( it->getType() == MAILLIB::A_POP3 )
73 { 73 {
74 POP3account *pop3 = static_cast<POP3account *>(it); 74 POP3account *pop3 = static_cast<POP3account *>(it);
75 qDebug( "added POP3 " + pop3->getAccountName() ); 75 odebug << "added POP3 " + pop3->getAccountName() << oendl;
76 /* must not be hold 'cause it isn't required */ 76 /* must not be hold 'cause it isn't required */
77 (void) new POP3viewItem( pop3, this ); 77 (void) new POP3viewItem( pop3, this );
78 } 78 }
79 else if ( it->getType() == MAILLIB::A_NNTP ) 79 else if ( it->getType() == MAILLIB::A_NNTP )
80 { 80 {
81 NNTPaccount *nntp = static_cast<NNTPaccount *>(it); 81 NNTPaccount *nntp = static_cast<NNTPaccount *>(it);
82 qDebug( "added NNTP " + nntp->getAccountName() ); 82 odebug << "added NNTP " + nntp->getAccountName() << oendl;
83 /* must not be hold 'cause it isn't required */ 83 /* must not be hold 'cause it isn't required */
84 (void) new NNTPviewItem( nntp, this ); 84 (void) new NNTPviewItem( nntp, this );
85 } 85 }
86 } 86 }
87} 87}
88 88
89void AccountView::refresh(QListViewItem *item) 89void AccountView::refresh(QListViewItem *item)
90{ 90{
91 91
92 qDebug("AccountView refresh..."); 92 odebug << "AccountView refresh..." << oendl;
93 if ( item ) 93 if ( item )
94 { 94 {
95 m_currentItem = item; 95 m_currentItem = item;
96 QValueList<RecMailP> headerlist; 96 QValueList<RecMailP> headerlist;
97 AccountViewItem *view = static_cast<AccountViewItem *>(item); 97 AccountViewItem *view = static_cast<AccountViewItem *>(item);
98 view->refresh(headerlist); 98 view->refresh(headerlist);
99 emit refreshMailview(headerlist); 99 emit refreshMailview(headerlist);
100 } 100 }
101} 101}
102 102
103void AccountView::refreshCurrent() 103void AccountView::refreshCurrent()
104{ 104{
105 m_currentItem = currentItem(); 105 m_currentItem = currentItem();
106 if ( !m_currentItem ) return; 106 if ( !m_currentItem ) return;
107 QValueList<RecMailP> headerlist; 107 QValueList<RecMailP> headerlist;
108 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); 108 AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem);
109 view->refresh(headerlist); 109 view->refresh(headerlist);
110 emit refreshMailview(headerlist); 110 emit refreshMailview(headerlist);
111} 111}
112 112
113void AccountView::refreshAll() 113void AccountView::refreshAll()
114{ 114{
115} 115}
116 116
@@ -141,36 +141,36 @@ void AccountView::setupFolderselect(Selectstore*sels)
141 sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); 141 sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders());
142 } 142 }
143} 143}
144 144
145void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper) 145void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrapper)
146{ 146{
147 AbstractMail*targetMail = 0; 147 AbstractMail*targetMail = 0;
148 QString targetFolder = ""; 148 QString targetFolder = "";
149 Selectstore sels; 149 Selectstore sels;
150 setupFolderselect(&sels); 150 setupFolderselect(&sels);
151 if (!sels.exec()) return; 151 if (!sels.exec()) return;
152 targetMail = sels.currentMail(); 152 targetMail = sels.currentMail();
153 targetFolder = sels.currentFolder(); 153 targetFolder = sels.currentFolder();
154 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) || 154 if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) ||
155 targetFolder.isEmpty()) 155 targetFolder.isEmpty())
156 { 156 {
157 return; 157 return;
158 } 158 }
159 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 159 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
160 { 160 {
161 QMessageBox::critical(0,tr("Error creating new Folder"), 161 QMessageBox::critical(0,tr("Error creating new Folder"),
162 tr("<center>Error while creating<br>new folder - breaking.</center>")); 162 tr("<center>Error while creating<br>new folder - breaking.</center>"));
163 return; 163 return;
164 } 164 }
165 qDebug("Targetfolder: %s",targetFolder.latin1()); 165 odebug << "Targetfolder: " << targetFolder.latin1() << "" << oendl;
166 qDebug("Fromfolder: %s",fromFolder->getName().latin1()); 166 odebug << "Fromfolder: " << fromFolder->getName().latin1() << "" << oendl;
167 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); 167 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails());
168 refreshCurrent(); 168 refreshCurrent();
169} 169}
170 170
171bool AccountView::currentisDraft() 171bool AccountView::currentisDraft()
172{ 172{
173 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); 173 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
174 if (!view) return false; 174 if (!view) return false;
175 return view->isDraftfolder(); 175 return view->isDraftfolder();
176} 176}