summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp7
-rw-r--r--kmicromail/composemail.cpp8
-rw-r--r--libkdepim/externalapphandler.cpp3
-rw-r--r--libkdepim/kpimglobalprefs.cpp4
4 files changed, 15 insertions, 7 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 6522ccc..5cd9649 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1996,113 +1996,116 @@ void KABCore::updateActionMenu()
1996 1996
1997void KABCore::configureKeyBindings() 1997void KABCore::configureKeyBindings()
1998{ 1998{
1999#ifndef KAB_EMBEDDED 1999#ifndef KAB_EMBEDDED
2000 KKeyDialog::configure( actionCollection(), true ); 2000 KKeyDialog::configure( actionCollection(), true );
2001#else //KAB_EMBEDDED 2001#else //KAB_EMBEDDED
2002 qDebug("KABCore::configureKeyBindings() not implemented"); 2002 qDebug("KABCore::configureKeyBindings() not implemented");
2003#endif //KAB_EMBEDDED 2003#endif //KAB_EMBEDDED
2004} 2004}
2005 2005
2006#ifdef KAB_EMBEDDED 2006#ifdef KAB_EMBEDDED
2007void KABCore::configureResources() 2007void KABCore::configureResources()
2008{ 2008{
2009 KRES::KCMKResources dlg( this, "" , 0 ); 2009 KRES::KCMKResources dlg( this, "" , 0 );
2010 2010
2011 if ( !dlg.exec() ) 2011 if ( !dlg.exec() )
2012 return; 2012 return;
2013 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2013 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2014} 2014}
2015#endif //KAB_EMBEDDED 2015#endif //KAB_EMBEDDED
2016 2016
2017 2017
2018/* this method will be called through the QCop interface from Ko/Pi to select addresses 2018/* this method will be called through the QCop interface from Ko/Pi to select addresses
2019 * for the attendees list of an event. 2019 * for the attendees list of an event.
2020 */ 2020 */
2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2021void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2022{ 2022{
2023 QStringList nameList; 2023 QStringList nameList;
2024 QStringList emailList; 2024 QStringList emailList;
2025 QStringList uidList; 2025 QStringList uidList;
2026 2026
2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2027 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2028 uint i=0; 2028 uint i=0;
2029 for (i=0; i < list.count(); i++) 2029 for (i=0; i < list.count(); i++)
2030 { 2030 {
2031 nameList.append(list[i].realName()); 2031 nameList.append(list[i].realName());
2032 emailList.append(list[i].preferredEmail()); 2032 emailList.append(list[i].preferredEmail());
2033 uidList.append(list[i].uid()); 2033 uidList.append(list[i].uid());
2034 } 2034 }
2035 2035
2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); 2036 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList);
2037 2037
2038} 2038}
2039 2039
2040/* this method will be called through the QCop interface from other apps to show details of a contact. 2040/* this method will be called through the QCop interface from other apps to show details of a contact.
2041 */ 2041 */
2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2042void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2043{ 2043{
2044 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2044 qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2045 2045
2046 QString foundUid = QString::null; 2046 QString foundUid = QString::null;
2047 if ( ! uid.isEmpty() ) { 2047 if ( ! uid.isEmpty() ) {
2048 Addressee adrr = mAddressBook->findByUid( uid ); 2048 Addressee adrr = mAddressBook->findByUid( uid );
2049 if ( !adrr.isEmpty() ) { 2049 if ( !adrr.isEmpty() ) {
2050 foundUid = uid; 2050 foundUid = uid;
2051 }
2051 if ( email == "sendbacklist" ) { 2052 if ( email == "sendbacklist" ) {
2053 qDebug("ssssssssssssssssssssssend ");
2052 QStringList nameList; 2054 QStringList nameList;
2053 QStringList emailList; 2055 QStringList emailList;
2054 QStringList uidList; 2056 QStringList uidList;
2055 nameList.append(adrr.realName()); 2057 nameList.append(adrr.realName());
2056 emailList = adrr.emails(); 2058 emailList = adrr.emails();
2057 uidList.append( adrr.preferredEmail()); 2059 uidList.append( adrr.preferredEmail());
2058 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 2060 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2061 return;
2059 } 2062 }
2060 } 2063
2061 } 2064 }
2062 2065
2063 if ( email == "sendback" ) 2066 if ( email == "sendback" )
2064 return; 2067 return;
2065 if (foundUid.isEmpty()) 2068 if (foundUid.isEmpty())
2066 { 2069 {
2067 //find the uid of the person first 2070 //find the uid of the person first
2068 Addressee::List namelist; 2071 Addressee::List namelist;
2069 Addressee::List emaillist; 2072 Addressee::List emaillist;
2070 2073
2071 if (!name.isEmpty()) 2074 if (!name.isEmpty())
2072 namelist = mAddressBook->findByName( name ); 2075 namelist = mAddressBook->findByName( name );
2073 2076
2074 if (!email.isEmpty()) 2077 if (!email.isEmpty())
2075 emaillist = mAddressBook->findByEmail( email ); 2078 emaillist = mAddressBook->findByEmail( email );
2076 qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2079 qDebug("count %d %d ", namelist.count(),emaillist.count() );
2077 //check if we have a match in Namelist and Emaillist 2080 //check if we have a match in Namelist and Emaillist
2078 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2081 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2079 foundUid = emaillist[0].uid(); 2082 foundUid = emaillist[0].uid();
2080 } 2083 }
2081 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2084 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2082 foundUid = namelist[0].uid(); 2085 foundUid = namelist[0].uid();
2083 else 2086 else
2084 { 2087 {
2085 for (int i = 0; i < namelist.count(); i++) 2088 for (int i = 0; i < namelist.count(); i++)
2086 { 2089 {
2087 for (int j = 0; j < emaillist.count(); j++) 2090 for (int j = 0; j < emaillist.count(); j++)
2088 { 2091 {
2089 if (namelist[i] == emaillist[j]) 2092 if (namelist[i] == emaillist[j])
2090 { 2093 {
2091 foundUid = namelist[i].uid(); 2094 foundUid = namelist[i].uid();
2092 } 2095 }
2093 } 2096 }
2094 } 2097 }
2095 } 2098 }
2096 } 2099 }
2097 else 2100 else
2098 { 2101 {
2099 foundUid = uid; 2102 foundUid = uid;
2100 } 2103 }
2101 2104
2102 if (!foundUid.isEmpty()) 2105 if (!foundUid.isEmpty())
2103 { 2106 {
2104 2107
2105 // raise Ka/Pi if it is in the background 2108 // raise Ka/Pi if it is in the background
2106#ifndef DESKTOP_VERSION 2109#ifndef DESKTOP_VERSION
2107#ifndef KORG_NODCOP 2110#ifndef KORG_NODCOP
2108 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2111 //QCopEnvelope e("QPE/Application/kapi", "raise()");
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 5f446fa..f7604ad 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -5,97 +5,103 @@
5#include <libmailwrapper/smtpwrapper.h> 5#include <libmailwrapper/smtpwrapper.h>
6#include <libmailwrapper/storemail.h> 6#include <libmailwrapper/storemail.h>
7#include <libmailwrapper/abstractmail.h> 7#include <libmailwrapper/abstractmail.h>
8#include <libmailwrapper/mailtypes.h> 8#include <libmailwrapper/mailtypes.h>
9 9
10/* OPIE */ 10/* OPIE */
11//#include <opie2/ofiledialog.h> 11//#include <opie2/ofiledialog.h>
12//#include <opie2/odebug.h> 12//#include <opie2/odebug.h>
13#include <kfiledialog.h> 13#include <kfiledialog.h>
14//#include <qpe/resource.h> 14//#include <qpe/resource.h>
15#include <qpe/config.h> 15#include <qpe/config.h>
16#include <qpe/global.h> 16#include <qpe/global.h>
17//#include <qpe/contact.h> 17//#include <qpe/contact.h>
18 18
19 19
20#include <qcombobox.h> 20#include <qcombobox.h>
21#include <qcheckbox.h> 21#include <qcheckbox.h>
22#include <qtimer.h> 22#include <qtimer.h>
23#include <qmessagebox.h> 23#include <qmessagebox.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qmultilineedit.h> 25#include <qmultilineedit.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qtabwidget.h> 27#include <qtabwidget.h>
28#include <qlistview.h> 28#include <qlistview.h>
29#include <kabc/addresseedialog.h> 29#include <kabc/addresseedialog.h>
30#include <kabc/stdaddressbook.h> 30#include <kabc/stdaddressbook.h>
31#include <kabc/addressee.h> 31#include <kabc/addressee.h>
32#ifdef DESKTOP_VERSION 32#ifdef DESKTOP_VERSION
33#include <kabc/addresseedialog.h> 33#include <kabc/addresseedialog.h>
34#else //DESKTOP_VERSION 34#else //DESKTOP_VERSION
35#include <libkdepim/externalapphandler.h> 35#include <libkdepim/externalapphandler.h>
36#endif //DESKTOP_VERSION 36#endif //DESKTOP_VERSION
37 37
38 38
39//using namespace Opie::Core; 39//using namespace Opie::Core;
40//using namespace Opie::Ui; 40//using namespace Opie::Ui;
41ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 41ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
42 : ComposeMailUI( parent, name, modal, flags ) 42 : ComposeMailUI( parent, name, modal, flags )
43{ 43{
44 44
45 mPickLineEdit = 0; 45 mPickLineEdit = 0;
46 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 46 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
47 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 47 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
48 settings = s; 48 settings = s;
49 m_replyid = ""; 49 m_replyid = "";
50 KConfig config( locateLocal("config", "kabcrc") ); 50 KConfig config( locateLocal("config", "kabcrc") );
51 config.setGroup( "General" ); 51 config.setGroup( "General" );
52 QString whoami_uid = config.readEntry( "WhoAmI" ); 52 QString whoami_uid = config.readEntry( "WhoAmI" );
53 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); 53 if ( whoami_uid.isEmpty() ) {
54 QMessageBox::information( 0, tr( "Hint" ),
55 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
56 tr( "Ok" ) );
57
58 } else
59 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid);
54#ifdef DESKTOP_VERSION 60#ifdef DESKTOP_VERSION
55 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); 61 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( );
56 QStringList mails = con.emails(); 62 QStringList mails = con.emails();
57 QString defmail = con.preferredEmail(); 63 QString defmail = con.preferredEmail();
58 if ( mails.count() == 0) 64 if ( mails.count() == 0)
59 QMessageBox::information( 0, tr( "Hint" ), 65 QMessageBox::information( 0, tr( "Hint" ),
60 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 66 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
61 tr( "Ok" ) ); 67 tr( "Ok" ) );
62 if (defmail.length()!=0) { 68 if (defmail.length()!=0) {
63 fromBox->insertItem(defmail); 69 fromBox->insertItem(defmail);
64 } 70 }
65 QStringList::ConstIterator sit = mails.begin(); 71 QStringList::ConstIterator sit = mails.begin();
66 for (;sit!=mails.end();++sit) { 72 for (;sit!=mails.end();++sit) {
67 if ( (*sit)==defmail) 73 if ( (*sit)==defmail)
68 continue; 74 continue;
69 fromBox->insertItem((*sit)); 75 fromBox->insertItem((*sit));
70 } 76 }
71 senderNameEdit->setText(con.formattedName()); 77 senderNameEdit->setText(con.formattedName());
72#endif 78#endif
73 Config cfg( "mail" ); 79 Config cfg( "mail" );
74 cfg.setGroup( "Compose" ); 80 cfg.setGroup( "Compose" );
75 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 81 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
76 82
77 attList->addColumn( tr( "Name" ) ); 83 attList->addColumn( tr( "Name" ) );
78 attList->addColumn( tr( "Size" ) ); 84 attList->addColumn( tr( "Size" ) );
79 85
80 QList<Account> accounts = settings->getAccounts(); 86 QList<Account> accounts = settings->getAccounts();
81 87
82 Account *it; 88 Account *it;
83 for ( it = accounts.first(); it; it = accounts.next() ) { 89 for ( it = accounts.first(); it; it = accounts.next() ) {
84 if ( it->getType()==MAILLIB::A_SMTP ) { 90 if ( it->getType()==MAILLIB::A_SMTP ) {
85 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 91 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
86 smtpAccountBox->insertItem( smtp->getAccountName() ); 92 smtpAccountBox->insertItem( smtp->getAccountName() );
87 smtpAccounts.append( smtp ); 93 smtpAccounts.append( smtp );
88 } 94 }
89 } 95 }
90 if ( smtpAccounts.count() > 0 ) { 96 if ( smtpAccounts.count() > 0 ) {
91 fillValues( smtpAccountBox->currentItem() ); 97 fillValues( smtpAccountBox->currentItem() );
92 } else { 98 } else {
93 QMessageBox::information( 0, tr( "Problem" ), 99 QMessageBox::information( 0, tr( "Problem" ),
94 tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), 100 tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ),
95 tr( "Ok" ) ); 101 tr( "Ok" ) );
96 return; 102 return;
97 } 103 }
98 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); 104 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
99 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 105 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
100 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); 106 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
101 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); 107 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) );
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 6100097..5ba32b6 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -305,167 +305,166 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d
305 QStringList list3; 305 QStringList list3;
306 QString uid; 306 QString uid;
307 307
308 stream >> uid >> list1 >> list2 >> list3; 308 stream >> uid >> list1 >> list2 >> list3;
309 emit receivedMessageFromTarget(uid, list1, list2, list3); 309 emit receivedMessageFromTarget(uid, list1, list2, list3);
310 310
311 311
312 return true; 312 return true;
313 } 313 }
314 } 314 }
315 315
316 return false; 316 return false;
317} 317}
318 318
319 319
320 320
321/********************************************************************************* 321/*********************************************************************************
322 * 322 *
323 ********************************************************************************/ 323 ********************************************************************************/
324 324
325 325
326ExternalAppHandler *ExternalAppHandler::sInstance = 0; 326ExternalAppHandler *ExternalAppHandler::sInstance = 0;
327static KStaticDeleter<ExternalAppHandler> staticDeleter; 327static KStaticDeleter<ExternalAppHandler> staticDeleter;
328 328
329ExternalAppHandler::ExternalAppHandler() 329ExternalAppHandler::ExternalAppHandler()
330{ 330{
331 mDefaultItems.setAutoDelete(true); 331 mDefaultItems.setAutoDelete(true);
332 332
333 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); 333 mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList");
334 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); 334 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&)));
335 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 335 connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
336 336
337//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); 337//US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList");
338//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); 338//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&)));
339//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); 339//US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)));
340 340
341 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); 341 mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", "");
342 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 342 connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
343} 343}
344 344
345ExternalAppHandler::~ExternalAppHandler() 345ExternalAppHandler::~ExternalAppHandler()
346{ 346{
347} 347}
348 348
349void ExternalAppHandler::loadConfig() 349void ExternalAppHandler::loadConfig()
350{ 350{
351 351
352 mDefaultItems.clear(); 352 mDefaultItems.clear();
353
354 mEmailAppAvailable = UNDEFINED; 353 mEmailAppAvailable = UNDEFINED;
355 mPhoneAppAvailable = UNDEFINED; 354 mPhoneAppAvailable = UNDEFINED;
356 mFaxAppAvailable = UNDEFINED; 355 mFaxAppAvailable = UNDEFINED;
357 mSMSAppAvailable = UNDEFINED; 356 mSMSAppAvailable = UNDEFINED;
358 mPagerAppAvailable = UNDEFINED; 357 mPagerAppAvailable = UNDEFINED;
359 358
360 359
361 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); 360 QString opiepath = QString::fromLatin1( getenv("OPIEDIR") );
362 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); 361 QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") );
363 362
364 if (opiepath.isEmpty()) 363 if (opiepath.isEmpty())
365 opiepath = qtopiapath; 364 opiepath = qtopiapath;
366 365
367 //mailclients 366 //mailclients
368 QString mailmsg1 = "writeMail(QString,QString)"; 367 QString mailmsg1 = "writeMail(QString,QString)";
369 QString mailmsg2 = "writeMail(QMap(QString,QString))"; 368 QString mailmsg2 = "writeMail(QMap(QString,QString))";
370 369
371 QString undefined = ""; 370 QString undefined = "";
372 371
373 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined); 372 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC, "No email client installed", undefined, undefined, undefined, undefined, undefined);
374 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined); 373 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OTHER_EMC, "Userdefined email client", undefined, undefined, undefined, undefined, undefined);
375 374
376 if (( QFile::exists( qtopiapath + "/bin/ompi" )) || 375 if (( QFile::exists( qtopiapath + "/bin/ompi" )) ||
377 ( QFile::exists( opiepath + "/bin/ompi" ))) 376 ( QFile::exists( opiepath + "/bin/ompi" )))
378 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 377 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
379 378
380 if ( QFile::exists( qtopiapath + "/bin/qtmail" )) 379 if ( QFile::exists( qtopiapath + "/bin/qtmail" ))
381 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 380 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
382 381
383 if ( QFile::exists( opiepath + "/bin/opiemail" )) 382 if ( QFile::exists( opiepath + "/bin/opiemail" ))
384 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); 383 addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2");
385 384
386 385
387 386
388 //phoneclients 387 //phoneclients
389 388
390 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined); 389 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC, "No phone client installed", undefined, undefined, undefined, undefined, undefined);
391 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined); 390 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::OTHER_PHC, "Other phone client", undefined, undefined, undefined, undefined, undefined);
392 if (( QFile::exists( qtopiapath + "/bin/kppi" )) || 391 if (( QFile::exists( qtopiapath + "/bin/kppi" )) ||
393 ( QFile::exists( opiepath + "/bin/kppi" ))) 392 ( QFile::exists( opiepath + "/bin/kppi" )))
394 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined); 393 addDefaultAppItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::KPPI_PHC, "KP/Pi phone client", "QPE/Application/kppi", "-ring:%1", "", undefined, undefined);
395 394
396 //faxclients 395 //faxclients
397 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined); 396 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC, "No fax client installed", undefined, undefined, undefined, undefined, undefined);
398 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined); 397 addDefaultAppItem(ExternalAppHandler::FAX, KPimGlobalPrefs::OTHER_FAC, "Other fax client", undefined, undefined, undefined, undefined, undefined);
399 398
400 //smsclients 399 //smsclients
401 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined); 400 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC, "No sms client installed", undefined, undefined, undefined, undefined, undefined);
402 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined); 401 addDefaultAppItem(ExternalAppHandler::SMS, KPimGlobalPrefs::OTHER_SMC, "Other sms client", undefined, undefined, undefined, undefined, undefined);
403 402
404 //pagerclients 403 //pagerclients
405 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined); 404 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC, "No pager client installed", undefined, undefined, undefined, undefined, undefined);
406 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined); 405 addDefaultAppItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::OTHER_PAC, "Other pager client", undefined, undefined, undefined, undefined, undefined);
407 406
408} 407}
409 408
410ExternalAppHandler *ExternalAppHandler::instance() 409ExternalAppHandler *ExternalAppHandler::instance()
411{ 410{
412 if ( !sInstance ) { 411 if ( !sInstance ) {
413 sInstance = staticDeleter.setObject( new ExternalAppHandler() ); 412 sInstance = staticDeleter.setObject( new ExternalAppHandler() );
414 sInstance->loadConfig(); 413 sInstance->loadConfig();
415 } 414 }
416 415
417 return sInstance; 416 return sInstance;
418} 417}
419 418
420void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) 419void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2)
421{ 420{
422 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2); 421 DefaultAppItem* dai = new DefaultAppItem(type, id, label, channel, message, parameter, message2, parameter2);
423 422 // qDebug("%d %d %s %s ", type, id, label.latin1(), channel.latin1() );
424 mDefaultItems.append(dai); 423 mDefaultItems.append(dai);
425} 424}
426 425
427 426
428QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) 427QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type)
429{ 428{
430 QList<DefaultAppItem> list; 429 QList<DefaultAppItem> list;
431 430
432 DefaultAppItem* dai; 431 DefaultAppItem* dai;
433 432
434 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) 433 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() )
435 { 434 {
436 if (dai->_type == type) 435 if (dai->_type == type)
437 list.append(dai); 436 list.append(dai);
438 } 437 }
439 438
440 return list; 439 return list;
441} 440}
442 441
443DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid) 442DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid)
444{ 443{
445 DefaultAppItem* dai; 444 DefaultAppItem* dai;
446 445
447 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() ) 446 for ( dai=mDefaultItems.first(); dai != 0; dai=mDefaultItems.next() )
448 { 447 {
449 if (dai->_type == type && dai->_id == clientid) 448 if (dai->_type == type && dai->_id == clientid)
450 return dai; 449 return dai;
451 } 450 }
452 451
453 return 0; 452 return 0;
454} 453}
455 454
456bool ExternalAppHandler::isEmailAppAvailable() 455bool ExternalAppHandler::isEmailAppAvailable()
457{ 456{
458#ifndef DESKTOP_VERSION 457#ifndef DESKTOP_VERSION
459 if (mEmailAppAvailable == UNDEFINED) 458 if (mEmailAppAvailable == UNDEFINED)
460 { 459 {
461 int client = KPimGlobalPrefs::instance()->mEmailClient; 460 int client = KPimGlobalPrefs::instance()->mEmailClient;
462 if (client == KPimGlobalPrefs::NONE_EMC) 461 if (client == KPimGlobalPrefs::NONE_EMC)
463 mEmailAppAvailable = UNAVAILABLE; 462 mEmailAppAvailable = UNAVAILABLE;
464 else 463 else
465 mEmailAppAvailable = AVAILABLE; 464 mEmailAppAvailable = AVAILABLE;
466 } 465 }
467 return (mEmailAppAvailable == AVAILABLE); 466 return (mEmailAppAvailable == AVAILABLE);
468 467
469#else //DESKTOP_VERSION 468#else //DESKTOP_VERSION
470 return false; 469 return false;
471#endif //DESKTOP_VERSION 470#endif //DESKTOP_VERSION
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 4790980..7f683a8 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -1,89 +1,89 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <kglobal.h> 31#include <kglobal.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kstaticdeleter.h> 35#include <kstaticdeleter.h>
36 36
37#include "kpimglobalprefs.h" 37#include "kpimglobalprefs.h"
38 38
39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
40static KStaticDeleter<KPimGlobalPrefs> staticDeleter; 40static KStaticDeleter<KPimGlobalPrefs> staticDeleter;
41 41
42 42
43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
44 : KPrefs("kkdepimrc") 44 : KPrefs("kkdepimrc")
45{ 45{
46 KPrefs::setCurrentGroup( "ExternalApplications" ); 46 KPrefs::setCurrentGroup( "ExternalApplications" );
47 47
48 addItemInt( "EmailChannelType", &mEmailClient, NONE_EMC ); 48 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
49 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 49 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
50 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 50 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
51 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 51 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
52 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 52 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
53 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 53 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
54 54
55 addItemInt( "PhoneChannelType", &mPhoneClient, NONE_PHC ); 55 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
56 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 56 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
57 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 57 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
58 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 58 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
59 59
60 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 60 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
61 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 61 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
62 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 62 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
63 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 63 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
64 64
65 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 65 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
66 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 66 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
67 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 67 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
68 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 68 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
69 69
70 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 70 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
71 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 71 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
72 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 72 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
73 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 73 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
74 74
75} 75}
76 76
77KPimGlobalPrefs::~KPimGlobalPrefs() 77KPimGlobalPrefs::~KPimGlobalPrefs()
78{ 78{
79} 79}
80 80
81KPimGlobalPrefs *KPimGlobalPrefs::instance() 81KPimGlobalPrefs *KPimGlobalPrefs::instance()
82{ 82{
83 if ( !sInstance ) { 83 if ( !sInstance ) {
84 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); 84 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() );
85 sInstance->readConfig(); 85 sInstance->readConfig();
86 } 86 }
87 87
88 return sInstance; 88 return sInstance;
89} 89}