summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-07 23:33:23 (UTC)
committer zautrix <zautrix>2004-09-07 23:33:23 (UTC)
commit199025628054eef739a261437a51a98f5218ab0f (patch) (unidiff)
tree75ec5c537ee789dbd3e1a87a2e7db9b29d44c626
parent2676646d4744ccceab1063dc02d772a26a203c61 (diff)
downloadkdepimpi-199025628054eef739a261437a51a98f5218ab0f.zip
kdepimpi-199025628054eef739a261437a51a98f5218ab0f.tar.gz
kdepimpi-199025628054eef739a261437a51a98f5218ab0f.tar.bz2
Fixed default settings
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
@@ -2012,81 +2012,84 @@ void KABCore::configureResources()
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 }
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 5f446fa..f7604ad 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -21,65 +21,71 @@
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);
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 6100097..5ba32b6 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -321,65 +321,64 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d
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
@@ -391,65 +390,65 @@ void ExternalAppHandler::loadConfig()
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
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 4790980..7f683a8 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -16,72 +16,72 @@
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