summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp
index d0c8052..f121cc2 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp
@@ -41,4 +41,4 @@
-#include <opie2/ocontactfields.h>
-#include <opie2/oconversion.h>
+#include <opie2/opimcontactfields.h>
+#include <opie2/opimdateconversion.h>
#include <opie2/osqldriver.h>
@@ -107,3 +107,3 @@ namespace Opie {
/**
- * inserts/adds a OContact to the table
+ * inserts/adds a OPimContact to the table
*/
@@ -111,3 +111,3 @@ namespace Opie {
public:
- InsertQuery(const OContact& );
+ InsertQuery(const OPimContact& );
~InsertQuery();
@@ -115,3 +115,3 @@ namespace Opie {
private:
- OContact m_contact;
+ OPimContact m_contact;
};
@@ -178,3 +178,3 @@ namespace Opie {
- QStringList fieldList = OContactFields::untrfields( false );
+ QStringList fieldList = OPimContactFields::untrfields( false );
for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){
@@ -225,3 +225,3 @@ namespace Opie {
- InsertQuery::InsertQuery( const OContact& contact )
+ InsertQuery::InsertQuery( const OPimContact& contact )
: OSQLQuery(), m_contact( contact ) {
@@ -233,3 +233,3 @@ namespace Opie {
/*
- * converts from a OContact to a query
+ * converts from a OPimContact to a query
*/
@@ -246,4 +246,4 @@ namespace Opie {
- QStringList fieldList = OContactFields::untrfields( false );
- QMap<QString, int> translate = OContactFields::untrFieldsToId();
+ QStringList fieldList = OPimContactFields::untrfields( false );
+ QMap<QString, int> translate = OPimContactFields::untrFieldsToId();
for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){
@@ -297,3 +297,3 @@ namespace Opie {
// Get the translation from the ID to the String
- QMap<int, QString> transMap = OContactFields::idToUntrFields();
+ QMap<int, QString> transMap = OPimContactFields::idToUntrFields();
@@ -461,7 +461,7 @@ namespace Opie {
-OContactAccessBackend_SQL::OContactAccessBackend_SQL ( const QString& /* appname */,
+OPimContactAccessBackend_SQL::OPimContactAccessBackend_SQL ( const QString& /* appname */,
const QString& filename ):
- OContactAccessBackend(), m_changed(false), m_driver( NULL )
+ OPimContactAccessBackend(), m_changed(false), m_driver( NULL )
{
- qWarning("C'tor OContactAccessBackend_SQL starts");
+ qWarning("C'tor OPimContactAccessBackend_SQL starts");
QTime t;
@@ -482,6 +482,6 @@ OContactAccessBackend_SQL::OContactAccessBackend_SQL ( const QString& /* appname
- qWarning("C'tor OContactAccessBackend_SQL ends: %d ms", t.elapsed() );
+ qWarning("C'tor OPimContactAccessBackend_SQL ends: %d ms", t.elapsed() );
}
-OContactAccessBackend_SQL::~OContactAccessBackend_SQL ()
+OPimContactAccessBackend_SQL::~OPimContactAccessBackend_SQL ()
{
@@ -491,3 +491,3 @@ OContactAccessBackend_SQL::~OContactAccessBackend_SQL ()
-bool OContactAccessBackend_SQL::load ()
+bool OPimContactAccessBackend_SQL::load ()
{
@@ -508,3 +508,3 @@ bool OContactAccessBackend_SQL::load ()
-bool OContactAccessBackend_SQL::reload()
+bool OPimContactAccessBackend_SQL::reload()
{
@@ -513,3 +513,3 @@ bool OContactAccessBackend_SQL::reload()
-bool OContactAccessBackend_SQL::save()
+bool OPimContactAccessBackend_SQL::save()
{
@@ -519,3 +519,3 @@ bool OContactAccessBackend_SQL::save()
-void OContactAccessBackend_SQL::clear ()
+void OPimContactAccessBackend_SQL::clear ()
{
@@ -527,3 +527,3 @@ void OContactAccessBackend_SQL::clear ()
-bool OContactAccessBackend_SQL::wasChangedExternally()
+bool OPimContactAccessBackend_SQL::wasChangedExternally()
{
@@ -532,3 +532,3 @@ bool OContactAccessBackend_SQL::wasChangedExternally()
-QArray<int> OContactAccessBackend_SQL::allRecords() const
+QArray<int> OPimContactAccessBackend_SQL::allRecords() const
{
@@ -538,3 +538,3 @@ QArray<int> OContactAccessBackend_SQL::allRecords() const
if ( m_changed )
- ((OContactAccessBackend_SQL*)this)->update();
+ ((OPimContactAccessBackend_SQL*)this)->update();
@@ -543,3 +543,3 @@ QArray<int> OContactAccessBackend_SQL::allRecords() const
-bool OContactAccessBackend_SQL::add ( const OContact &newcontact )
+bool OPimContactAccessBackend_SQL::add ( const OPimContact &newcontact )
{
@@ -559,3 +559,3 @@ bool OContactAccessBackend_SQL::add ( const OContact &newcontact )
-bool OContactAccessBackend_SQL::remove ( int uid )
+bool OPimContactAccessBackend_SQL::remove ( int uid )
{
@@ -572,3 +572,3 @@ bool OContactAccessBackend_SQL::remove ( int uid )
-bool OContactAccessBackend_SQL::replace ( const OContact &contact )
+bool OPimContactAccessBackend_SQL::replace ( const OPimContact &contact )
{
@@ -581,5 +581,5 @@ bool OContactAccessBackend_SQL::replace ( const OContact &contact )
-OContact OContactAccessBackend_SQL::find ( int uid ) const
+OPimContact OPimContactAccessBackend_SQL::find ( int uid ) const
{
- qWarning("OContactAccessBackend_SQL::find()");
+ qWarning("OPimContactAccessBackend_SQL::find()");
QTime t;
@@ -587,6 +587,6 @@ OContact OContactAccessBackend_SQL::find ( int uid ) const
- OContact retContact( requestNonCustom( uid ) );
+ OPimContact retContact( requestNonCustom( uid ) );
retContact.setExtraMap( requestCustom( uid ) );
- qWarning("OContactAccessBackend_SQL::find() needed: %d ms", t.elapsed() );
+ qWarning("OPimContactAccessBackend_SQL::find() needed: %d ms", t.elapsed() );
return retContact;
@@ -596,3 +596,3 @@ OContact OContactAccessBackend_SQL::find ( int uid ) const
-QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, int settings, const QDateTime& d = QDateTime() )
+QArray<int> OPimContactAccessBackend_SQL::queryByExample ( const OPimContact &query, int settings, const QDateTime& d = QDateTime() )
{
@@ -601,4 +601,4 @@ QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, i
QMap<int, QString> queryFields = query.toMap();
- QStringList fieldList = OContactFields::untrfields( false );
- QMap<QString, int> translate = OContactFields::untrFieldsToId();
+ QStringList fieldList = OPimContactFields::untrfields( false );
+ QMap<QString, int> translate = OPimContactFields::untrFieldsToId();
@@ -616,3 +616,3 @@ QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, i
// Do exist a better solution to switch this ?
- if ( settings & OContactAccess::IgnoreCase )
+ if ( settings & OPimContactAccess::IgnoreCase )
qu += "(\"" + *it + "\"" + " LIKE " + "'"
@@ -645,3 +645,3 @@ QArray<int> OContactAccessBackend_SQL::queryByExample ( const OContact &query, i
-QArray<int> OContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const
+QArray<int> OPimContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const
{
@@ -651,11 +651,11 @@ QArray<int> OContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const
-const uint OContactAccessBackend_SQL::querySettings()
+const uint OPimContactAccessBackend_SQL::querySettings()
{
- return OContactAccess::IgnoreCase
- || OContactAccess::WildCards;
+ return OPimContactAccess::IgnoreCase
+ || OPimContactAccess::WildCards;
}
-bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const
+bool OPimContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const
{
- /* OContactAccess::IgnoreCase, DateDiff, DateYear, DateMonth, DateDay
+ /* OPimContactAccess::IgnoreCase, DateDiff, DateYear, DateMonth, DateDay
* may be added with any of the other settings. IgnoreCase should never used alone.
@@ -666,10 +666,10 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const
if ( ( querySettings & (
- OContactAccess::IgnoreCase
- | OContactAccess::WildCards
-// | OContactAccess::DateDiff
-// | OContactAccess::DateYear
-// | OContactAccess::DateMonth
-// | OContactAccess::DateDay
-// | OContactAccess::RegExp
-// | OContactAccess::ExactMatch
+ OPimContactAccess::IgnoreCase
+ | OPimContactAccess::WildCards
+// | OPimContactAccess::DateDiff
+// | OPimContactAccess::DateYear
+// | OPimContactAccess::DateMonth
+// | OPimContactAccess::DateDay
+// | OPimContactAccess::RegExp
+// | OPimContactAccess::ExactMatch
) ) != querySettings )
@@ -680,3 +680,3 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const
// IngoreCase alone is invalid
- if ( querySettings == OContactAccess::IgnoreCase )
+ if ( querySettings == OPimContactAccess::IgnoreCase )
return false;
@@ -684,14 +684,14 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const
// WildCards, RegExp and ExactMatch should never used at the same time
- switch ( querySettings & ~( OContactAccess::IgnoreCase
- | OContactAccess::DateDiff
- | OContactAccess::DateYear
- | OContactAccess::DateMonth
- | OContactAccess::DateDay
+ switch ( querySettings & ~( OPimContactAccess::IgnoreCase
+ | OPimContactAccess::DateDiff
+ | OPimContactAccess::DateYear
+ | OPimContactAccess::DateMonth
+ | OPimContactAccess::DateDay
)
){
- case OContactAccess::RegExp:
+ case OPimContactAccess::RegExp:
return ( true );
- case OContactAccess::WildCards:
+ case OPimContactAccess::WildCards:
return ( true );
- case OContactAccess::ExactMatch:
+ case OPimContactAccess::ExactMatch:
return ( true );
@@ -705,3 +705,3 @@ bool OContactAccessBackend_SQL::hasQuerySettings (uint querySettings) const
-QArray<int> OContactAccessBackend_SQL::sorted( bool asc, int , int , int )
+QArray<int> OPimContactAccessBackend_SQL::sorted( bool asc, int , int , int )
{
@@ -737,3 +737,3 @@ QArray<int> OContactAccessBackend_SQL::sorted( bool asc, int , int , int )
-void OContactAccessBackend_SQL::update()
+void OPimContactAccessBackend_SQL::update()
{
@@ -758,3 +758,3 @@ void OContactAccessBackend_SQL::update()
-QArray<int> OContactAccessBackend_SQL::extractUids( OSQLResult& res ) const
+QArray<int> OPimContactAccessBackend_SQL::extractUids( OSQLResult& res ) const
{
@@ -780,3 +780,3 @@ QArray<int> OContactAccessBackend_SQL::extractUids( OSQLResult& res ) const
#ifdef __STORE_HORIZONTAL_
-QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
+QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) const
{
@@ -800,4 +800,4 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
// Now loop through all columns
- QStringList fieldList = OContactFields::untrfields( false );
- QMap<QString, int> translate = OContactFields::untrFieldsToId();
+ QStringList fieldList = OPimContactFields::untrfields( false );
+ QMap<QString, int> translate = OPimContactFields::untrFieldsToId();
for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){
@@ -822,3 +822,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
QDate date( year, month, day );
- nonCustomMap.insert( id, OConversion::dateToString( date ) );
+ nonCustomMap.insert( id, OPimDateConversion::dateToString( date ) );
}
@@ -845,3 +845,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
-QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
+QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) const
{
@@ -868,3 +868,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
t3.start();
- QMap<QString, int> translateMap = OContactFields::untrFieldsToId();
+ QMap<QString, int> translateMap = OPimContactFields::untrFieldsToId();
@@ -889,3 +889,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
QDate date( year, month, day );
- nonCustomMap.insert( typeId, OConversion::dateToString( date ) );
+ nonCustomMap.insert( typeId, OPimDateConversion::dateToString( date ) );
}
@@ -908,3 +908,3 @@ QMap<int, QString> OContactAccessBackend_SQL::requestNonCustom( int uid ) const
-QMap<QString, QString> OContactAccessBackend_SQL::requestCustom( int uid ) const
+QMap<QString, QString> OPimContactAccessBackend_SQL::requestCustom( int uid ) const
{