From be3a5ea82c9a160eeeaad187a357c9a085fdb20a Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 06 Oct 2004 19:41:10 +0000 Subject: bugfixes --- (limited to 'libkdepim') diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp index c0bd6cc..357cd39 100644 --- a/libkdepim/phoneaccess.cpp +++ b/libkdepim/phoneaccess.cpp @@ -40,7 +40,7 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model 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 ); @@ -53,7 +53,7 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model while ( file.readLine( line, 1024 ) > 0 ) { //qDebug("*%s* ", line.latin1() ); if ( line.left(7 ) == "[gammu]" ) { - ; + ; } else if ( line.left(4 ) == "port" ) { if ( line == "port = " + device+"\n" ) { @@ -93,18 +93,14 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model 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; @@ -112,8 +108,6 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model } if ( addModel ) { - if ( ! write ) - content += "[gammu]\n"; write = true; content += "model = "; content += model; -- cgit v0.9.0.2