-rw-r--r-- | core/apps/textedit/fileBrowser.cpp | 30 | ||||
-rw-r--r-- | core/apps/textedit/textedit.cpp | 15 |
2 files changed, 34 insertions, 11 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 @@ -69,9 +69,10 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags - ListView = new QListView( this, "ListView" ); + ListView = new QListView( this, "ListView" ); 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( "" ) ); @@ -79,5 +80,5 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags 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 *)) ); @@ -120,2 +121,3 @@ void fileBrowser::populateList() ListView->clear(); + bool isDir=FALSE; //qDebug(currentDir.canonicalPath()); @@ -126,3 +128,3 @@ void fileBrowser::populateList() // currentDir.setNameFilter("*.txt;*.etx"); - QString fileL, fileS; + QString fileL, fileS, fileDate; const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); @@ -138,3 +140,3 @@ void fileBrowser::populateList() fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); - + fileDate = sym.lastModified().toString(); } else { @@ -143,4 +145,6 @@ void fileBrowser::populateList() fileL.sprintf( "%s",fi->fileName().data() ); + fileDate= fi->lastModified().toString(); if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { fileL+="/"; + isDir=TRUE; // qDebug( fileL); @@ -148,6 +152,14 @@ void fileBrowser::populateList() } - 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 @@ -358,3 +358,2 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f ) - a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); @@ -421,3 +420,3 @@ TextEdit::~TextEdit() cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); - cfg.writeEntry( "FileView", viewSelection ); + cfg.writeEntry( "FileView", viewSelection ); } @@ -519,2 +518,6 @@ void TextEdit::fileOpen() setCaption(caption().right(caption().length()-1)); + Config cfg("TextEdit"); + cfg.setGroup("View"); + if(cfg.readEntry("SearchBar","Closed") != "Opened") + searchBar->hide(); } @@ -573,2 +576,6 @@ void TextEdit::editFind() searchEdit->setFocus(); + Config cfg("TextEdit"); + cfg.setGroup("View"); + cfg.writeEntry("SearchBar","Opened"); + } @@ -585,2 +592,6 @@ void TextEdit::findClose() searchBar->hide(); + Config cfg("TextEdit"); + cfg.setGroup("View"); + cfg.writeEntry("SearchBar","Closed"); + cfg.write(); } |