-rw-r--r-- | libkdepim/externalapphandler.cpp | 3 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 6100097..5ba32b6 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -289,199 +289,198 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString | |||
289 | /*********************************************************************************/ | 289 | /*********************************************************************************/ |
290 | bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) | 290 | bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) |
291 | { | 291 | { |
292 | bool res = QCopTransferItem::appMessage( cmsg, data ); | 292 | bool res = QCopTransferItem::appMessage( cmsg, data ); |
293 | 293 | ||
294 | if (res == false) | 294 | if (res == false) |
295 | { | 295 | { |
296 | QDataStream stream( data, IO_ReadOnly ); | 296 | QDataStream stream( data, IO_ReadOnly ); |
297 | 297 | ||
298 | // qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); | 298 | // qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); |
299 | 299 | ||
300 | //we are in the source and get an answer from the target | 300 | //we are in the source and get an answer from the target |
301 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) | 301 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) |
302 | { | 302 | { |
303 | QStringList list1; | 303 | QStringList list1; |
304 | QStringList list2; | 304 | QStringList list2; |
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 | ||
326 | ExternalAppHandler *ExternalAppHandler::sInstance = 0; | 326 | ExternalAppHandler *ExternalAppHandler::sInstance = 0; |
327 | static KStaticDeleter<ExternalAppHandler> staticDeleter; | 327 | static KStaticDeleter<ExternalAppHandler> staticDeleter; |
328 | 328 | ||
329 | ExternalAppHandler::ExternalAppHandler() | 329 | ExternalAppHandler::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 | ||
345 | ExternalAppHandler::~ExternalAppHandler() | 345 | ExternalAppHandler::~ExternalAppHandler() |
346 | { | 346 | { |
347 | } | 347 | } |
348 | 348 | ||
349 | void ExternalAppHandler::loadConfig() | 349 | void 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 | ||
410 | ExternalAppHandler *ExternalAppHandler::instance() | 409 | ExternalAppHandler *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 | ||
420 | void ExternalAppHandler::addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameter, const QString& message2, const QString& parameter2) | 419 | void 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 | ||
428 | QList<DefaultAppItem> ExternalAppHandler::getAvailableDefaultItems(Types type) | 427 | QList<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 | ||
443 | DefaultAppItem* ExternalAppHandler::getDefaultItem(Types type, int clientid) | 442 | DefaultAppItem* 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 | ||
456 | bool ExternalAppHandler::isEmailAppAvailable() | 455 | bool 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 |
472 | } | 471 | } |
473 | 472 | ||
474 | bool ExternalAppHandler::isSMSAppAvailable() | 473 | bool ExternalAppHandler::isSMSAppAvailable() |
475 | { | 474 | { |
476 | #ifndef DESKTOP_VERSION | 475 | #ifndef DESKTOP_VERSION |
477 | if (mSMSAppAvailable == UNDEFINED) | 476 | if (mSMSAppAvailable == UNDEFINED) |
478 | { | 477 | { |
479 | int client = KPimGlobalPrefs::instance()->mSMSClient; | 478 | int client = KPimGlobalPrefs::instance()->mSMSClient; |
480 | if (client == KPimGlobalPrefs::NONE_SMC) | 479 | if (client == KPimGlobalPrefs::NONE_SMC) |
481 | mSMSAppAvailable = UNAVAILABLE; | 480 | mSMSAppAvailable = UNAVAILABLE; |
482 | else | 481 | else |
483 | mSMSAppAvailable = AVAILABLE; | 482 | mSMSAppAvailable = AVAILABLE; |
484 | } | 483 | } |
485 | 484 | ||
486 | return (mSMSAppAvailable == AVAILABLE); | 485 | return (mSMSAppAvailable == AVAILABLE); |
487 | #else //DESKTOP_VERSION | 486 | #else //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 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (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 | ||
39 | KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; | 39 | KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; |
40 | static KStaticDeleter<KPimGlobalPrefs> staticDeleter; | 40 | static KStaticDeleter<KPimGlobalPrefs> staticDeleter; |
41 | 41 | ||
42 | 42 | ||
43 | KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) | 43 | KPimGlobalPrefs::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 | ||
77 | KPimGlobalPrefs::~KPimGlobalPrefs() | 77 | KPimGlobalPrefs::~KPimGlobalPrefs() |
78 | { | 78 | { |
79 | } | 79 | } |
80 | 80 | ||
81 | KPimGlobalPrefs *KPimGlobalPrefs::instance() | 81 | KPimGlobalPrefs *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 | } |