summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/rfcommconfhandler.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/rfcommconfhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
index 20453e8..2ef95ff 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
@@ -47,68 +47,68 @@ RfCommConfHandler::RfCommConfHandler( const QString & filename ) {
RfCommConfHandler::~RfCommConfHandler() {
}
void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) {
QFile rfCommConf( "/tmp/test" );
QTextStream outStream( &rfCommConf );
if ( rfCommConf.open( IO_WriteOnly ) ) {
QMap<QString, RfCommConfObject*>::Iterator it;
for( it = devices.begin(); it != devices.end(); ++it ) {
outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n";
outStream << " device " + it.data()->mac() + ";\n";
outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n";
outStream << " comment \"" + it.data()->comment() + "\";\n";
outStream << "}\n\n";
}
rfCommConf.close();
}
}
QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() {
return m_foundEntries;
}
void RfCommConfHandler::load() {
QFile rfCommConf( m_filename );
if ( rfCommConf.open( IO_ReadOnly ) ) {
QStringList list;
QTextStream inStream( &rfCommConf );
list = QStringList::split( "\n", inStream.read() );
QString number;
QString mac;
QString channel;
QString comment;
for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) {
QString tmpLine = ( *line ).stripWhiteSpace();
if ( tmpLine.startsWith("rfcomm") ) {
QString number = tmpLine.mid( 6,1 );
- qDebug( tmpLine );
- qDebug( "TEST " + number );
+ odebug << tmpLine << oendl;
+ odebug << "TEST " + number << oendl;
} else if ( tmpLine.startsWith( "}" ) ) {
m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) );
} else if ( tmpLine.startsWith( "device" ) ) {
mac = tmpLine.mid( 7, 17 );
- qDebug( "mac" + mac );
+ odebug << "mac" + mac << oendl;
} else if ( tmpLine.startsWith( "channel" ) ) {
channel = tmpLine.mid( 8, 1 );
qDebug ( "Channel :" + channel );
} else if ( tmpLine.startsWith( "comment" ) ) {
comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 );
- qDebug( "Comment: " + comment );
+ odebug << "Comment: " + comment << oendl;
}
}
rfCommConf.close();
}
save( m_foundEntries );
- qDebug( QString( "ENTries: %1").arg( m_foundEntries.count() ) );
+ odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl;
}