author | harlekin <harlekin> | 2002-08-21 00:20:22 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-21 00:20:22 (UTC) |
commit | c198ae0217f761418f7170d08a94da3864e47583 (patch) (unidiff) | |
tree | 096790ff5389ea30f61912f72338e5642edaa667 /noncore/multimedia/opieplayer2/playlistwidget.cpp | |
parent | 491f95a2c6a5676f08520e494e125ba8b20e0eae (diff) | |
download | opie-c198ae0217f761418f7170d08a94da3864e47583.zip opie-c198ae0217f761418f7170d08a94da3864e47583.tar.gz opie-c198ae0217f761418f7170d08a94da3864e47583.tar.bz2 |
fixes
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 75e2979..098322b 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -3,12 +3,13 @@ | |||
3 | #include <qpe/qpemenubar.h> | 3 | #include <qpe/qpemenubar.h> |
4 | #include <qpe/qpetoolbar.h> | 4 | #include <qpe/qpetoolbar.h> |
5 | #include <qpe/fileselector.h> | 5 | #include <qpe/fileselector.h> |
6 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | #include <qpe/lnkproperties.h> | 7 | #include <qpe/lnkproperties.h> |
8 | #include <qpe/storage.h> | 8 | #include <qpe/storage.h> |
9 | #include <qpe/mimetype.h> | ||
9 | 10 | ||
10 | #include <qpe/applnk.h> | 11 | #include <qpe/applnk.h> |
11 | #include <qpopupmenu.h> | 12 | #include <qpopupmenu.h> |
12 | #include <qpe/config.h> | 13 | #include <qpe/config.h> |
13 | #include <qpe/global.h> | 14 | #include <qpe/global.h> |
14 | #include <qpe/resource.h> | 15 | #include <qpe/resource.h> |
@@ -304,16 +305,20 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
304 | 305 | ||
305 | initializeStates(); | 306 | initializeStates(); |
306 | } | 307 | } |
307 | 308 | ||
308 | 309 | ||
309 | PlayListWidget::~PlayListWidget() { | 310 | PlayListWidget::~PlayListWidget() { |
310 | if ( d->current ) { | 311 | /* fixing symptoms and not sources is entirely stupid - zecke */ |
311 | delete d->current; | 312 | // Config cfg( "OpiePlayer" ); |
312 | } | 313 | // writeConfig( cfg ); |
313 | delete d; | 314 | |
315 | if ( d->current ) { | ||
316 | delete d->current; | ||
317 | } | ||
318 | delete d; | ||
314 | } | 319 | } |
315 | 320 | ||
316 | 321 | ||
317 | void PlayListWidget::initializeStates() { | 322 | void PlayListWidget::initializeStates() { |
318 | 323 | ||
319 | d->tbPlay->setOn( mediaPlayerState->playing() ); | 324 | d->tbPlay->setOn( mediaPlayerState->playing() ); |
@@ -949,17 +954,19 @@ void PlayListWidget::openFile() { | |||
949 | qDebug("Selected filename is "+filename); | 954 | qDebug("Selected filename is "+filename); |
950 | if(filename.right(3) == "m3u") { | 955 | if(filename.right(3) == "m3u") { |
951 | readm3u( filename ); | 956 | readm3u( filename ); |
952 | } else if(filename.right(3) == "pls") { | 957 | } else if(filename.right(3) == "pls") { |
953 | readPls( filename ); | 958 | readPls( filename ); |
954 | } else { | 959 | } else { |
960 | /* FIXME ....... AUDIO/X-MPEGURL is bad*/ | ||
955 | DocLnk lnk; | 961 | DocLnk lnk; |
956 | 962 | ||
957 | lnk.setName(filename); //sets file name | 963 | lnk.setName(filename); //sets file name |
958 | lnk.setFile(filename); //sets File property | 964 | lnk.setFile(filename); //sets File property |
959 | lnk.setType("audio/x-mpegurl"); | 965 | //qWarning( "Mimetype: " + MimeType( QFile::encodeName(filename) ).id() ); |
966 | lnk.setType( MimeType( QFile::encodeName(filename) ).id() ); | ||
960 | lnk.setExec("opieplayer"); | 967 | lnk.setExec("opieplayer"); |
961 | lnk.setIcon("opieplayer2/MPEGPlayer"); | 968 | lnk.setIcon("opieplayer2/MPEGPlayer"); |
962 | 969 | ||
963 | if(!lnk.writeLink()) { | 970 | if(!lnk.writeLink()) { |
964 | qDebug("Writing doclink did not work"); | 971 | qDebug("Writing doclink did not work"); |
965 | } | 972 | } |
@@ -1233,13 +1240,13 @@ void PlayListWidget::populateSkinsMenu() { | |||
1233 | 1240 | ||
1234 | ++it; | 1241 | ++it; |
1235 | } | 1242 | } |
1236 | } | 1243 | } |
1237 | 1244 | ||
1238 | void PlayListWidget::skinsMenuActivated(int item) { | 1245 | void PlayListWidget::skinsMenuActivated(int item) { |
1239 | for(int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i--) { | 1246 | for(uint i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i--) { |
1240 | skinsMenu->setItemChecked( i, FALSE); | 1247 | skinsMenu->setItemChecked( i, FALSE); |
1241 | } | 1248 | } |
1242 | skinsMenu->setItemChecked( item, TRUE); | 1249 | skinsMenu->setItemChecked( item, TRUE); |
1243 | 1250 | ||
1244 | Config cfg( "OpiePlayer" ); | 1251 | Config cfg( "OpiePlayer" ); |
1245 | cfg.setGroup("Options"); | 1252 | cfg.setGroup("Options"); |