summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/serialconfigwidget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/serialconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/serialconfigwidget.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/noncore/apps/opie-console/serialconfigwidget.cpp b/noncore/apps/opie-console/serialconfigwidget.cpp
index c4c9c99..4efb286 100644
--- a/noncore/apps/opie-console/serialconfigwidget.cpp
+++ b/noncore/apps/opie-console/serialconfigwidget.cpp
@@ -1,28 +1,15 @@
1#include <qlabel.h>
2#include <qlayout.h>
3#include <qcombobox.h>
4
5#include "iolayerbase.h" 1#include "iolayerbase.h"
6#include "serialconfigwidget.h" 2#include "serialconfigwidget.h"
3#include "comboboxhelper.h"
7 4
8namespace { 5#include <qlabel.h>
9 void setCurrent( const QString& str, QComboBox* bo ) { 6#include <qlayout.h>
10 uint b = bo->count(); 7#include <qcombobox.h>
11 for (int i = 0; i < bo->count(); i++ ) {
12 if ( bo->text(i) == str ) {
13 bo->setCurrentItem( i );
14 return;
15 }
16 }
17 bo->insertItem( str );
18 bo->setCurrentItem( b );
19 }
20 8
21 9
22}
23 10
24SerialConfigWidget::SerialConfigWidget( const QString& name, 11SerialConfigWidget::SerialConfigWidget( const QString& name,
25 QWidget* parent, 12 QWidget* parent,
26 const char* na ) 13 const char* na )
27 : ProfileDialogConnectionWidget( name, parent, na ) { 14 : ProfileDialogConnectionWidget( name, parent, na ) {
28 15
@@ -113,13 +100,13 @@ void SerialConfigWidget::load( const Profile& prof ) {
113 m_base->setStop( IOLayerBase::Stop_OnePointFive ); 100 m_base->setStop( IOLayerBase::Stop_OnePointFive );
114 } else { 101 } else {
115 m_base->setStop( IOLayerBase::Stop_One ); 102 m_base->setStop( IOLayerBase::Stop_One );
116 } 103 }
117 104
118 if ( prof.readEntry("Device").isEmpty() ) return; 105 if ( prof.readEntry("Device").isEmpty() ) return;
119 setCurrent( prof.readEntry("Device"), m_deviceCmb ); 106 ComboboxHelper::setCurrent( prof.readEntry("Device"), m_deviceCmb );
120 107
121} 108}
122/* 109/*
123 * save speed, 110 * save speed,
124 * flow, 111 * flow,
125 * parity 112 * parity