summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-07-24 21:31:41 (UTC)
committer zautrix <zautrix>2004-07-24 21:31:41 (UTC)
commitdc4632b03f9e4108f3e2ae8b5f7ff43c7c2208bb (patch) (side-by-side diff)
treebe38db1fa6d1bead40f2e51a3a598916382795d2
parentf0d0803312ea5607d9ba85454d39787ab626b86e (diff)
downloadkdepimpi-dc4632b03f9e4108f3e2ae8b5f7ff43c7c2208bb.zip
kdepimpi-dc4632b03f9e4108f3e2ae8b5f7ff43c7c2208bb.tar.gz
kdepimpi-dc4632b03f9e4108f3e2ae8b5f7ff43c7c2208bb.tar.bz2
Bugfix for:Added connection to kphone, if kphone is available
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/addresseeview.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp
index e9dc1e9..aa9b7f3 100644
--- a/libkdepim/addresseeview.cpp
+++ b/libkdepim/addresseeview.cpp
@@ -20,99 +20,103 @@
*/
#include <kabc/address.h>
#include <kabc/addressee.h>
#include <kabc/phonenumber.h>
#include <kglobal.h>
//US#include <kglobalsettings.h>
#include <kiconloader.h>
#include <klocale.h>
//US #include <kstringhandler.h>
#include <qscrollview.h>
#include <qregexp.h>
#include <qfile.h>
#include <qapplication.h>
#include "addresseeview.h"
#ifndef DESKTOP_VERSION
#include <qtopia/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#endif
-int kphoneInstalled = 0;
+static int kphoneInstalled = 0;
using namespace KPIM;
AddresseeView::AddresseeView( QWidget *parent, const char *name )
//US : KTextBrowser( parent, name )
: QTextBrowser( parent, name )
{
//US setWrapPolicy( QTextEdit::AtWordBoundary );
setLinkUnderline( false );
// setVScrollBarMode( QScrollView::AlwaysOff );
//setHScrollBarMode( QScrollView::AlwaysOff );
//US QStyleSheet *sheet = styleSheet();
//US QStyleSheetItem *link = sheet->item( "a" );
//US link->setColor( KGlobalSettings::linkColor() );
}
void AddresseeView::setSource(const QString& n)
{
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
}
void AddresseeView::setAddressee( const KABC::Addressee& 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 ");
+ }
+ if ( kphoneInstalled > 0 )
+ kphoneAvail = true;
+#if 0
+ if ( kphoneAvail )
+ qDebug("KPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPone avail ");
+ else
+ qDebug("NOOOOOOOOOOOo KPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPone avail ");
+#endif
+
#endif
mAddressee = addr;
// clear view
setText( QString::null );
if ( mAddressee.isEmpty() )
return;
QString name = ( mAddressee.formattedName().isEmpty() ?
mAddressee.assembledName() : mAddressee.formattedName() );
QString dynamicPart;
QStringList emails = mAddressee.emails();
QStringList::ConstIterator emailIt;
QString type = i18n( "Email" );
emailIt = emails.begin();
if ( emailIt != emails.end() ) {
dynamicPart += QString(
"<tr><td align=\"right\"><b>%1</b></td>"
"<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" )
.arg( type )
.arg( name )
.arg( *emailIt )