Diffstat (limited to 'noncore/net/opietooth/manager/hciconfwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/hciconfwrapper.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/noncore/net/opietooth/manager/hciconfwrapper.cpp b/noncore/net/opietooth/manager/hciconfwrapper.cpp index db6a326..7b2497a 100644 --- a/noncore/net/opietooth/manager/hciconfwrapper.cpp +++ b/noncore/net/opietooth/manager/hciconfwrapper.cpp @@ -1,13 +1,13 @@ -#include "hciconfwrapper.h" + #include "hciconfwrapper.h" #include <qfile.h> #include <qtextstream.h> #include <qstringlist.h> #include <qregexp.h> namespace OpieTooth { HciConfWrapper::HciConfWrapper( const QString &fileName) { m_fileName = fileName; } @@ -82,34 +82,33 @@ namespace OpieTooth { QStringList list; qDebug(m_fileName); QTextStream stream ( &f); QTextStream outstream (&f2); QString str; while ( !(str=stream.readLine()).isNull() ) { //qDebug(str); if( (str.contains(key)) > 0 ) { qDebug("Found"); - // still need look if its commented out!!! + // still need to look if its commented out!!! str.simplifyWhiteSpace(); qDebug( key ); if (str.startsWith("#")) { - outstream << (key + " " + value + ";\n"); + str = (key + " " + value + ";"); } else { - str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";\n"); + str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";"); } qDebug( str ); - outstream << str; - } else { - outstream << str + "\n"; } + + outstream << str << endl; } f.close(); f2.flush(); f2.close(); } } |