author | llornkcor <llornkcor> | 2002-11-10 16:52:56 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 16:52:56 (UTC) |
commit | 81e63be3c1e21da2a2f97df1fc38417e7ca814e1 (patch) (side-by-side diff) | |
tree | 66b526df2913150cc67d0d2d8e4283c791ae891f /noncore/multimedia/opieplayer2/inputDialog.cpp | |
parent | 5a8660a4089fa2160da47e2a4d63baea431b48b1 (diff) | |
download | opie-81e63be3c1e21da2a2f97df1fc38417e7ca814e1.zip opie-81e63be3c1e21da2a2f97df1fc38417e7ca814e1.tar.gz opie-81e63be3c1e21da2a2f97df1fc38417e7ca814e1.tar.bz2 |
fix file add slowdown, and make fileselector remember last directory
Diffstat (limited to 'noncore/multimedia/opieplayer2/inputDialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/inputDialog.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp index 62240b2..2c4be1b 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.cpp +++ b/noncore/multimedia/opieplayer2/inputDialog.cpp @@ -1,9 +1,11 @@ #include "inputDialog.h" #include <qpe/resource.h> - +#include <qpe/qpeapplication.h> +#include <qpe/config.h> #include <opie/ofiledialog.h> +#include <qfileinfo.h> #include <qlineedit.h> #include <qlayout.h> #include <qvariant.h> @@ -40,7 +42,8 @@ InputDialog::~InputDialog() { } void InputDialog::browse() { - + Config cfg( "OpiePlayer" ); + cfg.setGroup("Dialog"); MimeTypes types; QStringList audio, video, all; audio << "audio/*"; @@ -56,7 +59,11 @@ void InputDialog::browse() { types.insert("Audio", audio ); types.insert("Video", video ); - QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); + QString str = OFileDialog::getOpenFileName( 1, + cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", + types, 0 ); + if(str.left(2) == "//") str=str.right(str.length()-1); LineEdit1->setText(str); + cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); } |