author | llornkcor <llornkcor> | 2003-02-28 17:44:25 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-02-28 17:44:25 (UTC) |
commit | 92c322fc6500de8c33409e0cecb25bf655bee8bc (patch) (unidiff) | |
tree | 1c032dcc5ed8d61fb77e7e006adfa7414414c7e4 | |
parent | 592904b2664c6fa3dbb4590b80a8552475995366 (diff) | |
download | opie-92c322fc6500de8c33409e0cecb25bf655bee8bc.zip opie-92c322fc6500de8c33409e0cecb25bf655bee8bc.tar.gz opie-92c322fc6500de8c33409e0cecb25bf655bee8bc.tar.bz2 |
allow open file to remember last directory
-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 | |||
@@ -570,20 +570,26 @@ void TextEdit::fileNew() { | |||
570 | newFile(DocLnk()); | 570 | newFile(DocLnk()); |
571 | } | 571 | } |
572 | 572 | ||
573 | void TextEdit::fileOpen() { | 573 | void TextEdit::fileOpen() { |
574 | Config cfg("TextEdit"); | ||
575 | cfg. setGroup ( "View" ); | ||
576 | QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir()); | ||
574 | QMap<QString, QStringList> map; | 577 | QMap<QString, QStringList> map; |
575 | map.insert(tr("All"), QStringList() ); | 578 | map.insert(tr("All"), QStringList() ); |
576 | QStringList text; | 579 | QStringList text; |
577 | text << "text/*"; | 580 | text << "text/*"; |
578 | map.insert(tr("Text"), text ); | 581 | map.insert(tr("Text"), text ); |
579 | text << "*"; | 582 | text << "*"; |
580 | map.insert(tr("All"), text ); | 583 | map.insert(tr("All"), text ); |
581 | QString str = OFileDialog::getOpenFileName( 2, | 584 | QString str = OFileDialog::getOpenFileName( 2, |
582 | QPEApplication::documentDir(), | 585 | dir , |
583 | QString::null, map); | 586 | QString::null, map); |
584 | if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) | 587 | if( !str.isEmpty() && QFile(str).exists() && !QFileInfo(str).isDir() ) |
585 | openFile( str ); | 588 | { |
589 | cfg.writeEntry("LastOpenDirectory", QFileInfo(str).dirPath(false)); | ||
590 | openFile( str ); | ||
591 | } | ||
586 | else | 592 | else |
587 | updateCaption(); | 593 | updateCaption(); |
588 | } | 594 | } |
589 | 595 | ||