summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/inputDialog.cpp15
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp30
2 files changed, 29 insertions, 16 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,8 +42,9 @@ InputDialog::~InputDialog() {
}
void InputDialog::browse() {
-
- MimeTypes types;
+ Config cfg( "OpiePlayer" );
+ cfg.setGroup("Dialog");
+ MimeTypes types;
QStringList audio, video, all;
audio << "audio/*";
audio << "playlist/plain";
@@ -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());
}
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index b15f95e..0825eed 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -157,9 +157,9 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
initializeStates();
cfg.setGroup("PlayList");
- QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "" );
+ QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
loadList(DocLnk( currentPlaylist ) );
- setCaption( tr( "OpiePlayer: " ) + currentPlaylist );
+
}
@@ -740,7 +740,9 @@ void PlayListWidget::openFile() {
// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile);
lnk.setName( filename ); //sets name
lnk.setFile( filename ); //sets file name
- lnk.setIcon("opieplayer2/musicfile");
+
+// lnk.setIcon("opieplayer2/musicfile");
+
d->selectedFiles->addToSelection( lnk );
writeCurrentM3u();
}
@@ -750,7 +752,9 @@ void PlayListWidget::openFile() {
} else if( filename.right(3) == "pls" ) {
readPls( filename );
} else {
- d->selectedFiles->addToSelection( DocLnk(filename) );
+ lnk.setName( QFileInfo(filename).baseName() ); //sets name
+ lnk.setFile( filename ); //sets file name
+ d->selectedFiles->addToSelection( lnk);
writeCurrentM3u();
}
}
@@ -788,11 +792,13 @@ void PlayListWidget::readm3u( const QString &filename ) {
if(s.left(1) != "/") {
// qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s);
lnk.setFile( QFileInfo(filename).dirPath()+"/"+s);
- lnk.setIcon("SoundPlayer");
+// lnk.setIcon(MimeType(s).pixmap() );
+// lnk.setIcon("SoundPlayer");
} else {
// qDebug("set link2 "+s);
lnk.setFile( s);
- lnk.setIcon("SoundPlayer");
+// lnk.setIcon(MimeType(s).pixmap() );
+// lnk.setIcon("SoundPlayer");
}
}
d->selectedFiles->addToSelection( lnk );
@@ -842,9 +848,9 @@ void PlayListWidget::readPls( const QString &filename ) {
if( s.at( s.length() - 4) == '.') {// if this is probably a file
lnk.setFile( s );
} else { //if its a url
- if( name.right( 1 ).find( '/' ) == -1) {
- s += "/";
- }
+// if( name.right( 1 ).find( '/' ) == -1) {
+// s += "/";
+// }
lnk.setFile( s );
}
lnk.setType( "audio/x-mpegurl" );
@@ -865,12 +871,12 @@ void PlayListWidget::writeCurrentM3u() {
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default");
- if( d->selectedFiles->first()) {
Om3u *m3uList;
m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate );
+ if( d->selectedFiles->first()) {
do {
- qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file());
+ qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file());
m3uList->add( d->selectedFiles->current()->file() );
}
while ( d->selectedFiles->next() );
@@ -919,7 +925,7 @@ void PlayListWidget::writem3u() {
DocLnk lnk;
lnk.setFile( filename);
- lnk.setIcon("opieplayer2/playlist2");
+// lnk.setIcon("opieplayer2/playlist2");
lnk.setName( name); //sets file name
// qDebug(filename);