-rw-r--r-- | core/apps/textedit/textedit.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index ce868d6..2f62789 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp @@ -566,28 +566,34 @@ void TextEdit::setSearchBar(bool b) { void TextEdit::fileNew() { // if( !bFromDocView ) { // saveAs(); // } newFile(DocLnk()); } void TextEdit::fileOpen() { + Config cfg("TextEdit"); + cfg. setGroup ( "View" ); + QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir()); QMap<QString, QStringList> map; map.insert(tr("All"), QStringList() ); QStringList text; text << "text/*"; map.insert(tr("Text"), text ); text << "*"; map.insert(tr("All"), text ); QString str = OFileDialog::getOpenFileName( 2, - QPEApplication::documentDir(), + dir , QString::null, map); if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) - openFile( str ); + { + cfg.writeEntry("LastOpenDirectory", QFileInfo(str).dirPath(false)); + openFile( str ); + } else updateCaption(); } void TextEdit::doSearchBar() { if(!useSearchBar) searchBar->hide(); else |