summaryrefslogtreecommitdiffabout
path: root/kmicromail
Unidiff
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/accountitem.cpp14
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp4
-rw-r--r--kmicromail/libmailwrapper/mhwrapper.cpp2
-rw-r--r--kmicromail/libmailwrapper/settings.cpp4
-rw-r--r--kmicromail/mainwindow.cpp7
-rw-r--r--kmicromail/mainwindow.h1
-rw-r--r--kmicromail/opiemail.cpp10
-rw-r--r--kmicromail/opiemail.h1
8 files changed, 28 insertions, 15 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp
index 7b9b881..59c8abb 100644
--- a/kmicromail/accountitem.cpp
+++ b/kmicromail/accountitem.cpp
@@ -15,8 +15,10 @@
15#include <qpopupmenu.h> 15#include <qpopupmenu.h>
16#include <qmessagebox.h> 16#include <qmessagebox.h>
17#include <kiconloader.h> 17#include <kiconloader.h>
18 18
19#define GET_NEW_MAILS 101
20
19using namespace Opie::Core; 21using namespace Opie::Core;
20#define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} 22#define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );}
21/** 23/**
22 * POP3 Account stuff 24 * POP3 Account stuff
@@ -91,14 +93,14 @@ QPopupMenu * POP3viewItem::getContextMenu()
91 if (!account->getOffline()) 93 if (!account->getOffline())
92 { 94 {
93 m->insertItem(QObject::tr("Disconnect",contextName),0); 95 m->insertItem(QObject::tr("Disconnect",contextName),0);
94 m->insertItem(QObject::tr("Set offline",contextName),1); 96 m->insertItem(QObject::tr("Set offline",contextName),1);
95 m->insertItem(QObject::tr("Download new INBOX messages",contextName),2); 97 m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
96 } 98 }
97 else 99 else
98 { 100 {
99 m->insertItem(QObject::tr("Set online",contextName),1); 101 m->insertItem(QObject::tr("Set online",contextName),1);
100 m->insertItem(QObject::tr("Download new INBOX messages",contextName),2); 102 m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
101 } 103 }
102 } 104 }
103 return m; 105 return m;
104} 106}
@@ -136,9 +138,9 @@ void POP3viewItem::contextMenuSelected(int which)
136 break; 138 break;
137 case 1: 139 case 1:
138 setOnOffline(); 140 setOnOffline();
139 break; 141 break;
140 case 2: // daunlood 142 case GET_NEW_MAILS: // daunlood
141 if (account->getOffline()) 143 if (account->getOffline())
142 setOnOffline(); 144 setOnOffline();
143 AccountView*bl = accountView(); 145 AccountView*bl = accountView();
144 if (!bl) return; 146 if (!bl) return;
@@ -516,15 +518,15 @@ QPopupMenu * IMAPviewItem::getContextMenu()
516 m->insertSeparator(); 518 m->insertSeparator();
517 m->insertItem(QObject::tr("Disconnect",contextName),2); 519 m->insertItem(QObject::tr("Disconnect",contextName),2);
518 m->insertItem(QObject::tr("Set offline",contextName),3); 520 m->insertItem(QObject::tr("Set offline",contextName),3);
519 m->insertSeparator(); 521 m->insertSeparator();
520 m->insertItem(QObject::tr("Download new INBOX messages",contextName),4); 522 m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
521 } 523 }
522 else 524 else
523 { 525 {
524 m->insertItem(QObject::tr("Set online",contextName),3); 526 m->insertItem(QObject::tr("Set online",contextName),3);
525 m->insertSeparator(); 527 m->insertSeparator();
526 m->insertItem(QObject::tr("Download new INBOX messages",contextName),4); 528 m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS);
527 } 529 }
528 } 530 }
529 return m; 531 return m;
530} 532}
@@ -576,9 +578,9 @@ void IMAPviewItem::contextMenuSelected(int id)
576 account->save(); 578 account->save();
577 SETPIX(PIXMAP_IMAPFOLDER); 579 SETPIX(PIXMAP_IMAPFOLDER);
578 refreshFolders(false); 580 refreshFolders(false);
579 break; 581 break;
580 case 4: // daunlood 582 case GET_NEW_MAILS: // daunlood
581 { 583 {
582 if (account->getOffline()) { 584 if (account->getOffline()) {
583 contextMenuSelected( 3 ); 585 contextMenuSelected( 3 );
584 } 586 }
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 5441a9b..91332c3 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -170,9 +170,9 @@ void IMAPwrapper::login()
170 force_tls = true; 170 force_tls = true;
171 } 171 }
172 172
173 if ( ssl ) { 173 if ( ssl ) {
174 qDebug("using ssl "); 174 //qDebug("using ssl ");
175 err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); 175 err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port );
176 } else { 176 } else {
177 err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); 177 err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port );
178 } 178 }
@@ -1246,9 +1246,9 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1246 if (targetWrapper != this || maxSizeInKb > 0 ) { 1246 if (targetWrapper != this || maxSizeInKb > 0 ) {
1247 mMax = 0; 1247 mMax = 0;
1248 progress( tr("Copy")); 1248 progress( tr("Copy"));
1249 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb); 1249 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit, maxSizeInKb);
1250 qDebug("IMAPwrapper::mvcpAllMails::Using generic"); 1250 //qDebug("IMAPwrapper::mvcpAllMails::Using generic");
1251 // odebug << "Using generic" << oendl; 1251 // odebug << "Using generic" << oendl;
1252 return; 1252 return;
1253 } 1253 }
1254 mailimap_set *set = 0; 1254 mailimap_set *set = 0;
diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp
index 962dac0..641d4d9 100644
--- a/kmicromail/libmailwrapper/mhwrapper.cpp
+++ b/kmicromail/libmailwrapper/mhwrapper.cpp
@@ -64,9 +64,8 @@ MHwrapper::~MHwrapper()
64} 64}
65 65
66void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) 66void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb )
67{ 67{
68 qDebug("MHwrapper::listMessages ");
69 init_storage(); 68 init_storage();
70 if (!m_storage) { 69 if (!m_storage) {
71 return; 70 return;
72 } 71 }
@@ -193,9 +192,8 @@ int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QStri
193 if (r != MAIL_NO_ERROR) { 192 if (r != MAIL_NO_ERROR) {
194 qDebug("error creating folder "); 193 qDebug("error creating folder ");
195 return 0; 194 return 0;
196 } 195 }
197 qDebug("Folder created ");
198 return 1; 196 return 1;
199} 197}
200 198
201void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) 199void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp
index 766eba0..40b5591 100644
--- a/kmicromail/libmailwrapper/settings.cpp
+++ b/kmicromail/libmailwrapper/settings.cpp
@@ -25,9 +25,8 @@ Settings::Settings()
25} 25}
26 26
27void Settings::checkDirectory() 27void Settings::checkDirectory()
28{ 28{
29 qDebug("Settings::checkDirectory() ");
30 return; 29 return;
31 locateLocal("data", "kopiemail" ); 30 locateLocal("data", "kopiemail" );
32 /* 31 /*
33 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { 32 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
@@ -209,17 +208,16 @@ void IMAPaccount::read()
209 maxMailSize = conf->readNumEntry( "MaxSize",0 ); 208 maxMailSize = conf->readNumEntry( "MaxSize",0 );
210 int lf = conf->readNumEntry( "LastFetch",0 ); 209 int lf = conf->readNumEntry( "LastFetch",0 );
211 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) ); 210 QDateTime dt ( QDate ( 2004, 1, 1 ), QTime( 0,0,0) );
212 leaveOnServer = conf->readBoolEntry("LeaveOnServer",false); 211 leaveOnServer = conf->readBoolEntry("LeaveOnServer",false);
213 qDebug("reading last fetch: %d ", lf);
214 if ( lf < 0 ) lf = 0; 212 if ( lf < 0 ) lf = 0;
215 lastFetch = dt.addSecs( lf ); 213 lastFetch = dt.addSecs( lf );
216 delete conf; 214 delete conf;
217} 215}
218 216
219void IMAPaccount::save() 217void IMAPaccount::save()
220{ 218{
221 qDebug("saving %s ",getFileName().latin1() ); 219
222 Settings::checkDirectory(); 220 Settings::checkDirectory();
223 221
224 KConfig *conf = new KConfig( getFileName() ); 222 KConfig *conf = new KConfig( getFileName() );
225 conf->setGroup( "IMAP Account" ); 223 conf->setGroup( "IMAP Account" );
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 21edfd2..5f777a3 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -34,9 +34,14 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
34 34
35 addToolBar( toolBar ); 35 addToolBar( toolBar );
36 toolBar->setHorizontalStretchable( true ); 36 toolBar->setHorizontalStretchable( true );
37 37
38 38 QAction* getMail = new QAction( tr( "Get new mail" ), SmallIcon("add"),
39 0, 0, this );
40 getMail->addTo( toolBar );
41 getMail->addTo( mailMenu );
42 connect(getMail, SIGNAL( activated() ),
43 SLOT( slotGetMail() ) );
39 44
40 composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"), 45 composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"),
41 0, 0, this ); 46 0, 0, this );
42 composeMail->addTo( toolBar ); 47 composeMail->addTo( toolBar );
diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h
index 680f0a9..ff0ff20 100644
--- a/kmicromail/mainwindow.h
+++ b/kmicromail/mainwindow.h
@@ -40,8 +40,9 @@ protected slots:
40 virtual void slotEditAccounts(); 40 virtual void slotEditAccounts();
41 virtual void slotShowFolders( bool show ); 41 virtual void slotShowFolders( bool show );
42 virtual void refreshMailView(const QValueList<RecMailP>&); 42 virtual void refreshMailView(const QValueList<RecMailP>&);
43 virtual void displayMail(); 43 virtual void displayMail();
44 virtual void slotGetMail() = 0;
44 virtual void slotDeleteMail(); 45 virtual void slotDeleteMail();
45 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 46 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
46 virtual void slotAdjustLayout(); 47 virtual void slotAdjustLayout();
47 virtual void slotEditSettings(); 48 virtual void slotEditSettings();
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index b2119e6..19ffdb3 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -8,8 +8,9 @@
8#include "mailistviewitem.h" 8#include "mailistviewitem.h"
9#include "viewmail.h" 9#include "viewmail.h"
10#include "selectstore.h" 10#include "selectstore.h"
11#include "selectsmtp.h" 11#include "selectsmtp.h"
12#include "accountitem.h"
12 13
13#include <qmessagebox.h> 14#include <qmessagebox.h>
14#include <qtimer.h> 15#include <qtimer.h>
15#include <libkdepim/externalapphandler.h> 16#include <libkdepim/externalapphandler.h>
@@ -243,9 +244,16 @@ void OpieMail::displayMail()
243 { 244 {
244 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); 245 ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() );
245 } 246 }
246} 247}
247 248void OpieMail::slotGetMail()
249{
250 QListViewItem * item = folderView->currentItem();
251 if ( ! item ) return;
252 while ( item->parent () )
253 item = item->parent ();
254 ((AccountViewItem *)item)->contextMenuSelected( 101 );
255}
248void OpieMail::slotDeleteMail() 256void OpieMail::slotDeleteMail()
249{ 257{
250 if (!mailView->currentItem()) return; 258 if (!mailView->currentItem()) return;
251 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); 259 RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data();
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index 1de5f6b..e054b9e 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -29,8 +29,9 @@ protected slots:
29 virtual void slotEditSettings(); 29 virtual void slotEditSettings();
30 virtual void slotEditAccounts(); 30 virtual void slotEditAccounts();
31 virtual void displayMail(); 31 virtual void displayMail();
32 virtual void slotDeleteMail(); 32 virtual void slotDeleteMail();
33 virtual void slotGetMail();
33 virtual void slotDeleteAllMail(); 34 virtual void slotDeleteAllMail();
34 virtual void mailHold(int, QListViewItem *,const QPoint&,int); 35 virtual void mailHold(int, QListViewItem *,const QPoint&,int);
35 virtual void slotShowFolders( bool show ); 36 virtual void slotShowFolders( bool show );
36 virtual void refreshMailView(const QValueList<RecMailP>&); 37 virtual void refreshMailView(const QValueList<RecMailP>&);