author | zautrix <zautrix> | 2004-07-24 21:25:24 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-24 21:25:24 (UTC) |
commit | f0d0803312ea5607d9ba85454d39787ab626b86e (patch) (side-by-side diff) | |
tree | 7c14022c53015a604bc2482751a978b67c9bad09 | |
parent | f27f513f6f4a464a05f5edaf3e0f74578b99af88 (diff) | |
download | kdepimpi-f0d0803312ea5607d9ba85454d39787ab626b86e.zip kdepimpi-f0d0803312ea5607d9ba85454d39787ab626b86e.tar.gz kdepimpi-f0d0803312ea5607d9ba85454d39787ab626b86e.tar.bz2 |
Added connection to kphone, if kphone is available
-rw-r--r-- | libkdepim/addresseeview.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp index 71c7817..e9dc1e9 100644 --- a/libkdepim/addresseeview.cpp +++ b/libkdepim/addresseeview.cpp @@ -40,5 +40,6 @@ #include <qtopia/qcopenvelope_qws.h> +#include <qpe/qpeapplication.h> #endif - +int kphoneInstalled = 0; @@ -64,6 +65,12 @@ void AddresseeView::setSource(const QString& n) { - //qDebug("********AddresseeView::setSource %s", n.mid(7).latin1()); + qDebug("********AddresseeView::setSource %s", n.latin1()); #ifndef DESKTOP_VERSION + if ( n.left( 6 ) == "mailto" ) { QCopEnvelope e("QPE/Application/kmpi", "newMail(QString)"); e << n.mid(7); + } + if ( n.left( 7 ) == "phoneto" ) { + QString mess = "-ring:" + n.mid(8); + QCopEnvelope e("QPE/Application/kppi", mess.latin1()); + } #endif @@ -73,4 +80,18 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) { - mAddressee = addr; + bool kphoneAvail = false; +#ifndef DESKTOP_VERSION + if ( ! kphoneInstalled ) { + if ( QFile::exists( QPEApplication::qpeDir() + "/bin/kppi" ) ) + kphoneInstalled = 1; + else + kphoneInstalled = -1; + } else { + if ( kphoneInstalled > 0 ) + kphoneAvail = true; + } + //if ( kphoneAvail ) + // qDebug("KPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPone avail "); +#endif + mAddressee = addr; // clear view @@ -104,2 +125,11 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { + if ( kphoneAvail ) { + dynamicPart += QString( + "<tr><td align=\"right\"><b>%1</b></td>" + "<td align=\"left\"><a href=\"phoneto:%2 \">%3</a></td></tr>" ) + .arg( KABC::PhoneNumber::typeLabel( (*phoneIt).type() ) ) + .arg( (*phoneIt).number() ) + .arg( (*phoneIt).number() ); + + } else { dynamicPart += QString( @@ -110,2 +140,3 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) } + } |