Diffstat (limited to 'libopie2/opiepim/core/ocontactaccess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp index 771d855..9bbc820 100644 --- a/libopie2/opiepim/core/ocontactaccess.cpp +++ b/libopie2/opiepim/core/ocontactaccess.cpp | |||
@@ -61,25 +61,24 @@ | |||
61 | 61 | ||
62 | 62 | ||
63 | namespace Opie { | 63 | namespace Opie { |
64 | 64 | ||
65 | OPimContactAccess::OPimContactAccess ( const QString appname, const QString , | 65 | OPimContactAccess::OPimContactAccess ( const QString appname, const QString , |
66 | OPimContactAccessBackend* end, bool autosync ): | 66 | OPimContactAccessBackend* end, bool autosync ): |
67 | OPimAccessTemplate<OPimContact>( end ) | 67 | OPimAccessTemplate<OPimContact>( end ) |
68 | { | 68 | { |
69 | /* take care of the backend. If there is no one defined, we | 69 | /* take care of the backend. If there is no one defined, we |
70 | * will use the XML-Backend as default (until we have a cute SQL-Backend..). | 70 | * will use the XML-Backend as default (until we have a cute SQL-Backend..). |
71 | */ | 71 | */ |
72 | if( end == 0 ) { | 72 | if( end == 0 ) { |
73 | owarn << "Using BackendFactory !" << oendl; | ||
74 | end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname ); | 73 | end = OBackendFactory<OPimContactAccessBackend>::defaultBackend( OPimGlobal::CONTACTLIST, appname ); |
75 | } | 74 | } |
76 | // Set backend locally and in template | 75 | // Set backend locally and in template |
77 | m_backEnd = end; | 76 | m_backEnd = end; |
78 | OPimAccessTemplate<OPimContact>::setBackEnd (end); | 77 | OPimAccessTemplate<OPimContact>::setBackEnd (end); |
79 | 78 | ||
80 | 79 | ||
81 | /* Connect signal of external db change to function */ | 80 | /* Connect signal of external db change to function */ |
82 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); | 81 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); |
83 | connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), | 82 | connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), |
84 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); | 83 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); |
85 | if ( autosync ){ | 84 | if ( autosync ){ |
@@ -119,46 +118,46 @@ bool OPimContactAccess::save () | |||
119 | return true; | 118 | return true; |
120 | } | 119 | } |
121 | 120 | ||
122 | const uint OPimContactAccess::querySettings() | 121 | const uint OPimContactAccess::querySettings() |
123 | { | 122 | { |
124 | return ( m_backEnd->querySettings() ); | 123 | return ( m_backEnd->querySettings() ); |
125 | } | 124 | } |
126 | 125 | ||
127 | bool OPimContactAccess::hasQuerySettings ( int querySettings ) const | 126 | bool OPimContactAccess::hasQuerySettings ( int querySettings ) const |
128 | { | 127 | { |
129 | return ( m_backEnd->hasQuerySettings ( querySettings ) ); | 128 | return ( m_backEnd->hasQuerySettings ( querySettings ) ); |
130 | } | 129 | } |
130 | |||
131 | #if 0 | ||
131 | OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const | 132 | OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const |
132 | { | 133 | { |
133 | QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); | 134 | QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); |
134 | return ( OPimRecordList<OPimContact>(matchingContacts, this) ); | 135 | return ( OPimRecordList<OPimContact>(matchingContacts, this) ); |
135 | } | 136 | } |
137 | #endif | ||
136 | 138 | ||
137 | 139 | ||
138 | bool OPimContactAccess::wasChangedExternally()const | 140 | bool OPimContactAccess::wasChangedExternally()const |
139 | { | 141 | { |
140 | return ( m_backEnd->wasChangedExternally() ); | 142 | return ( m_backEnd->wasChangedExternally() ); |
141 | } | 143 | } |
142 | 144 | ||
143 | 145 | ||
144 | void OPimContactAccess::copMessage( const QCString &msg, const QByteArray & ) | 146 | void OPimContactAccess::copMessage( const QCString &msg, const QByteArray & ) |
145 | { | 147 | { |
146 | if ( msg == "addressbookUpdated()" ){ | 148 | if ( msg == "addressbookUpdated()" ){ |
147 | owarn << "OPimContactAccess: Received addressbokUpdated()" << oendl; | ||
148 | emit signalChanged ( this ); | 149 | emit signalChanged ( this ); |
149 | } else if ( msg == "flush()" ) { | 150 | } else if ( msg == "flush()" ) { |
150 | owarn << "OPimContactAccess: Received flush()" << oendl; | ||
151 | save (); | 151 | save (); |
152 | } else if ( msg == "reload()" ) { | 152 | } else if ( msg == "reload()" ) { |
153 | owarn << "OPimContactAccess: Received reload()" << oendl; | ||
154 | reload (); | 153 | reload (); |
155 | emit signalChanged ( this ); | 154 | emit signalChanged ( this ); |
156 | } | 155 | } |
157 | } | 156 | } |
158 | 157 | ||
159 | int OPimContactAccess::rtti() const | 158 | int OPimContactAccess::rtti() const |
160 | { | 159 | { |
161 | return OPimResolver::AddressBook; | 160 | return OPimResolver::AddressBook; |
162 | } | 161 | } |
163 | 162 | ||
164 | } | 163 | } |