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,23 +1,10 @@ | |||
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 | ||
@@ -118,3 +105,3 @@ void SerialConfigWidget::load( const Profile& prof ) { | |||
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 | ||