summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector/ofileselector.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp15
1 files changed, 9 insertions, 6 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
@@ -243,15 +243,12 @@ OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap,
243 const QString& path, const QString& date, 243 const QString& path, const QString& date,
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 );
249 setText(1, path ); 249 setText(1, path );
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
257OFileSelectorItem::~OFileSelectorItem() 254OFileSelectorItem::~OFileSelectorItem()
@@ -281,6 +278,11 @@ QString OFileSelectorItem::path()const
281QString OFileSelectorItem::key( int id, bool )const 278QString 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
286 if( m_isDir ) 288 if( m_isDir )
@@ -294,8 +296,9 @@ QString OFileSelectorItem::key( int id, bool )const
294 ke.append( text(1) ); 296 ke.append( text(1) );
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
301} 304}