Diffstat (limited to 'noncore/multimedia/opieplayer2/inputDialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/inputDialog.cpp | 15 |
1 files changed, 11 insertions, 4 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,12 +1,14 @@ | |||
1 | #include "inputDialog.h" | 1 | #include "inputDialog.h" |
2 | 2 | ||
3 | #include <qpe/resource.h> | 3 | #include <qpe/resource.h> |
4 | 4 | #include <qpe/qpeapplication.h> | |
5 | #include <qpe/config.h> | ||
5 | #include <opie/ofiledialog.h> | 6 | #include <opie/ofiledialog.h> |
6 | 7 | ||
8 | #include <qfileinfo.h> | ||
7 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
8 | #include <qlayout.h> | 10 | #include <qlayout.h> |
9 | #include <qvariant.h> | 11 | #include <qvariant.h> |
10 | #include <qpushbutton.h> | 12 | #include <qpushbutton.h> |
11 | #include <qwhatsthis.h> | 13 | #include <qwhatsthis.h> |
12 | 14 | ||
@@ -37,14 +39,15 @@ QString InputDialog::text() const { | |||
37 | * Destroys the object and frees any allocated resources | 39 | * Destroys the object and frees any allocated resources |
38 | */ | 40 | */ |
39 | InputDialog::~InputDialog() { | 41 | InputDialog::~InputDialog() { |
40 | } | 42 | } |
41 | 43 | ||
42 | void InputDialog::browse() { | 44 | void InputDialog::browse() { |
43 | 45 | Config cfg( "OpiePlayer" ); | |
44 | MimeTypes types; | 46 | cfg.setGroup("Dialog"); |
47 | MimeTypes types; | ||
45 | QStringList audio, video, all; | 48 | QStringList audio, video, all; |
46 | audio << "audio/*"; | 49 | audio << "audio/*"; |
47 | audio << "playlist/plain"; | 50 | audio << "playlist/plain"; |
48 | audio << "audio/x-mpegurl"; | 51 | audio << "audio/x-mpegurl"; |
49 | 52 | ||
50 | video << "video/*"; | 53 | video << "video/*"; |
@@ -53,10 +56,14 @@ void InputDialog::browse() { | |||
53 | all += audio; | 56 | all += audio; |
54 | all += video; | 57 | all += video; |
55 | types.insert("All Media Files", all ); | 58 | types.insert("All Media Files", all ); |
56 | types.insert("Audio", audio ); | 59 | types.insert("Audio", audio ); |
57 | types.insert("Video", video ); | 60 | types.insert("Video", video ); |
58 | 61 | ||
59 | QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); | 62 | QString str = OFileDialog::getOpenFileName( 1, |
63 | cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"", | ||
64 | types, 0 ); | ||
65 | if(str.left(2) == "//") str=str.right(str.length()-1); | ||
60 | LineEdit1->setText(str); | 66 | LineEdit1->setText(str); |
67 | cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath()); | ||
61 | } | 68 | } |
62 | 69 | ||