summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/phoneaccess.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index c0bd6cc..357cd39 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -37,13 +37,13 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
#ifdef _WIN32_
QString fileName = qApp->applicationDirPath () +"\\gammurc";
#else
QString fileName = QDir::homeDirPath() +"/.gammurc";
#endif
//qDebug("save %d ", load );
- QString content;
+ QString content = "[gammu]\n";;
bool write = false;
bool addPort = true, addConnection = true, addModel = true;
QFile file( fileName );
if ( QFile::exists( fileName) ) {
if (!file.open( IO_ReadOnly ) ) {
qDebug("Error: cannot open %s ", fileName.latin1() );
@@ -92,31 +92,25 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
if ( ! model.isEmpty() ) {
addModel = true;
}
}
if ( addConnection ) {
- if ( ! write )
- content += "[gammu]\n";
write = true;
content += "connection = ";
content += connection;
content += "\n";
}
if ( addPort ) {
- if ( ! write )
- content += "[gammu]\n";
write = true;
content += "port = ";
content += device;
content += "\n";
}
if ( addModel ) {
- if ( ! write )
- content += "[gammu]\n";
write = true;
content += "model = ";
content += model;
content += "\n";
}
if ( write ) {