From 92c322fc6500de8c33409e0cecb25bf655bee8bc Mon Sep 17 00:00:00 2001 From: llornkcor Date: Fri, 28 Feb 2003 17:44:25 +0000 Subject: allow open file to remember last directory --- (limited to 'core/apps') 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 @@ -571,6 +571,9 @@ void TextEdit::fileNew() { } void TextEdit::fileOpen() { + Config cfg("TextEdit"); + cfg. setGroup ( "View" ); + QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir()); QMap map; map.insert(tr("All"), QStringList() ); QStringList text; @@ -579,10 +582,13 @@ void TextEdit::fileOpen() { 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(); } -- cgit v0.9.0.2