author | sandman <sandman> | 2002-11-01 13:16:11 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-01 13:16:11 (UTC) |
commit | 6e4730b8485d3481d554dc8c079722ee1236f375 (patch) (unidiff) | |
tree | 087312aec3d7c89e8a70bccd094d706f09d73016 | |
parent | 287f8a39e757e87a840fbffce258ee03c6b62161 (diff) | |
download | opie-6e4730b8485d3481d554dc8c079722ee1236f375.zip opie-6e4730b8485d3481d554dc8c079722ee1236f375.tar.gz opie-6e4730b8485d3481d554dc8c079722ee1236f375.tar.bz2 |
No sorting required for theme list
-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 | |||
@@ -44,17 +44,17 @@ public: | |||
44 | QMap< QString, ConfigGroup>::ConstIterator it = groups. find ( gname ); | 44 | QMap< QString, ConfigGroup>::ConstIterator it = groups. find ( gname ); |
45 | return ( it != groups.end() ); | 45 | return ( it != groups.end() ); |
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; |
59 | }; | 59 | }; |
60 | 60 | ||
@@ -75,19 +75,20 @@ ThemeSettings::ThemeSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
75 | 75 | ||
76 | vbox-> addWidget ( new QLabel ( tr( "Select the theme to be used" ), this )); | 76 | vbox-> addWidget ( new QLabel ( tr( "Select the theme to be used" ), this )); |
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 ) { |
92 | MyConfig cfg ( path + "/" + *it, Config::File ); | 93 | MyConfig cfg ( path + "/" + *it, Config::File ); |
93 | 94 | ||
@@ -95,17 +96,17 @@ ThemeSettings::ThemeSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
95 | cfg. setGroup ( "Misc" ); | 96 | cfg. setGroup ( "Misc" ); |
96 | 97 | ||
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 | } |
110 | } | 111 | } |
111 | 112 | ||