-rw-r--r-- | noncore/styles/theme/themeset.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/styles/theme/themeset.cpp b/noncore/styles/theme/themeset.cpp index 4a4efcb..d4005bc 100644 --- a/noncore/styles/theme/themeset.cpp +++ b/noncore/styles/theme/themeset.cpp | |||
@@ -46,13 +46,13 @@ public: | |||
46 | } | 46 | } |
47 | }; | 47 | }; |
48 | 48 | ||
49 | class MyItem : public QListViewItem | 49 | class MyItem : public QListViewItem |
50 | { | 50 | { |
51 | public: | 51 | public: |
52 | MyItem ( QListView *lv, const QString &name, const QString &comm, const QString &theme ) : QListViewItem ( lv, name, comm ) | 52 | MyItem ( QListView *lv, QListViewItem *after, const QString &name, const QString &comm, const QString &theme ) : QListViewItem ( lv, after, name, comm ) |
53 | { | 53 | { |
54 | m_theme = theme; | 54 | m_theme = theme; |
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | ||
58 | QString m_theme; | 58 | QString m_theme; |
@@ -77,15 +77,16 @@ ThemeSettings::ThemeSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
77 | 77 | ||
78 | m_list = new QListView ( this ); | 78 | m_list = new QListView ( this ); |
79 | m_list-> addColumn ( tr( "Name" )); | 79 | m_list-> addColumn ( tr( "Name" )); |
80 | m_list-> addColumn ( tr( "Description" )); | 80 | m_list-> addColumn ( tr( "Description" )); |
81 | m_list-> setSelectionMode ( QListView::Single ); | 81 | m_list-> setSelectionMode ( QListView::Single ); |
82 | m_list-> setAllColumnsShowFocus ( true ); | 82 | m_list-> setAllColumnsShowFocus ( true ); |
83 | m_list-> setSorting ( -1 ); | ||
83 | vbox-> addWidget ( m_list, 10 ); | 84 | vbox-> addWidget ( m_list, 10 ); |
84 | 85 | ||
85 | QListViewItem *item = new MyItem ( m_list, tr( "[No theme]" ), "", "" ); | 86 | QListViewItem *item = new MyItem ( m_list, 0, tr( "[No theme]" ), "", "" ); |
86 | m_list-> setSelected ( item, true ); | 87 | m_list-> setSelected ( item, true ); |
87 | 88 | ||
88 | QString path = QPEApplication::qpeDir() + "/plugins/styles/themes"; | 89 | QString path = QPEApplication::qpeDir() + "/plugins/styles/themes"; |
89 | QStringList list = QDir ( path, "*.themerc" ). entryList ( ); | 90 | QStringList list = QDir ( path, "*.themerc" ). entryList ( ); |
90 | 91 | ||
91 | for ( QStringList::Iterator it = list. begin(); it != list. end ( ); ++it ) { | 92 | for ( QStringList::Iterator it = list. begin(); it != list. end ( ); ++it ) { |
@@ -97,13 +98,13 @@ ThemeSettings::ThemeSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
97 | QString name = cfg. readEntry ( "Name" ); | 98 | QString name = cfg. readEntry ( "Name" ); |
98 | QString comm = cfg. readEntry ( "Comment" ); | 99 | QString comm = cfg. readEntry ( "Comment" ); |
99 | 100 | ||
100 | if ( !name. isEmpty ( )) { | 101 | if ( !name. isEmpty ( )) { |
101 | QString fname = (*it). left ((*it). length ( ) - 8 ); | 102 | QString fname = (*it). left ((*it). length ( ) - 8 ); |
102 | 103 | ||
103 | item = new MyItem ( m_list, name, comm, fname ); | 104 | item = new MyItem ( m_list, item, name, comm, fname ); |
104 | if ( active == fname ) { | 105 | if ( active == fname ) { |
105 | m_list-> setSelected ( item, true ); | 106 | m_list-> setSelected ( item, true ); |
106 | } | 107 | } |
107 | } | 108 | } |
108 | } | 109 | } |
109 | } | 110 | } |