-rw-r--r-- | kabc/addressbook.cpp | 2 | ||||
-rw-r--r-- | kabc/stdaddressbook.cpp | 14 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 15 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 50 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 | ||||
-rw-r--r-- | libkdepim/externalapphandler.cpp | 2 |
6 files changed, 66 insertions, 19 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index c61b387..47d298a 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -414,33 +414,33 @@ Addressee AddressBook::findByUid( const QString &uid ) } } return Addressee(); } Addressee::List AddressBook::allAddressees() { return d->mAddressees; } Addressee::List AddressBook::findByName( const QString &name ) { Addressee::List results; Iterator it; for ( it = begin(); it != end(); ++it ) { - if ( name == (*it).name() ) { + if ( name == (*it).realName() ) { results.append( *it ); } } return results; } Addressee::List AddressBook::findByEmail( const QString &email ) { Addressee::List results; QStringList mailList; Iterator it; for ( it = begin(); it != end(); ++it ) { mailList = (*it).emails(); for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index 760820e..9f38f08 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp @@ -50,34 +50,37 @@ QString StdAddressBook::fileName() QString StdAddressBook::directoryName() { return locateLocal( "data", "kabc/stdvcf" ); } void StdAddressBook::handleCrash() { StdAddressBook::self()->cleanUp(); } StdAddressBook *StdAddressBook::self() { if ( !mSelf ) { QString appdir = StdAddressBook::setTempAppDir(); - - kdDebug(5700) << "StdAddressBook::self()" << endl; + qDebug("****************************************************** "); + qDebug("****************************************************** "); + qDebug("****************************************************** "); + qDebug("****************************************************** "); + qDebug("****************************************************** "); // US im am not sure why I have to use the other format here?? #ifdef KAB_EMBEDDED mSelf = addressBookDeleter.setObject( new StdAddressBook ); #else //KAB_EMBEDDED addressBookDeleter.setObject( mSelf, new StdAddressBook ); #endif //KAB_EMBEDDED KStandardDirs::setAppDir( appdir ); } return mSelf; } QString StdAddressBook::setTempAppDir() { QString appDIR = KStandardDirs::appDir(); #ifdef DESKTOP_VERSION @@ -87,32 +90,39 @@ QString StdAddressBook::setTempAppDir() else appdir += "/kaddressbook/"; KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); #else QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook"; KStandardDirs::setAppDir( appdir ); #endif return appDIR; } StdAddressBook *StdAddressBook::self( bool onlyFastResources ) { if ( !mSelf ) { + qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ "); + qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ "); + qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ "); + qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ "); + qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ "); + qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ "); + qDebug("++++++++++++++++++++++++++++++++++++++++++++++++ "); QString appdir =StdAddressBook::setTempAppDir(); #ifdef KAB_EMBEDDED mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); #else //KAB_EMBEDDED addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); #endif //KAB_EMBEDDED KStandardDirs::setAppDir( appdir ); } return mSelf; } StdAddressBook::StdAddressBook() : AddressBook( "kabcrc" ) { init( false ); diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4299ebd..2f9f1df 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -2042,67 +2042,70 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) { // qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); QString foundUid = QString::null; if (uid.isEmpty()) { //find the uid of the person first Addressee::List namelist; Addressee::List emaillist; if (!name.isEmpty()) namelist = mAddressBook->findByName( name ); if (!email.isEmpty()) emaillist = mAddressBook->findByEmail( email ); - + qDebug("count %d %d ", namelist.count(),emaillist.count() ); //check if we have a match in Namelist and Emaillist - if ((namelist.count() == 0) && (emaillist.count() > 0)) - foundUid == emaillist[0].uid(); + if ((namelist.count() == 0) && (emaillist.count() > 0)) { + foundUid = emaillist[0].uid(); + } else if ((namelist.count() > 0) && (emaillist.count() == 0)) - foundUid == namelist[0].uid(); + foundUid = namelist[0].uid(); else { for (int i = 0; i < namelist.count(); i++) { for (int j = 0; j < emaillist.count(); j++) { if (namelist[i] == emaillist[j]) { - foundUid == namelist[i].uid(); + foundUid = namelist[i].uid(); } } } } } else { foundUid = uid; } if (!foundUid.isEmpty()) { + // raise Ka/Pi if it is in the background #ifndef DESKTOP_VERSION #ifndef KORG_NODCOP - QCopEnvelope e("QPE/Application/kapi", "raise()"); + //QCopEnvelope e("QPE/Application/kapi", "raise()"); #endif #endif mMainWindow->showMaximized(); + mMainWindow-> raise(); mViewManager->setSelected( "", false); mViewManager->refreshView( "" ); mViewManager->setSelected( foundUid, true ); mViewManager->refreshView( foundUid ); if ( !mMultipleViewsAtOnce ) { setDetailsVisible( true ); mActionDetails->setChecked(true); } } } void KABCore::faq() diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 1f69700..0866939 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -37,85 +37,106 @@ #include <libkdepim/addresseeview.h> #include <kabc/stdaddressbook.h> #ifndef KORG_NODCOP #include <dcopclient.h> #include "korganizer.h" #include "koprefs.h" #include "actionmanager.h" #endif #include "koeventviewer.h" #ifndef KORG_NOKABC #include <kabc/stdaddressbook.h> #define size count #endif -#ifndef DESKTOP_VERSION + +#ifdef DESKTOP_VERSION +#include <kabc/addresseedialog.h> +#else //DESKTOP_VERSION +#include <externalapphandler.h> #include <qtopia/qcopenvelope_qws.h> -#endif +#endif //DESKTOP_VERSION KOEventViewer::KOEventViewer(QWidget *parent,const char *name) : QTextBrowser(parent,name) { mSyncMode = false; mColorMode = 0; } KOEventViewer::~KOEventViewer() { } void KOEventViewer::setSource(const QString& n) { - if ( n.left(3) == "uid" ) { + if ( n.left(3) == "uid" ) +#ifdef DESKTOP_VERSION + { KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); KABC::AddressBook::Iterator it; for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { // LR I do not understand, why the uid string is different on zaurus and desktop -#ifdef DESKTOP_VERSION QString uid = "uid://"+(*it).uid(); -#else - QString uid = "uid:"+(*it).uid(); -#endif + //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); if (n == uid ) { //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); QDialog dia( this,"dia123", true ); dia.setCaption( i18n("Details of attendee") ); QVBoxLayout lay ( &dia ); KPIM::AddresseeView av ( &dia ); av.setAddressee( (*it) ); lay.addWidget( &av ); if ( QApplication::desktop()->width() < 480 ) dia.resize( 220, 240); else { dia.resize( 400,400); } dia.exec(); break; } } return; } +#else + { + QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); + if (attendees.count()) { + Attendee *a; + for(a=attendees.first();a;a=attendees.next()) { + if ( "uid:"+a->uid() == n ) { + bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), ""); + return; + } + } + } + return; + } + //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); + // the result should now arrive through method insertAttendees + //QString uid = "uid:"+(*it).uid(); +#endif if ( n.left(6) == "mailto" ) { // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); #ifndef DESKTOP_VERSION - QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)" ); + QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); e << n.mid(7); #endif } #ifndef KORG_NODCOP kdDebug() << "KOEventViewer::setSource(): " << n << endl; QString tmpStr; if (n.startsWith("mailto:")) { KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); //emit showIncidence(n); return; } else if (n.startsWith("uid:")) { DCOPClient *client = KApplication::kApplication()->dcopClient(); const QByteArray noParamData; @@ -370,77 +391,90 @@ void KOEventViewer::formatCategories(Incidence *event) addTag("h3",i18n("Categories")); } addTag("p",event->categoriesStr()); } } void KOEventViewer::formatAttendees(Incidence *event) { QPtrList<Attendee> attendees = event->attendees(); if (attendees.count()) { QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); addTag("h3",i18n("Organizer")); mText.append("<ul><li>"); #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION KABC::AddressBook *add_book = KABC::StdAddressBook::self(); KABC::Addressee::List addressList; addressList = add_book->findByEmail(event->organizer()); KABC::Addressee o = addressList.first(); if (!o.isEmpty() && addressList.size()<2) { mText += "<a href=\"uid:" + o.uid() + "\">"; mText += o.formattedName(); mText += "</a>\n"; } else { mText.append(event->organizer()); } +#else //DESKTOP_VERSION + mText.append(event->organizer()); +#endif //DESKTOP_VERSION + + #else mText.append(event->organizer()); #endif if (iconPath) { mText += " <a href=\"mailto:" + event->organizer() + "\">"; mText += "<IMG src=\"" + iconPath + "\">"; mText += "</a>\n"; } mText.append("</li></ul>"); addTag("h3",i18n("Attendees")); Attendee *a; mText.append("<ul>"); for(a=attendees.first();a;a=attendees.next()) { #ifndef KORG_NOKABC +#ifdef DESKTOP_VERSION if (a->name().isEmpty()) { addressList = add_book->findByEmail(a->email()); KABC::Addressee o = addressList.first(); if (!o.isEmpty() && addressList.size()<2) { mText += "<a href=\"uid:" + o.uid() + "\">"; mText += o.formattedName(); mText += "</a>\n"; } else { mText += "<li>"; mText.append(a->email()); mText += "\n"; } } else { mText += "<li><a href=\"uid:" + a->uid() + "\">"; if (!a->name().isEmpty()) mText += a->name(); else mText += a->email(); mText += "</a>\n"; } +#else //DESKTOP_VERSION + mText += "<li><a href=\"uid:" + a->uid() + "\">"; + if (!a->name().isEmpty()) mText += a->name(); + else mText += a->email(); + mText += "</a>\n"; +#endif //DESKTOP_VERSION #else //qDebug("nokabc "); mText += "<li><a href=\"uid:" + a->uid() + "\">"; if (!a->name().isEmpty()) mText += a->name(); else mText += a->email(); mText += "</a>\n"; #endif if (!a->email().isEmpty()) { if (iconPath) { mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; mText += "<IMG src=\"" + iconPath + "\">"; mText += "</a>\n"; } } diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index d4fadcb..7978b46 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -189,33 +189,35 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : mView->show(); delete splash; if ( newFile ) mView->updateConfig(); // qApp->processEvents(); //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); fillSyncMenu(); mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); if ( showWarning ) { KMessageBox::information( this, "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); qApp->processEvents(); mView->dialogManager()->showSyncOptions(); } //US listen for result adressed from Ka/Pi +#ifndef DESKTOP_VERSION connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); +#endif } MainWindow::~MainWindow() { //qDebug("MainWindow::~MainWindow() "); //save toolbar location delete mCalendar; delete KOPrefs::instance(); delete KIncidenceFormatter::instance(); } void MainWindow::showMaximized () { #ifndef DESKTOP_VERSION if ( ! globalFlagBlockStartup ) diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index bd83626..6100097 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -293,33 +293,32 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d if (res == false) { QDataStream stream( data, IO_ReadOnly ); // qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); //we are in the source and get an answer from the target if ((_targetMessage + _targetMessageParameters) == cmsg.data()) { QStringList list1; QStringList list2; QStringList list3; QString uid; stream >> uid >> list1 >> list2 >> list3; - emit receivedMessageFromTarget(uid, list1, list2, list3); return true; } } return false; } /********************************************************************************* * ********************************************************************************/ @@ -957,33 +956,32 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete if (useValMap == true) (*e) << valmap; #endif } /************************************************************************** * **************************************************************************/ void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) { bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); - if (!res) res = mDisplayDetails->appMessage( cmsg, data ); // if (!res) // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); } bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) { mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); } bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |