summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp15
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.cpp17
2 files changed, 20 insertions, 12 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
index b569f8b..ffa6a7d 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp
@@ -28,15 +28,20 @@
*/
/*
* VCard Backend for the OPIE-Contact Database.
*/
-#include <opie2/ocontactaccessbackend_vcard.h>
-#include "../../../../library/backend/vobject_p.h"
-#include "../../../../library/backend/qfiledirect_p.h"
+
+#include "vobject_p.h"
+
+/* OPIE */
+#include <opie2/ocontactaccessbackend_vcard.h>
#include <qpe/timeconversion.h>
+//FIXME: Hack to allow direct access to FILE* fh. Rewrite this!
+#define protected public
#include <qfile.h>
+#undef protected
namespace Opie {
OPimContactAccessBackend_VCard::OPimContactAccessBackend_VCard ( const QString& , const QString& filename ):
@@ -93,9 +98,9 @@ bool OPimContactAccessBackend_VCard::save()
{
if (!m_dirty )
return true;
- QFileDirect file( m_file );
+ QFile file( m_file );
if (!file.open(IO_WriteOnly ) )
return false;
VObject *obj;
@@ -104,9 +109,9 @@ bool OPimContactAccessBackend_VCard::save()
VObject *vo;
for(QMap<int, OPimContact>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){
vo = createVObject( *it );
- writeVObject( file.directHandle() , vo );
+ writeVObject( file.fh, vo ); //FIXME: HACK!!!
cleanVObject( vo );
}
cleanStrTbl();
deleteVObject( obj );
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp
index 0a1baf9..03d4479 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.cpp
+++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp
@@ -25,16 +25,19 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-#include <qfile.h>
-
-#include <qtopia/private/vobject_p.h>
-#include <qtopia/timeconversion.h>
-#include <qtopia/private/qfiledirect_p.h>
+/* OPIE */
+#include "vobject_p.h"
+#include <qpe/timeconversion.h>
#include <opie2/otodoaccessvcal.h>
+//FIXME: Hack to allow direct access to FILE* fh. Rewrite this!
+#define protected public
+#include <qfile.h>
+#undef protected
+
using namespace Opie;
namespace {
static OPimTodo eventByVObj( VObject *obj ){
@@ -178,9 +181,9 @@ bool OPimTodoAccessVCal::reload() {
bool OPimTodoAccessVCal::save() {
if (!m_dirty )
return true;
- QFileDirect file( m_file );
+ QFile file( m_file );
if (!file.open(IO_WriteOnly ) )
return false;
VObject *obj;
@@ -190,9 +193,9 @@ bool OPimTodoAccessVCal::save() {
for(QMap<int, OPimTodo>::ConstIterator it=m_map.begin(); it !=m_map.end(); ++it ){
vo = vobjByEvent( it.data() );
addVObjectProp(obj, vo );
}
- writeVObject( file.directHandle(), obj );
+ writeVObject( file.fh, obj ); //FIXME: HACK!!!
cleanVObject( obj );
cleanStrTbl();
m_dirty = false;