[kmobiletools] KDE/kdepim/kmobiletools/kmobiletools
Matthias Lechner
matthias at lmme.de
Sat Jun 9 22:31:33 CEST 2007
SVN commit 673303 by lechner:
moving phoneBookChanged() to EngineData and removing the overloaded phoneBookChanged(int,const KMobileTools::ContactsList&)
RockMan: please review, but shouldn't be a problem again
M +2 -2 engines/at_engine/at_engine.cpp
M +0 -12 libkmobiletools/engine.h
M +7 -1 libkmobiletools/enginedata.cpp
M +5 -0 libkmobiletools/enginedata.h
M +2 -2 libkmobiletools/engineslist.cpp
M +5 -5 mainpart/devicehome.cpp
M +1 -1 mainpart/devicehome.h
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/engines/at_engine/at_engine.cpp #673302:673303
@@ -165,7 +165,7 @@
// kDebug() << "trying to call KMobileTools::EnginesList::instance()->emitPhonebookUpdated();\n";
// KMobileTools::EnginesList::instance()->emitPhonebookUpdated();
// if( ! ((FetchAddressee*) job )->partialUpdates() )
- emit phoneBookChanged();
+ //emit phoneBookChanged();
break;
case KMobileTools::Job::fetchSMS:
if( ((FetchSMS*) job)->last()) {
@@ -274,7 +274,7 @@
if( atAbilities.canSiemensVCF() || atAbilities.canSDBR() )
job=( new FetchAddresseeSiemens(p_lastJob, device, this ) );
else job= ( new FetchAddressee(p_lastJob, availPbSlots(), device, this ) );
- connect(job, SIGNAL(gotAddresseeList(int, const ContactsList&) ), this, SIGNAL(phoneBookChanged(int, const ContactsList& ) ) );
+ //connect(job, SIGNAL(gotAddresseeList(int, const ContactsList&) ), this, SIGNAL(phoneBookChanged(int, const ContactsList& ) ) );
p_lastJob=job;
enqueueJob(job);
}
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/libkmobiletools/engine.h #673302:673303
@@ -316,18 +316,6 @@
void smsFoldersAdded();
/**
- * This signal is emitted when the mobile's phone book has been changed.
- *
- * @todo to be deleted
- */
- void phoneBookChanged( int, const ContactsList& );
-
- /**
- * This signal is emitted when the mobile's phone book has been changed.
- */
- void phoneBookChanged();
-
- /**
* This signal is emitted when phonebook is full.
*
* @TODO should be handled by errorOccured
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/libkmobiletools/enginedata.cpp #673302:673303
@@ -106,8 +106,14 @@
}
ContactsList *EngineData::contactsList() const { return d->p_addresseeList; }
-void EngineData::setContactsList(ContactsList* cl) { d->p_addresseeList=cl; }
+void EngineData::setContactsList( ContactsList* cl ) {
+ if( cl != d->p_addresseeList )
+ emit phoneBookChanged();
+
+ d->p_addresseeList=cl;
+}
+
void EngineData::setPhoneConnected( bool b ) {
// did the connection state change?
if( d->b_connected != b ) {
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/libkmobiletools/enginedata.h #673302:673303
@@ -327,6 +327,11 @@
*/
void smsModified( const QByteArray& sms );
+ /**
+ * This signal is emitted when the mobile's phone book has been changed.
+ */
+ void phoneBookChanged();
+
private:
EngineDataPrivate *const d;
};
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/libkmobiletools/engineslist.cpp #673302:673303
@@ -82,14 +82,14 @@
void KMobileTools::EnginesList::append( KMobileTools::Engine* item )
{
emit engineAdded( item );
- connect(item, SIGNAL(phoneBookChanged()), this, SIGNAL(phonebookUpdated() ));
+ connect(item, SIGNAL(constEngineData()->phoneBookChanged()), this, SIGNAL(phonebookUpdated() ));
QList<KMobileTools::Engine*>::append(item);
}
void KMobileTools::EnginesList::remove( KMobileTools::Engine* item )
{
emit engineRemoved( item );
- disconnect(item, SIGNAL(phoneBookChanged()), this, SIGNAL(phonebookUpdated() ));
+ disconnect(item, SIGNAL(constEngineData()->phoneBookChanged()), this, SIGNAL(phonebookUpdated() ));
QList<KMobileTools::Engine*>::removeAll(item);
}
/*
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/mainpart/devicehome.cpp #673302:673303
@@ -321,7 +321,7 @@
connect(engine->constEngineData(), SIGNAL(connected()), this, SLOT(enableWidgets() ) );
connect(engine->constEngineData(), SIGNAL(disconnected() ), this, SLOT(disableWidgets() ) );
connect(engine, SIGNAL(phoneBookChanged() ), SLOT(updatePB()) );
- connect(engine, SIGNAL(phoneBookChanged(int, const ContactsList& ) ), SLOT(updatePB(int, const ContactsList& ) ) );
+ //connect(engine, SIGNAL(phoneBookChanged(int, const ContactsList& ) ), SLOT(updatePB(int, const ContactsList& ) ) );
connect(engine, SIGNAL(smsFoldersAdded() ), SLOT(addSMSFolders()) );
connect(engine, SIGNAL(smsAdded( const QByteArray& )), SLOT(smsAdded( const QByteArray&) ) );
connect(engine, SIGNAL(smsDeleted( const QByteArray& )), SLOT(smsRemoved(const QByteArray&) ) );
@@ -485,14 +485,13 @@
}
}
-
void DeviceHome::updatePB()
{
// updating without partial updates should ALWAYS clear the listview...
ui.phonebookListView->clear();
// p_addressbook->clear();
ContactsList *phoneBook =engine->constEngineData()->contactsList();
- /* if (!(phoneBook->count() ) ) return;*/
+ // if (!(phoneBook->count() ) ) return;
// p_addressDetails->stopFetch();
// ui.phonebookListView->clear();
for (KABC::Addressee::List::ConstIterator it=phoneBook->begin(); it != phoneBook->end(); ++it)
@@ -506,9 +505,10 @@
emit phonebookUpdated();
}
+/*
void DeviceHome::updatePB(int , const KMobileTools::ContactsList &p_phoneBook)
{
- /* if (!(phoneBook->count() ) ) return;*/
+ // if (!(phoneBook->count() ) ) return;
// p_addressDetails->stopFetch();
// ui.phonebookListView->clear();
for (KABC::Addressee::List::ConstIterator it=p_phoneBook.begin(); it != p_phoneBook.end(); ++it)
@@ -520,7 +520,7 @@
enableWidgets(false);
// slotSaveAddressBook();
// emit phonebookUpdated();
-}
+}*/
QStringList DeviceHome::parseAddressee(const KABC::Addressee &addressee)
{
--- trunk/KDE/kdepim/kmobiletools/kmobiletools/mainpart/devicehome.h #673302:673303
@@ -176,7 +176,7 @@
void errNotConnected();
void addSMSFolders();
void updatePB();
- void updatePB(int slot, const KMobileTools::ContactsList&);
+ //void updatePB(int slot, const KMobileTools::ContactsList&);
void updateAllContacts();
void updateAllContacts(KMobileTools::ContactsList *addressBook);
void updateSMSList();
More information about the kmobiletools
mailing list