Diffstat (limited to 'noncore/apps/opie-console/serialconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/serialconfigwidget.cpp | 23 |
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,26 +1,13 @@ | |||
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 | ||
8 | namespace { | 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 | ||
24 | SerialConfigWidget::SerialConfigWidget( const QString& name, | 11 | SerialConfigWidget::SerialConfigWidget( const QString& name, |
25 | QWidget* parent, | 12 | QWidget* parent, |
26 | const char* na ) | 13 | const char* na ) |
@@ -115,9 +102,9 @@ void SerialConfigWidget::load( const Profile& prof ) { | |||
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, |