summaryrefslogtreecommitdiff
path: root/core/apps
authorllornkcor <llornkcor>2003-02-28 17:44:25 (UTC)
committer llornkcor <llornkcor>2003-02-28 17:44:25 (UTC)
commit92c322fc6500de8c33409e0cecb25bf655bee8bc (patch) (side-by-side diff)
tree1c032dcc5ed8d61fb77e7e006adfa7414414c7e4 /core/apps
parent592904b2664c6fa3dbb4590b80a8552475995366 (diff)
downloadopie-92c322fc6500de8c33409e0cecb25bf655bee8bc.zip
opie-92c322fc6500de8c33409e0cecb25bf655bee8bc.tar.gz
opie-92c322fc6500de8c33409e0cecb25bf655bee8bc.tar.bz2
allow open file to remember last directory
Diffstat (limited to 'core/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/textedit.cpp10
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
@@ -571,6 +571,9 @@ void TextEdit::fileNew() {
}
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;
@@ -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();
}