author | zecke <zecke> | 2004-11-14 17:40:57 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-14 17:40:57 (UTC) |
commit | 61dc3dd61685a1bfc6aba33ad81f8348bb992a11 (patch) (unidiff) | |
tree | 74994977ad38557c91a2f16975a9d8798c3365ec | |
parent | 9507723db1df320547a0cb660b9b923d41438fdf (diff) | |
download | opie-61dc3dd61685a1bfc6aba33ad81f8348bb992a11.zip opie-61dc3dd61685a1bfc6aba33ad81f8348bb992a11.tar.gz opie-61dc3dd61685a1bfc6aba33ad81f8348bb992a11.tar.bz2 |
-Fix bug in OFileSelector ListView spotted by hrw
to sort the 'size' column according their 'Number'-Halbordnung
and not by string comparsion
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 15 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector_p.h | 4 |
2 files changed, 11 insertions, 8 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 01a51a2..718f743 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -244,5 +244,5 @@ OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap, | |||
244 | const QString& size, const QString& dir, | 244 | const QString& size, const QString& dir, |
245 | bool isLocked, bool isDir ) | 245 | bool isLocked, bool isDir ) |
246 | : QListViewItem( view ) | 246 | : QListViewItem( view ), m_dir(dir), m_isDir(isDir), m_locked(isLocked) |
247 | { | 247 | { |
248 | setPixmap(0, pixmap ); | 248 | setPixmap(0, pixmap ); |
@@ -250,7 +250,4 @@ OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap, | |||
250 | setText(2, size ); | 250 | setText(2, size ); |
251 | setText(3, date ); | 251 | setText(3, date ); |
252 | m_isDir = isDir; | ||
253 | m_dir = dir; | ||
254 | m_locked = isLocked; | ||
255 | } | 252 | } |
256 | 253 | ||
@@ -282,4 +279,9 @@ QString OFileSelectorItem::key( int id, bool )const | |||
282 | { | 279 | { |
283 | QString ke; | 280 | QString ke; |
281 | |||
282 | /* | ||
283 | * id = 0 ||id == 1 : Sort By Name but Directories at Top | ||
284 | * id = 2 : Sort By Size: Prepend '0' to the key | ||
285 | */ | ||
284 | if( id == 0 || id == 1 ) | 286 | if( id == 0 || id == 1 ) |
285 | { // name | 287 | { // name |
@@ -295,6 +297,7 @@ QString OFileSelectorItem::key( int id, bool )const | |||
295 | } | 297 | } |
296 | return ke; | 298 | return ke; |
297 | } | 299 | }else if(id == 2) { |
298 | else | 300 | return text(2).rightJustify(20, '0'); |
301 | }else | ||
299 | return text( id ); | 302 | return text( id ); |
300 | 303 | ||
diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h index 790d2bd..15db916 100644 --- a/libopie2/opieui/fileselector/ofileselector_p.h +++ b/libopie2/opieui/fileselector/ofileselector_p.h | |||
@@ -138,7 +138,7 @@ public: | |||
138 | 138 | ||
139 | private: | 139 | private: |
140 | bool m_locked : 1; | ||
141 | bool m_isDir : 1; | ||
142 | QString m_dir; | 140 | QString m_dir; |
141 | bool m_isDir : 1; | ||
142 | bool m_locked : 1; | ||
143 | }; | 143 | }; |
144 | 144 | ||