-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 28 | ||||
-rw-r--r-- | core/apps/textedit/textedit.cpp | 13 |
2 files changed, 32 insertions, 9 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp index 92c15cb..8cb7c38 100644 --- a/core/apps/textedit/fileBrowser.cpp +++ b/core/apps/textedit/fileBrowser.cpp @@ -71,14 +71,15 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags ListView->setMinimumSize( QSize( 100, 25 ) ); ListView->addColumn( tr( "Name" ) ); - ListView->setColumnWidth(0,140); + ListView->setColumnWidth(0,120); ListView->setSorting( 2, FALSE); ListView->addColumn( tr( "Size" ) ); - ListView->setColumnWidth(1,59); + ListView->setColumnWidth(1,-1); + ListView->addColumn( "Date",-1); // ListView->addColumn( tr( "" ) ); ListView->setColumnWidthMode(0,QListView::Manual); ListView->setColumnAlignment(1,QListView::AlignRight); -// ListView->setMultiSelection(true); -// ListView->setSelectionMode(QListView::Extended); + ListView->setColumnAlignment(2,QListView::AlignRight); ListView->setAllColumnsShowFocus( TRUE ); + connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); FileStack->addWidget( ListView, get_unique_id() ); @@ -119,4 +120,5 @@ void fileBrowser::populateList() { ListView->clear(); + bool isDir=FALSE; //qDebug(currentDir.canonicalPath()); currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); @@ -125,5 +127,5 @@ void fileBrowser::populateList() currentDir.setNameFilter(filterStr); // currentDir.setNameFilter("*.txt;*.etx"); - QString fileL, fileS; + QString fileL, fileS, fileDate; const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); QFileInfoListIterator it(*list); @@ -137,18 +139,28 @@ void fileBrowser::populateList() fileS.sprintf( "%10li", sym.size() ); fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); - + fileDate = sym.lastModified().toString(); } else { // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); fileS.sprintf( "%10li", fi->size() ); fileL.sprintf( "%s",fi->fileName().data() ); + fileDate= fi->lastModified().toString(); if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { fileL+="/"; + isDir=TRUE; // qDebug( fileL); } } - item= new QListViewItem( ListView,fileL,fileS ); + if(fileL !="./") { + item= new QListViewItem( ListView,fileL,fileS , fileDate); + if(isDir || fileL.find("/",0,TRUE) != -1) + item->setPixmap( 0, Resource::loadPixmap( "folder" )); + else + item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); + } + isDir=FALSE; ++it; } - ListView->setSorting( 2, FALSE); +// ListView->setSorting( 2, FALSE); + ListView->setSorting( 3, FALSE); dirLabel->setText(currentDir.canonicalPath()); } diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index 68ee1b4..d3f5fb4 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -357,5 +357,4 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) this, SLOT( search() ) ); - a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); @@ -518,4 +517,8 @@ void TextEdit::fileOpen() if(caption().left(1)=="*") setCaption(caption().right(caption().length()-1)); + Config cfg("TextEdit"); + cfg.setGroup("View"); + if(cfg.readEntry("SearchBar","Closed") != "Opened") + searchBar->hide(); } @@ -572,4 +575,8 @@ void TextEdit::editFind() searchVisible = TRUE; searchEdit->setFocus(); + Config cfg("TextEdit"); + cfg.setGroup("View"); + cfg.writeEntry("SearchBar","Opened"); + } @@ -584,4 +591,8 @@ void TextEdit::findClose() searchVisible = FALSE; searchBar->hide(); + Config cfg("TextEdit"); + cfg.setGroup("View"); + cfg.writeEntry("SearchBar","Closed"); + cfg.write(); } |