summaryrefslogtreecommitdiff
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
parentbaed1d5ab8589aef14440009bc4e7380bcc5a741 (diff)
downloadopie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.zip
opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.gz
opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.bz2
- convert to odebug framework
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/obackendfactory.h24
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp36
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp25
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h11
-rw-r--r--libopie2/opiepim/core/opimcontact.cpp4
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp4
-rw-r--r--libopie2/opiepim/core/opimrecordlist.h5
7 files changed, 60 insertions, 49 deletions
diff --git a/libopie2/opiepim/backend/obackendfactory.h b/libopie2/opiepim/backend/obackendfactory.h
index 6f46652..3680ded 100644
--- a/libopie2/opiepim/backend/obackendfactory.h
+++ b/libopie2/opiepim/backend/obackendfactory.h
@@ -34,10 +34,7 @@
#ifndef OPIE_BACKENDFACTORY_H_
#define OPIE_BACKENDFACTORY_H_
-#include <qstring.h>
-#include <qasciidict.h>
-#include <qpe/config.h>
-
+/* OPIE */
#include <opie2/opimaccessbackend.h>
#include <opie2/opimglobal.h>
#include <opie2/otodoaccessxml.h>
@@ -45,6 +42,7 @@
#include <opie2/ocontactaccessbackend_xml.h>
#include <opie2/ocontactaccessbackend_vcard.h>
#include <opie2/odatebookaccessbackend_xml.h>
+#include <opie2/odebug.h>
#ifdef __USE_SQL
#include <opie2/otodoaccesssql.h>
@@ -52,6 +50,14 @@
#include <opie2/odatebookaccessbackend_sql.h>
#endif
+#include <qpe/config.h>
+
+/* QT */
+#include <qstring.h>
+#include <qasciidict.h>
+
+
+
using namespace Opie;
using namespace Opie::Pim;
@@ -90,7 +96,7 @@ class OBackendFactory
*/
static T* create( OPimGlobal::PimType type, OPimGlobal::DatabaseStyle database,
const QString& appName, const QString& filename = QString::null ){
- qWarning("Selected backend for %d is: %d", type, database );
+ owarn << "Selected backend for " << type << " is: " << database << oendl;
// If we should use the dafult database style, we have to request it
OPimGlobal::DatabaseStyle use_database = database;
if ( use_database == OPimGlobal::DEFAULT ){
@@ -108,7 +114,7 @@ class OBackendFactory
return (T*) new OPimTodoAccessBackendSQL( filename );
break;
#else
- qWarning ("OBackendFactory:: sql Backend for TODO not implemented! Using XML instead!");
+ owarn << "OBackendFactory:: sql Backend for TODO not implemented! Using XML instead!" << oendl;
// Fall through !!
#endif
case OPimGlobal::XML:
@@ -127,7 +133,7 @@ class OBackendFactory
return (T*) new OPimContactAccessBackend_SQL( appName, filename );
break;
#else
- qWarning ("OBackendFactory:: sql Backend for CONTACT not implemented! Using XML instead!");
+ owarn << "OBackendFactory:: sql Backend for CONTACT not implemented! Using XML instead!" << oendl;
// Fall through !!
#endif
case OPimGlobal::XML:
@@ -146,14 +152,14 @@ class OBackendFactory
return (T*) new ODateBookAccessBackend_SQL( appName, filename );
break;
#else
- qWarning("OBackendFactory:: sql Backend for DATEBOOK not implemented! Using XML instead!");
+ owarn << "OBackendFactory:: sql Backend for DATEBOOK not implemented! Using XML instead!" << oendl;
// Fall through !!
#endif
case OPimGlobal::XML:
return (T*) new ODateBookAccessBackend_XML( appName, filename );
break;
case OPimGlobal::VCARD:
- qWarning("OBackendFactory:: VCal Backend for DATEBOOK not implemented!");
+ owarn << "OBackendFactory:: VCal Backend for DATEBOOK not implemented!" << oendl;
return (T*) NULL;
break;
}
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
index 5ffcb11..00d62ee 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
@@ -137,8 +137,8 @@ bool OPimContactAccessBackend_XML::save()
// move the file over, I'm just going to use the system call
// because, I don't feel like using QDir.
if ( ::rename( strNewFile.latin1(), m_fileName.latin1() ) < 0 ) {
- qWarning( "problem renaming file %s to %s, errno: %d",
- strNewFile.latin1(), m_journalName.latin1(), errno );
+ owarn << "problem renaming file " << strNewFile << " to " << m_journalName
+ << ", errno: " << errno << oendl;
// remove the tmp file...
QFile::remove( strNewFile );
}
@@ -278,15 +278,13 @@ QArray<int> OPimContactAccessBackend_XML::queryByExample ( const OPimContact &qu
// Check whether the birthday/anniversary date is between
// the current/given date and the maximum date
// ( maximum time range ) !
- qWarning("Checking if %s is between %s and %s ! ",
- checkDate->toString().latin1(),
- current.toString().latin1(),
- queryDate->toString().latin1() );
+ owarn << "Checking if " << checkDate->toString() << " is between " << current.toString()
+ << " and " << queryDate->toString() << " ! " << oendl;
if ( current.daysTo( *queryDate ) >= 0 ){
if ( !( ( *checkDate >= current ) &&
( *checkDate <= *queryDate ) ) ){
allcorrect = false;
- qWarning (" Nope!..");
+ owarn << " Nope!.." << oendl;
}
}
}
@@ -607,8 +605,8 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal
/* Search Tag "Contacts" which is the parent of all Contacts */
while( element && !isJournal ){
if( element->tagName() != QString::fromLatin1("Contacts") ){
- //qWarning ("OPimContactDefBack::Searching for Tag \"Contacts\"! Found: %s",
- // element->tagName().latin1());
+ //owarn << "OPimContactDefBack::Searching for Tag \"Contacts\"! Found: "
+ // << element->tagName() << oendl;
element = element->nextChild();
} else {
element = element->firstChild();
@@ -618,16 +616,16 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal
/* Parse all Contacts and ignore unknown tags */
while( element ){
if( element->tagName() != QString::fromLatin1("Contact") ){
- //qWarning ("OPimContactDefBack::Searching for Tag \"Contact\"! Found: %s",
- // element->tagName().latin1());
+ //owarn << "OPimContactDefBack::Searching for Tag \"Contact\"! Found: "
+ // << element->tagName() << oendl;
element = element->nextChild();
continue;
}
/* Found alement with tagname "contact", now parse and store all
* attributes contained
*/
- //qWarning("OPimContactDefBack::load element tagName() : %s",
- // element->tagName().latin1() );
+ //owarn << "OPimContactDefBack::load element tagName() : "
+ // << element->tagName() << oendl;
QString dummy;
foundAction = false;
@@ -636,7 +634,7 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal
contactMap.clear();
customMap.clear();
for( it = aMap.begin(); it != aMap.end(); ++it ){
- // qWarning ("Read Attribute: %s=%s", it.key().latin1(),it.data().latin1());
+ // owarn << "Read Attribute: " << it.key() << "=" << it.data() << oendl;
int *find = dict[ it.key() ];
/* Unknown attributes will be stored as "Custom" elements */
@@ -662,7 +660,7 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal
case JOURNALACTION:
action = journal_action(it.data().toInt());
foundAction = true;
- qWarning ("ODefBack(journal)::ACTION found: %d", action);
+ owarn << "ODefBack(journal)::ACTION found: " << action << oendl;
break;
case JOURNALROW:
journalKey = it.data().toInt();
@@ -687,16 +685,14 @@ bool OPimContactAccessBackend_XML::load( const QString filename, bool isJournal
break;
case ACTION_REMOVE:
if ( !remove (contact.uid()) )
- qWarning ("ODefBack(journal)::Unable to remove uid: %d",
- contact.uid() );
+ owarn << "ODefBack(journal)::Unable to remove uid: " << contact.uid() << oendl;
break;
case ACTION_REPLACE:
if ( !replace ( contact ) )
- qWarning ("ODefBack(journal)::Unable to replace uid: %d",
- contact.uid() );
+ owarn << "ODefBack(journal)::Unable to replace uid: " << contact.uid() << oendl;
break;
default:
- qWarning ("Unknown action: ignored !");
+ owarn << "Unknown action: ignored !" << oendl;
break;
}
}else{
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
@@ -36,6 +36,16 @@
#include "ocontactaccess.h"
#include "obackendfactory.h"
+/* 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>
#include <qdatetime.h>
#include <qfile.h>
@@ -43,17 +53,12 @@
#include <qlist.h>
#include <qcopchannel_qws.h>
-//#include <qpe/qcopenvelope_qws.h>
-#include <qpe/global.h>
-
+/* STD */
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
-#include <opie2/ocontactaccessbackend_xml.h>
-#include <opie2/opimresolver.h>
-#include <opie2/opimglobal.h>
namespace Opie {
@@ -65,7 +70,7 @@ OPimContactAccess::OPimContactAccess ( const QString appname, const QString ,
* will use the XML-Backend as default (until we have a cute SQL-Backend..).
*/
if( end == 0 ) {
- qWarning ("Using BackendFactory !");
+ owarn << "Using BackendFactory !" << oendl;
end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname );
}
// Set backend locally and in template
@@ -139,13 +144,13 @@ bool OPimContactAccess::wasChangedExternally()const
void OPimContactAccess::copMessage( const QCString &msg, const QByteArray & )
{
if ( msg == "addressbookUpdated()" ){
- qWarning ("OPimContactAccess: Received addressbokUpdated()");
+ owarn << "OPimContactAccess: Received addressbokUpdated()" << oendl;
emit signalChanged ( this );
} else if ( msg == "flush()" ) {
- qWarning ("OPimContactAccess: Received flush()");
+ owarn << "OPimContactAccess: Received flush()" << oendl;
save ();
} else if ( msg == "reload()" ) {
- qWarning ("OPimContactAccess: Received reload()");
+ owarn << "OPimContactAccess: Received reload()" << oendl;
reload ();
emit signalChanged ( this );
}
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
@@ -30,14 +30,17 @@
#ifndef OPIE_PIM_ACCESS_TEMPLATE_H
#define OPIE_PIM_ACCESS_TEMPLATE_H
-#include <qarray.h>
-
+/* OPIE */
#include <opie2/opimrecord.h>
#include <opie2/opimaccessbackend.h>
#include <opie2/opimrecordlist.h>
#include <opie2/opimcache.h>
#include <opie2/opimtemplatebase.h>
+#include <opie2/odebug.h>
+
+/* QT */
+#include <qarray.h>
namespace Opie {
@@ -205,7 +208,7 @@ OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end )
}
template <class T>
OPimAccessTemplate<T>::~OPimAccessTemplate() {
- qWarning("~OPimAccessTemplate<T>");
+ owarn << "~OPimAccessTemplate<T>" << oendl;
delete m_backEnd;
}
template <class T>
@@ -260,7 +263,7 @@ T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar,
* after a find this way we would
* avoid two finds in QCache...
*/
- // qWarning("find it now %d", uid );
+ // owarn << "find it now " << uid << oendl;
if (m_cache.contains( uid ) ) {
return m_cache.find( 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
@@ -1173,7 +1173,7 @@ void OPimContact::setAnniversary( const QDate &v )
QDate OPimContact::birthday() const
{
QString str = find( Qtopia::Birthday );
- // qWarning ("Birthday %s", str.latin1() );
+ // owarn << "Birthday " << str << oendl;
if ( !str.isEmpty() )
return OPimDateConversion::dateFromString ( str );
else
@@ -1188,7 +1188,7 @@ QDate OPimContact::anniversary() const
{
QDate empty;
QString str = find( Qtopia::Anniversary );
- // qWarning ("Anniversary %s", str.latin1() );
+ // owarn << "Anniversary " << str << oendl;
if ( !str.isEmpty() )
return OPimDateConversion::dateFromString ( str );
else
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
@@ -227,8 +227,8 @@ void OPimNotifyManager::alarmsFromString( const QString& str )
{
QStringList alarm = QStringList::split( ":", ( *it ), TRUE ); // allow empty
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 ] ),
alarm[ 1 ].toInt() );
add( al );
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
@@ -33,6 +33,7 @@
/* OPIE */
#include <opie2/opimtemplatebase.h>
#include <opie2/opimrecord.h>
+//#include <opie2/odebug.h>
/* QT */
#include <qarray.h>
@@ -189,7 +190,7 @@ OPimRecordListIterator<T>::~OPimRecordListIterator()
template <class T>
OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator<T>& it )
{
- // qWarning("OPimRecordListIterator copy c'tor");
+ //owarn << "OPimRecordListIterator copy c'tor" << oendl;
m_uids = it.m_uids;
m_current = it.m_current;
m_temp = it.m_temp;
@@ -215,7 +216,7 @@ OPimRecordListIterator<T> &OPimRecordListIterator<T>::operator=( const OPimRecor
template <class T>
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 )
m_record = m_temp->find( m_uids[ m_current ], m_uids, m_current,
m_direction ? Base::Forward :