summaryrefslogtreecommitdiffabout
path: root/libkdepim/phoneaccess.cpp
Unidiff
Diffstat (limited to 'libkdepim/phoneaccess.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/phoneaccess.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index 89db22b..0ea73f5 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -22,11 +22,12 @@
22 22
23#include <qstring.h> 23#include <qstring.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qptrlist.h> 25#include <QDesktopWidget>
26#include <q3ptrlist.h>
26#include <qregexp.h> 27#include <qregexp.h>
27#include <qfile.h> 28#include <qfile.h>
28#include <qlabel.h> 29#include <qlabel.h>
29#include <qtextstream.h> 30#include <q3textstream.h>
30#include <qtextcodec.h> 31#include <qtextcodec.h>
31#include <qdir.h> 32#include <qdir.h>
32#include <kmessagebox.h> 33#include <kmessagebox.h>
@@ -46,12 +47,14 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
46 bool addPort = true, addConnection = true, addModel = true; 47 bool addPort = true, addConnection = true, addModel = true;
47 QFile file( fileName ); 48 QFile file( fileName );
48 if ( QFile::exists( fileName) ) { 49 if ( QFile::exists( fileName) ) {
49 if (!file.open( IO_ReadOnly ) ) { 50 if (!file.open( QIODevice::ReadOnly ) ) {
50 qDebug("Error: cannot open %s ", fileName.latin1() ); 51 qDebug("Error: cannot open %s ", fileName.latin1() );
51 return; 52 return;
52 } 53 }
53 QString line; 54 QString line;
54 while ( file.readLine( line, 1024 ) > 0 ) { 55 char tmp[1024];
56 while ( file.readLine( tmp, 1024 ) > 0 ) {
57 line = tmp;
55 //qDebug("*%s* ", line.latin1() ); 58 //qDebug("*%s* ", line.latin1() );
56 if ( line.left(7 ) == "[gammu]" ) { 59 if ( line.left(7 ) == "[gammu]" ) {
57 ; 60 ;
@@ -115,12 +118,12 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
115 content += "\n"; 118 content += "\n";
116 } 119 }
117 if ( write ) { 120 if ( write ) {
118 if (!file.open( IO_WriteOnly ) ) { 121 if (!file.open( QIODevice::WriteOnly ) ) {
119 qDebug("Error: cannot write file %s ", fileName.latin1() ); 122 qDebug("Error: cannot write file %s ", fileName.latin1() );
120 return; 123 return;
121 } 124 }
122 qDebug("Writing file %s ", fileName.latin1() ); 125 qDebug("Writing file %s ", fileName.latin1() );
123 QTextStream ts( &file ); 126 Q3TextStream ts( &file );
124 ts << content ; 127 ts << content ;
125 file.close(); 128 file.close();
126 } 129 }