summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-10-09 02:17:06 (UTC)
committer zautrix <zautrix>2004-10-09 02:17:06 (UTC)
commitc2165f4e14bc2f7ab2ef19f5c35497dde5e87a0d (patch) (side-by-side diff)
treeb83f7cfe5d4bb681b756fe95446e5e3fc193bc36 /kaddressbook
parent07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861 (diff)
downloadkdepimpi-c2165f4e14bc2f7ab2ef19f5c35497dde5e87a0d.zip
kdepimpi-c2165f4e14bc2f7ab2ef19f5c35497dde5e87a0d.tar.gz
kdepimpi-c2165f4e14bc2f7ab2ef19f5c35497dde5e87a0d.tar.bz2
import ir fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp22
-rw-r--r--kaddressbook/kabcore.h1
-rw-r--r--kaddressbook/kaddressbookmain.cpp12
-rw-r--r--kaddressbook/kaddressbookmain.h2
-rw-r--r--kaddressbook/mainembedded.cpp8
5 files changed, 28 insertions, 17 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 9b059d3..3a542ba 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -325,6 +325,12 @@ KABCore::~KABCore()
}
+void KABCore::recieve( QString fn )
+{
+ qDebug("KABCore::recieve ");
+ mAddressBook->importFromFile( fn, true );
+ topLevelWidget()->raise();
+}
void KABCore::restoreSettings()
{
mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
@@ -2086,20 +2092,8 @@ void KABCore::removeVoice()
KABC::Addressee::List list = mViewManager->selectedAddressees();
KABC::Addressee::List::Iterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
- PhoneNumber::List phoneNumbers = (*it).phoneNumbers();
- PhoneNumber::List::Iterator phoneIt;
- bool found = false;
- for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) {
- if ( (*phoneIt).type() & PhoneNumber::Voice) { // voice found
- if ((*phoneIt).type() - PhoneNumber::Voice ) {
- (*phoneIt).setType((*phoneIt).type() - PhoneNumber::Voice );
- (*it).insertPhoneNumber( (*phoneIt) );
- found = true;
- }
- }
-
- }
- if ( found )
+
+ if ( (*it).removeVoice() )
contactModified((*it) );
}
}
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index c628399..43c5f99 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -342,6 +342,7 @@ class KABCore : public QWidget, public KSyncInterface
void contactSelected( const QString &name );
void contactSelected( const QPixmap &pixmap );
public slots:
+ void recieve(QString cmsg );
void getFile( bool success );
void syncFileRequest();
void setDetailsVisible( bool visible );
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index f48f214..8c4ca09 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -92,7 +92,17 @@ KAddressBookMain::~KAddressBookMain()
{
// mCore->saveSettings();
}
-
+void KAddressBookMain::recieve( const QCString& cmsg, const QByteArray& data )
+{
+ qDebug("KA: QCOP message received: %s ", cmsg.data() );
+ if ( cmsg == "setDocument(QString)" ) {
+ QDataStream stream( data, IO_ReadOnly );
+ QString fileName;
+ stream >> fileName;
+ mCore->recieve( fileName );
+ return;
+ }
+}
void KAddressBookMain::showMinimized ()
{
QWidget::showMinimized () ;
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h
index cf6f899..40d2bdd 100644
--- a/kaddressbook/kaddressbookmain.h
+++ b/kaddressbook/kaddressbookmain.h
@@ -81,7 +81,7 @@ class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
virtual QString getNameByPhone( QString phone );
virtual void save();
virtual void exit();
-
+ void recieve( const QCString& cmsg, const QByteArray& data );
protected:
void initActions();
#ifdef KAB_EMBEDDED
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 965fb06..6dd97b8 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,5 +1,6 @@
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
+#include <qcopchannel_qws.h>
#include <stdlib.h>
#else
#include <qapplication.h>
@@ -77,13 +78,18 @@ int main( int argc, char **argv )
KPimGlobalPrefs::instance()->setGlobalConfig();
}
#ifndef DESKTOP_VERSION
- a.showMainWidget( &m );
+ a.showMainWidget( &m );
+ QCopChannel* c1 = new QCopChannel("QPE/Application/addressbook",&m, "channelAB" ) ;
+ QObject::connect( c1, SIGNAL (received ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
a.exec();
+#ifndef DESKTOP_VERSION
+ delete c1;
+#endif
}
qDebug("KA: Bye! ");