summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/qtopia/resourceqtopia.cpp
Side-by-side diff
Diffstat (limited to 'kabc/plugins/qtopia/resourceqtopia.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 79ddaea..a36eb8f 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -22,25 +22,25 @@
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#include <sys/types.h>
#include <sys/stat.h>
#ifndef _WIN32_
#include <unistd.h>
#endif
#include <qdir.h>
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qfileinfo.h>
#include <qregexp.h>
//US #include <qtimer.h>
#include <kapplication.h>
#include <kconfig.h>
#include <kdebug.h>
#include <klocale.h>
//US #include <ksavefile.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
@@ -147,25 +147,25 @@ void ResourceQtopia::doClose()
// it seems so, that deletion of access deletes backend as well
//delete backend;
return;
}
bool ResourceQtopia::load()
{
QFile file( fileName() );
- if ( !file.open(IO_ReadOnly ) ) {
+ if ( !file.open(QIODevice::ReadOnly ) ) {
return false;
}
QDomDocument doc("mydocument" );
if ( !doc.setContent( &file ) ) {
file.close();
return false;
}
bool res;
QDomElement docElem = doc.documentElement( );
QDomNode n = docElem.firstChild();
while ( !n.isNull() ) {
@@ -194,30 +194,30 @@ bool ResourceQtopia::load()
}
return true;
}
bool ResourceQtopia::save( Ticket *ticket )
{
#ifdef _USE_DIRWATCH_
mDirWatch.stopScan();
#endif
KABC::AddressBook::Iterator it;
bool res;
QFile file( fileName() );
- if (!file.open( IO_WriteOnly ) ) {
+ if (!file.open( QIODevice::WriteOnly ) ) {
return false;
}
- QTextStream ts( &file );
- QTextStream *stream = &ts;
- stream->setEncoding( QTextStream::UnicodeUTF8 );
+ Q3TextStream ts( &file );
+ Q3TextStream *stream = &ts;
+ stream->setEncoding( Q3TextStream::UnicodeUTF8 );
*stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>" << endl;
*stream << " <Groups>" << endl;
*stream << " </Groups>" << endl;
*stream << " <Contacts> " << endl;
// for all entries
KABC::Addressee ab;
for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
KABC::Addressee addressee = (*it);
res = mConverter->addresseeToQtopia( addressee, stream );
if (!res == true)
{
qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1());
@@ -251,25 +251,25 @@ bool ResourceQtopia::lock( const QString &lockfileName )
}
QString lockUniqueName;
lockUniqueName = fn + KApplication::randomString( 8 );
url = lockUniqueName;
//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName );
mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() );
kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl;
// Create unique file
QFile file( mLockUniqueName );
- file.open( IO_WriteOnly );
+ file.open( QIODevice::WriteOnly );
file.close();
// Create lock file
int result = 0;
#ifndef _WIN32_
result = ::link( QFile::encodeName( mLockUniqueName ),
QFile::encodeName( lockName ) );
#endif
if ( result == 0 ) {
addressBook()->emitAddressBookLocked();
return true;
}