summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/btconfigwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/btconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/btconfigwidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp
index 6246f92..64046d8 100644
--- a/noncore/apps/opie-console/btconfigwidget.cpp
+++ b/noncore/apps/opie-console/btconfigwidget.cpp
@@ -2,25 +2,25 @@
#include <qlayout.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qhbox.h>
#include <qradiobutton.h>
#include "iolayerbase.h"
#include "btconfigwidget.h"
namespace {
void setCurrent( const QString& str, QComboBox* bo ) {
uint b = bo->count();
- for (uint i = 0; i < bo->count(); i++ ) {
+ for (int i = 0; i < bo->count(); i++ ) {
if ( bo->text(i) == str ) {
bo->setCurrentItem( i );
return;
}
}
bo->insertItem( str );
bo->setCurrentItem( b );
}
}
BTConfigWidget::BTConfigWidget( const QString& name,
QWidget* parent,
@@ -107,24 +107,25 @@ void BTConfigWidget::load( const Profile& prof ) {
if ( prof.readEntry("Device").isEmpty() ) return;
setCurrent( prof.readEntry("Device"), m_deviceCmb );
}
/*
* save speed,
* flow,
* parity
*/
void BTConfigWidget::save( Profile& prof ) {
int flow, parity, speed;
+ flow = parity = speed = 0;
prof.writeEntry("Device", m_deviceCmb->currentText() );
switch( m_base->flow() ) {
case IOLayerBase::None:
flow = 0;
break;
case IOLayerBase::Software:
flow = 2;
break;
case IOLayerBase::Hardware:
flow = 1;
@@ -147,24 +148,25 @@ void BTConfigWidget::save( Profile& prof ) {
case IOLayerBase::Baud_115200:
speed = 115200;
break;
case IOLayerBase::Baud_57600:
speed = 57600;
break;
case IOLayerBase::Baud_38400:
speed = 38400;
break;
case IOLayerBase::Baud_19200:
speed = 19200;
break;
+ default:
case IOLayerBase::Baud_9600:
speed = 9600;
break;
}
prof.writeEntry("Flow", flow);
prof.writeEntry("Parity", parity);
prof.writeEntry("Speed", speed);
prof.writeEntry("Mac", m_mac->text() );
}
void BTConfigWidget::slotMacRadio( bool on ) {