summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
authorar <ar>2004-06-01 22:21:23 (UTC)
committer ar <ar>2004-06-01 22:21:23 (UTC)
commitd4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce (patch) (side-by-side diff)
tree4bab082304716df1ec924ef040161e3cf9c10366 /libopie2/opiepim/core
parentbaed1d5ab8589aef14440009bc4e7380bcc5a741 (diff)
downloadopie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.zip
opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.gz
opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.bz2
- convert to odebug framework
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp117
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h17
-rw-r--r--libopie2/opiepim/core/opimcontact.cpp4
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp4
-rw-r--r--libopie2/opiepim/core/opimrecordlist.h5
5 files changed, 78 insertions, 69 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index a372267..7a3d7cb 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -38,2 +38,12 @@
+/* OPIE */
+#include <opie2/ocontactaccessbackend_xml.h>
+#include <opie2/opimresolver.h>
+#include <opie2/opimglobal.h>
+#include <opie2/odebug.h>
+
+//#include <qpe/qcopenvelope_qws.h>
+#include <qpe/global.h>
+
+/* QT */
#include <qasciidict.h>
@@ -45,5 +55,3 @@
-//#include <qpe/qcopenvelope_qws.h>
-#include <qpe/global.h>
-
+/* STD */
#include <errno.h>
@@ -53,5 +61,2 @@
-#include <opie2/ocontactaccessbackend_xml.h>
-#include <opie2/opimresolver.h>
-#include <opie2/opimglobal.h>
@@ -60,26 +65,26 @@ namespace Opie {
OPimContactAccess::OPimContactAccess ( const QString appname, const QString ,
- OPimContactAccessBackend* end, bool autosync ):
- OPimAccessTemplate<OPimContact>( end )
+ OPimContactAccessBackend* end, bool autosync ):
+ OPimAccessTemplate<OPimContact>( end )
{
/* take care of the backend. If there is no one defined, we
- * will use the XML-Backend as default (until we have a cute SQL-Backend..).
- */
+ * will use the XML-Backend as default (until we have a cute SQL-Backend..).
+ */
if( end == 0 ) {
- qWarning ("Using BackendFactory !");
- end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname );
+ owarn << "Using BackendFactory !" << oendl;
+ end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname );
}
- // Set backend locally and in template
+ // Set backend locally and in template
m_backEnd = end;
- OPimAccessTemplate<OPimContact>::setBackEnd (end);
+ OPimAccessTemplate<OPimContact>::setBackEnd (end);
- /* Connect signal of external db change to function */
- QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this );
- connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ /* Connect signal of external db change to function */
+ QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this );
+ connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(copMessage(const QCString&,const QByteArray&)) );
- if ( autosync ){
- QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this );
- connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)),
- this, SLOT(copMessage(const QCString&,const QByteArray&)) );
- }
+ if ( autosync ){
+ QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this );
+ connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(copMessage(const QCString&,const QByteArray&)) );
+ }
@@ -89,7 +94,7 @@ OPimContactAccess::~OPimContactAccess ()
{
- /* The user may forget to save the changed database, therefore try to
- * do it for him..
- */
- save();
- // delete m_backEnd; is done by template..
+ /* The user may forget to save the changed database, therefore try to
+ * do it for him..
+ */
+ save();
+ // delete m_backEnd; is done by template..
}
@@ -99,17 +104,17 @@ bool OPimContactAccess::save ()
{
- /* If the database was changed externally, we could not save the
- * Data. This will remove added items which is unacceptable !
- * Therefore: Reload database and merge the data...
- */
- if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() )
- reload();
+ /* If the database was changed externally, we could not save the
+ * Data. This will remove added items which is unacceptable !
+ * Therefore: Reload database and merge the data...
+ */
+ if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() )
+ reload();
- bool status = OPimAccessTemplate<OPimContact>::save();
- if ( !status ) return false;
+ bool status = OPimAccessTemplate<OPimContact>::save();
+ if ( !status ) return false;
- /* Now tell everyone that new data is available.
- */
- QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" );
+ /* Now tell everyone that new data is available.
+ */
+ QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" );
- return true;
+ return true;
}
@@ -118,3 +123,3 @@ const uint OPimContactAccess::querySettings()
{
- return ( m_backEnd->querySettings() );
+ return ( m_backEnd->querySettings() );
}
@@ -123,3 +128,3 @@ bool OPimContactAccess::hasQuerySettings ( int querySettings ) const
{
- return ( m_backEnd->hasQuerySettings ( querySettings ) );
+ return ( m_backEnd->hasQuerySettings ( querySettings ) );
}
@@ -127,4 +132,4 @@ OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortO
{
- QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat );
- return ( OPimRecordList<OPimContact>(matchingContacts, this) );
+ QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat );
+ return ( OPimRecordList<OPimContact>(matchingContacts, this) );
}
@@ -134,3 +139,3 @@ bool OPimContactAccess::wasChangedExternally()const
{
- return ( m_backEnd->wasChangedExternally() );
+ return ( m_backEnd->wasChangedExternally() );
}
@@ -140,13 +145,13 @@ void OPimContactAccess::copMessage( const QCString &msg, const QByteArray & )
{
- if ( msg == "addressbookUpdated()" ){
- qWarning ("OPimContactAccess: Received addressbokUpdated()");
- emit signalChanged ( this );
- } else if ( msg == "flush()" ) {
- qWarning ("OPimContactAccess: Received flush()");
- save ();
- } else if ( msg == "reload()" ) {
- qWarning ("OPimContactAccess: Received reload()");
- reload ();
- emit signalChanged ( this );
- }
+ if ( msg == "addressbookUpdated()" ){
+ owarn << "OPimContactAccess: Received addressbokUpdated()" << oendl;
+ emit signalChanged ( this );
+ } else if ( msg == "flush()" ) {
+ owarn << "OPimContactAccess: Received flush()" << oendl;
+ save ();
+ } else if ( msg == "reload()" ) {
+ owarn << "OPimContactAccess: Received reload()" << oendl;
+ reload ();
+ emit signalChanged ( this );
+ }
}
@@ -155,3 +160,3 @@ int OPimContactAccess::rtti() const
{
- return OPimResolver::AddressBook;
+ return OPimResolver::AddressBook;
}
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h
index e438980..55d600a 100644
--- a/libopie2/opiepim/core/opimaccesstemplate.h
+++ b/libopie2/opiepim/core/opimaccesstemplate.h
@@ -3,3 +3,3 @@
Copyright (C) Holger Freyther <zecke@handhelds.org>
- Copyright (C) Stefan Eilers <eilers.stefan@epost.de>
+ Copyright (C) Stefan Eilers <eilers.stefan@epost.de>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
@@ -32,4 +32,3 @@
-#include <qarray.h>
-
+/* OPIE */
#include <opie2/opimrecord.h>
@@ -40,2 +39,6 @@
#include <opie2/opimtemplatebase.h>
+#include <opie2/odebug.h>
+
+/* QT */
+#include <qarray.h>
@@ -207,3 +210,3 @@ template <class T>
OPimAccessTemplate<T>::~OPimAccessTemplate() {
- qWarning("~OPimAccessTemplate<T>");
+ owarn << "~OPimAccessTemplate<T>" << oendl;
delete m_backEnd;
@@ -217,4 +220,4 @@ template <class T>
bool OPimAccessTemplate<T>::reload() {
- invalidateCache(); // zecke: I think this should be added (se)
- return m_backEnd->reload();
+ invalidateCache(); // zecke: I think this should be added (se)
+ return m_backEnd->reload();
}
@@ -262,3 +265,3 @@ T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar,
*/
- // qWarning("find it now %d", uid );
+ // owarn << "find it now " << uid << oendl;
if (m_cache.contains( uid ) ) {
diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp
index 48a74d0..36e9a93 100644
--- a/libopie2/opiepim/core/opimcontact.cpp
+++ b/libopie2/opiepim/core/opimcontact.cpp
@@ -1175,3 +1175,3 @@ QDate OPimContact::birthday() const
QString str = find( Qtopia::Birthday );
- // qWarning ("Birthday %s", str.latin1() );
+ // owarn << "Birthday " << str << oendl;
if ( !str.isEmpty() )
@@ -1190,3 +1190,3 @@ QDate OPimContact::anniversary() const
QString str = find( Qtopia::Anniversary );
- // qWarning ("Anniversary %s", str.latin1() );
+ // owarn << "Anniversary " << str << oendl;
if ( !str.isEmpty() )
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index 0f863aa..516dc79 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -229,4 +229,4 @@ void OPimNotifyManager::alarmsFromString( const QString& str )
owarn << "alarm: " << alarm.join( "___" ) << "" << oendl;
- qWarning( "alarm[0]: %s %s", alarm[ 0 ].latin1(),
- OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString().latin1() );
+ owarn << "alarm[0]: " << alarm[ 0 ] << " "
+ << OPimDateConversion::dateTimeFromString( alarm[ 0 ] ).toString() << oendl;
OPimAlarm al( alarm[ 2 ].toInt(), OPimDateConversion::dateTimeFromString( alarm[ 0 ] ),
diff --git a/libopie2/opiepim/core/opimrecordlist.h b/libopie2/opiepim/core/opimrecordlist.h
index b23138d..1d5027f 100644
--- a/libopie2/opiepim/core/opimrecordlist.h
+++ b/libopie2/opiepim/core/opimrecordlist.h
@@ -35,2 +35,3 @@
#include <opie2/opimrecord.h>
+//#include <opie2/odebug.h>
@@ -191,3 +192,3 @@ OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator<
{
- // qWarning("OPimRecordListIterator copy c'tor");
+ //owarn << "OPimRecordListIterator copy c'tor" << oendl;
m_uids = it.m_uids;
@@ -217,3 +218,3 @@ T OPimRecordListIterator<T>::operator*()
{
- //qWarning("operator* %d %d", m_current, m_uids[m_current] );
+ //owarn << "operator* " << m_current << " " << m_uids[m_current] << oendl;
if ( !m_end )