summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-11 19:26:02 (UTC)
committer zautrix <zautrix>2005-03-11 19:26:02 (UTC)
commit1166a4797a91cedd5002a3513d5028c5e86016f0 (patch) (side-by-side diff)
tree8e7443bc887a15dcf3852abd36e6e61f2e6bddad
parent71462ba8ef1803787bba6793f1adb85987eb57df (diff)
downloadkdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.zip
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.gz
kdepimpi-1166a4797a91cedd5002a3513d5028c5e86016f0.tar.bz2
better kopi export
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--kmicromail/editaccounts.cpp12
-rw-r--r--kmicromail/libmailwrapper/smtpwrapper.cpp17
-rw-r--r--korganizer/kolistview.cpp37
-rw-r--r--korganizer/kolistview.h2
5 files changed, 62 insertions, 11 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 246ab3d..2084d0d 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1297,4 +1297,8 @@
{ "Export","Exportiere" },
{ "Beam","Beame" },
+{ "Export selected","Exportiere Selektierte" },
+{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
+{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
+{ "Journal/Details...","Journale/Details..." },
{ "","" },
{ "","" },
@@ -1304,3 +1308,2 @@
{ "","" },
{ "","" },
-
diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp
index 49049f6..2c0f2d8 100644
--- a/kmicromail/editaccounts.cpp
+++ b/kmicromail/editaccounts.cpp
@@ -348,4 +348,5 @@ void IMAPconfig::slotConnectionToggle( int index )
{
portLine->setText( IMAP_SSL_PORT );
+ CommandEdit->hide();
}
else if ( index == 3 )
@@ -357,4 +358,5 @@ void IMAPconfig::slotConnectionToggle( int index )
{
portLine->setText( IMAP_PORT );
+ CommandEdit->hide();
}
}
@@ -429,4 +431,5 @@ void POP3config::slotConnectionToggle( int index )
{
portLine->setText( POP3_SSL_PORT );
+ CommandEdit->hide();
}
else if ( index == 3 )
@@ -438,4 +441,5 @@ void POP3config::slotConnectionToggle( int index )
{
portLine->setText( POP3_PORT );
+ CommandEdit->hide();
}
}
@@ -521,10 +525,11 @@ void SMTPconfig::chooseSig()
void SMTPconfig::slotConnectionToggle( int index )
{
- // 2 is ssl connection
- if ( index == 2 )
+ // 3 is ssl connection
+ if ( index == 3 )
{
portLine->setText( SMTP_SSL_PORT );
+ CommandEdit->hide();
}
- else if ( index == 3 )
+ else if ( index == 4 )
{
portLine->setText( SMTP_PORT );
@@ -534,4 +539,5 @@ void SMTPconfig::slotConnectionToggle( int index )
{
portLine->setText( SMTP_PORT );
+ CommandEdit->hide();
}
}
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp
index 872a460..845c71c 100644
--- a/kmicromail/libmailwrapper/smtpwrapper.cpp
+++ b/kmicromail/libmailwrapper/smtpwrapper.cpp
@@ -245,5 +245,5 @@ void SMTPwrapper::connect_server()
}
}
- if (try_tls) {
+ if (result && try_tls) {
qDebug("Smpt: Try tls ");
err = start_smtp_tls();
@@ -253,4 +253,6 @@ void SMTPwrapper::connect_server()
} else {
err = mailesmtp_ehlo(m_smtp);
+ if ( err != MAILSMTP_NO_ERROR )
+ result = 0;
}
}
@@ -291,4 +293,8 @@ void SMTPwrapper::connect_server()
}
}
+ if ( result == 0 ) {
+ mailsmtp_free(m_smtp);
+ m_smtp = 0;
+ }
}
@@ -348,4 +354,8 @@ bool SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later
sendProgress = 0;
mailmime_free( mimeMail );
+ if ( m_smtp ) {
+ mailsmtp_free(m_smtp);
+ m_smtp = 0;
+ }
}
return result;
@@ -459,4 +469,5 @@ bool SMTPwrapper::flushOutbox() {
m_SmtpAccount->setPassword(oldPw);
}
+
KConfig cfg( locateLocal("config", "kopiemailrc" ) );
cfg.setGroup( "Status" );
@@ -469,4 +480,8 @@ bool SMTPwrapper::flushOutbox() {
wrap->deleteMails(mbox,mailsToRemove);
delete wrap;
+ if ( m_smtp ) {
+ mailsmtp_free(m_smtp);
+ m_smtp = 0;
+ }
return returnValue;
}
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 710a9f9..f235705 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -266,10 +266,12 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
SLOT(deleteAll()),true);
mPopupMenu->insertSeparator();
- mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
- i18n("Save selected to file..."),this,
- SLOT(saveToFile()),true);
- mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
- i18n("Save Journal/Description..."),this,
- SLOT(saveDescriptionToFile()),true);
+ QPopupMenu * exportPO = new QPopupMenu ( this );
+ mPopupMenu->insertItem( i18n("Export selected"), exportPO );
+ exportPO->insertItem( i18n("As iCal (ics) file..."),this,
+ SLOT(saveToFile()));
+ exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
+ SLOT(saveToFileVCS()));
+ exportPO->insertItem( i18n("Journal/Details..."),this,
+ SLOT(saveDescriptionToFile()));
// mPopupMenu->insertSeparator();
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
@@ -607,6 +609,14 @@ void KOListView::saveDescriptionToFile()
}
}
+void KOListView::saveToFileVCS()
+{
+ writeToFile( false );
+}
void KOListView::saveToFile()
{
+ writeToFile( true );
+}
+void KOListView::writeToFile( bool iCal )
+{
int icount = 0;
@@ -623,4 +633,14 @@ void KOListView::saveToFile()
if ( icount ) {
QString fn = KOPrefs::instance()->mLastSaveFile;
+ QString extension;
+ if ( iCal ) {
+ if ( fn.right( 4 ).lower() == ".vcs" ) {
+ fn = fn.left( fn.length() -3) + "ics";
+ }
+ } else {
+ if ( fn.right( 4 ).lower() == ".ics" ) {
+ fn = fn.left( fn.length() -3) + "vcs";
+ }
+ }
fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this );
@@ -648,6 +668,11 @@ void KOListView::saveToFile()
incidence = delSel.next();
}
+ if ( iCal ) {
ICalFormat format;
format.save( &cal, fn );
+ } else {
+ VCalFormat format;
+ format.save( &cal, fn );
+ }
mes = i18n("KO/Pi:Saved %1").arg(fn );
KOPrefs::instance()->mLastSaveFile = fn;
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index c86449d..0d9c525 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -273,4 +273,5 @@ class KOListView : public KOEventView
void deleteAll();
void saveToFile();
+ void saveToFileVCS();
void saveDescriptionToFile();
void beamSelected();
@@ -289,4 +290,5 @@ class KOListView : public KOEventView
protected:
+ void writeToFile( bool iCal );
void addEvents(QPtrList<Event> eventList);
void addIncidence(Incidence *);