Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 3466801..39d8321 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -82,2 +82,4 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
82 | caseSensitive(false), | 82 | caseSensitive(false), |
83 | m_useQtMail(true), | ||
84 | m_useOpieMail(false), | ||
83 | bAbEditFirstTime(TRUE), | 85 | bAbEditFirstTime(TRUE), |
@@ -93,2 +95,6 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
93 | doNotifyWrapAround = cfg.readBoolEntry( "doNotifyWrapAround" ); | 95 | doNotifyWrapAround = cfg.readBoolEntry( "doNotifyWrapAround" ); |
96 | cfg.setGroup("Mail"); | ||
97 | m_useQtMail = cfg.readBoolEntry( "useQtMail" ); | ||
98 | m_useOpieMail=cfg.readBoolEntry( "useOpieMail" ); | ||
99 | |||
94 | 100 | ||
@@ -171,3 +177,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
171 | 177 | ||
172 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "qtmail/reply" ), | 178 | a = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "mail/sendmail" ), |
173 | QString::null, 0, this, 0 ); | 179 | QString::null, 0, this, 0 ); |
@@ -284,2 +290,4 @@ void AddressbookWindow::slotConfig() | |||
284 | dlg -> setSignalWrapAround( doNotifyWrapAround ); | 290 | dlg -> setSignalWrapAround( doNotifyWrapAround ); |
291 | dlg -> setQtMail ( m_useQtMail ); | ||
292 | dlg -> setOpieMail ( m_useOpieMail ); | ||
285 | dlg -> showMaximized(); | 293 | dlg -> showMaximized(); |
@@ -290,2 +298,4 @@ void AddressbookWindow::slotConfig() | |||
290 | doNotifyWrapAround = dlg -> signalWrapAround(); | 298 | doNotifyWrapAround = dlg -> signalWrapAround(); |
299 | m_useQtMail = dlg -> useQtMail(); | ||
300 | m_useOpieMail= dlg -> useOpieMail(); | ||
291 | } | 301 | } |
@@ -382,2 +392,5 @@ AddressbookWindow::~AddressbookWindow() | |||
382 | cfg.writeEntry("doNotifyWrapAround", doNotifyWrapAround); | 392 | cfg.writeEntry("doNotifyWrapAround", doNotifyWrapAround); |
393 | cfg.setGroup("Mail"); | ||
394 | cfg.writeEntry( "useQtMail", m_useQtMail ); | ||
395 | cfg.writeEntry( "useOpieMail", m_useOpieMail); | ||
383 | } | 396 | } |
@@ -496,4 +509,32 @@ void AddressbookWindow::writeMail() | |||
496 | QString email = c.defaultEmail(); | 509 | QString email = c.defaultEmail(); |
497 | QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)"); | 510 | |
498 | e << name << email; | 511 | // I prefer the OPIE-Environment variable before the |
512 | // QPE-one.. | ||
513 | QString basepath = QString::fromLatin1( getenv("OPIEDIR") ); | ||
514 | if ( basepath.isEmpty() ) | ||
515 | basepath = QString::fromLatin1( getenv("QPEDIR") ); | ||
516 | |||
517 | // Try to access the preferred. If not possible, try to | ||
518 | // switch to the other one.. | ||
519 | if ( m_useQtMail ){ | ||
520 | qWarning ("Accessing: %s", (basepath + "/bin/qtmail").latin1()); | ||
521 | if ( QFile::exists( basepath + "/bin/qtmail" ) ){ | ||
522 | qWarning ("QCop"); | ||
523 | QCopEnvelope e("QPE/Application/qtmail", "writeMail(QString,QString)"); | ||
524 | e << name << email; | ||
525 | return; | ||
526 | } else | ||
527 | m_useOpieMail = true; | ||
528 | } | ||
529 | if ( m_useOpieMail ){ | ||
530 | qWarning ("Accessing: %s", (basepath + "/bin/mail").latin1()); | ||
531 | if ( QFile::exists( basepath + "/bin/mail" ) ){ | ||
532 | qWarning ("QCop"); | ||
533 | QCopEnvelope e("QPE/Application/mail", "writeMail(QString,QString)"); | ||
534 | e << name << email; | ||
535 | return; | ||
536 | } else | ||
537 | m_useQtMail = true; | ||
538 | } | ||
539 | |||
499 | } | 540 | } |