-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 | |||
69 | 69 | ||
70 | ListView = new QListView( this, "ListView" ); | 70 | ListView = new QListView( this, "ListView" ); |
71 | ListView->setMinimumSize( QSize( 100, 25 ) ); | 71 | ListView->setMinimumSize( QSize( 100, 25 ) ); |
72 | ListView->addColumn( tr( "Name" ) ); | 72 | ListView->addColumn( tr( "Name" ) ); |
73 | ListView->setColumnWidth(0,140); | 73 | ListView->setColumnWidth(0,120); |
74 | ListView->setSorting( 2, FALSE); | 74 | ListView->setSorting( 2, FALSE); |
75 | ListView->addColumn( tr( "Size" ) ); | 75 | ListView->addColumn( tr( "Size" ) ); |
76 | ListView->setColumnWidth(1,59); | 76 | ListView->setColumnWidth(1,-1); |
77 | ListView->addColumn( "Date",-1); | ||
77 | // ListView->addColumn( tr( "" ) ); | 78 | // ListView->addColumn( tr( "" ) ); |
@@ -79,5 +80,5 @@ fileBrowser::fileBrowser( QWidget* parent, const char* name, bool modal, WFlags | |||
79 | ListView->setColumnAlignment(1,QListView::AlignRight); | 80 | ListView->setColumnAlignment(1,QListView::AlignRight); |
80 | // ListView->setMultiSelection(true); | 81 | ListView->setColumnAlignment(2,QListView::AlignRight); |
81 | // ListView->setSelectionMode(QListView::Extended); | ||
82 | ListView->setAllColumnsShowFocus( TRUE ); | 82 | ListView->setAllColumnsShowFocus( TRUE ); |
83 | |||
83 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 84 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
@@ -120,2 +121,3 @@ void fileBrowser::populateList() | |||
120 | ListView->clear(); | 121 | ListView->clear(); |
122 | bool isDir=FALSE; | ||
121 | //qDebug(currentDir.canonicalPath()); | 123 | //qDebug(currentDir.canonicalPath()); |
@@ -126,3 +128,3 @@ void fileBrowser::populateList() | |||
126 | // currentDir.setNameFilter("*.txt;*.etx"); | 128 | // currentDir.setNameFilter("*.txt;*.etx"); |
127 | QString fileL, fileS; | 129 | QString fileL, fileS, fileDate; |
128 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); | 130 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); |
@@ -138,3 +140,3 @@ void fileBrowser::populateList() | |||
138 | fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); | 140 | fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); |
139 | 141 | fileDate = sym.lastModified().toString(); | |
140 | } else { | 142 | } else { |
@@ -143,4 +145,6 @@ void fileBrowser::populateList() | |||
143 | fileL.sprintf( "%s",fi->fileName().data() ); | 145 | fileL.sprintf( "%s",fi->fileName().data() ); |
146 | fileDate= fi->lastModified().toString(); | ||
144 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { | 147 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { |
145 | fileL+="/"; | 148 | fileL+="/"; |
149 | isDir=TRUE; | ||
146 | // qDebug( fileL); | 150 | // qDebug( fileL); |
@@ -148,6 +152,14 @@ void fileBrowser::populateList() | |||
148 | } | 152 | } |
149 | item= new QListViewItem( ListView,fileL,fileS ); | 153 | if(fileL !="./") { |
154 | item= new QListViewItem( ListView,fileL,fileS , fileDate); | ||
155 | if(isDir || fileL.find("/",0,TRUE) != -1) | ||
156 | item->setPixmap( 0, Resource::loadPixmap( "folder" )); | ||
157 | else | ||
158 | item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); | ||
159 | } | ||
160 | isDir=FALSE; | ||
150 | ++it; | 161 | ++it; |
151 | } | 162 | } |
152 | ListView->setSorting( 2, FALSE); | 163 | // ListView->setSorting( 2, FALSE); |
164 | ListView->setSorting( 3, FALSE); | ||
153 | dirLabel->setText(currentDir.canonicalPath()); | 165 | 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 ) | |||
358 | 358 | ||
359 | |||
360 | a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); | 359 | a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 ); |
@@ -421,3 +420,3 @@ TextEdit::~TextEdit() | |||
421 | cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); | 420 | cfg.writeEntry("Wrap",editor->wordWrap() == QMultiLineEdit::WidgetWidth); |
422 | cfg.writeEntry( "FileView", viewSelection ); | 421 | cfg.writeEntry( "FileView", viewSelection ); |
423 | } | 422 | } |
@@ -519,2 +518,6 @@ void TextEdit::fileOpen() | |||
519 | setCaption(caption().right(caption().length()-1)); | 518 | setCaption(caption().right(caption().length()-1)); |
519 | Config cfg("TextEdit"); | ||
520 | cfg.setGroup("View"); | ||
521 | if(cfg.readEntry("SearchBar","Closed") != "Opened") | ||
522 | searchBar->hide(); | ||
520 | } | 523 | } |
@@ -573,2 +576,6 @@ void TextEdit::editFind() | |||
573 | searchEdit->setFocus(); | 576 | searchEdit->setFocus(); |
577 | Config cfg("TextEdit"); | ||
578 | cfg.setGroup("View"); | ||
579 | cfg.writeEntry("SearchBar","Opened"); | ||
580 | |||
574 | } | 581 | } |
@@ -585,2 +592,6 @@ void TextEdit::findClose() | |||
585 | searchBar->hide(); | 592 | searchBar->hide(); |
593 | Config cfg("TextEdit"); | ||
594 | cfg.setGroup("View"); | ||
595 | cfg.writeEntry("SearchBar","Closed"); | ||
596 | cfg.write(); | ||
586 | } | 597 | } |