author | harlekin <harlekin> | 2002-08-21 00:20:22 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-21 00:20:22 (UTC) |
commit | c198ae0217f761418f7170d08a94da3864e47583 (patch) (side-by-side diff) | |
tree | 096790ff5389ea30f61912f72338e5642edaa667 | |
parent | 491f95a2c6a5676f08520e494e125ba8b20e0eae (diff) | |
download | opie-c198ae0217f761418f7170d08a94da3864e47583.zip opie-c198ae0217f761418f7170d08a94da3864e47583.tar.gz opie-c198ae0217f761418f7170d08a94da3864e47583.tar.bz2 |
fixes
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 19 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 2 |
3 files changed, 17 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index c187f52..b2143a0 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -97,28 +97,29 @@ Lib::Lib(XineVideoWidget* widget) { } null_display_handler( m_videoOutput, xine_display_frame, this ); m_xine = xine_init( m_videoOutput, m_audioOutput, m_config ); // install the event handler xine_register_event_listener( m_xine, xine_event_handler, this ); } Lib::~Lib() { - delete m_config; + free( m_config ); xine_remove_event_listener( m_xine, xine_event_handler ); xine_exit( m_xine ); - delete m_videoOutput; + /* FIXME either free or delete but valgrind bitches against both */ + //free( m_videoOutput ); //delete m_audioOutput; } void Lib::resize ( const QSize &s ) { if ( s. width ( ) && s. height ( )) { ::null_set_gui_width( m_videoOutput, s. width() ); ::null_set_gui_height(m_videoOutput, s. height() ); } } 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 @@ -1,20 +1,21 @@ #define QTOPIA_INTERNAL_FSLP #include <qpe/qpemenubar.h> #include <qpe/qpetoolbar.h> #include <qpe/fileselector.h> #include <qpe/qpeapplication.h> #include <qpe/lnkproperties.h> #include <qpe/storage.h> +#include <qpe/mimetype.h> #include <qpe/applnk.h> #include <qpopupmenu.h> #include <qpe/config.h> #include <qpe/global.h> #include <qpe/resource.h> #include <qaction.h> #include <qcursor.h> #include <qimage.h> #include <qfile.h> #include <qdir.h> #include <qlayout.h> @@ -298,28 +299,32 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) setCentralWidget( vbox5 ); readConfig( cfg ); QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); loadList(DocLnk( currentPlaylist)); setCaption(tr("OpiePlayer: ")+ currentPlaylist ); initializeStates(); } PlayListWidget::~PlayListWidget() { - if ( d->current ) { - delete d->current; - } - delete d; +/* fixing symptoms and not sources is entirely stupid - zecke */ +// Config cfg( "OpiePlayer" ); +// writeConfig( cfg ); + + if ( d->current ) { + delete d->current; + } + delete d; } void PlayListWidget::initializeStates() { d->tbPlay->setOn( mediaPlayerState->playing() ); d->tbLoop->setOn( mediaPlayerState->looping() ); d->tbShuffle->setOn( mediaPlayerState->shuffled() ); setPlaylist( true); } @@ -943,29 +948,31 @@ void PlayListWidget::openFile() { InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->text(); qDebug("Selected filename is "+filename); if(filename.right(3) == "m3u") { readm3u( filename ); } else if(filename.right(3) == "pls") { readPls( filename ); } else { + /* FIXME ....... AUDIO/X-MPEGURL is bad*/ DocLnk lnk; lnk.setName(filename); //sets file name lnk.setFile(filename); //sets File property - lnk.setType("audio/x-mpegurl"); + //qWarning( "Mimetype: " + MimeType( QFile::encodeName(filename) ).id() ); + lnk.setType( MimeType( QFile::encodeName(filename) ).id() ); lnk.setExec("opieplayer"); lnk.setIcon("opieplayer2/MPEGPlayer"); if(!lnk.writeLink()) { qDebug("Writing doclink did not work"); } d->selectedFiles->addToSelection( lnk); } } if(fileDlg) { delete fileDlg; } @@ -1227,21 +1234,21 @@ void PlayListWidget::populateSkinsMenu() { if( skinName != "." && skinName != ".." && skinName !="CVS") item = skinsMenu->insertItem( fi->fileName()); if( skinName == "default") defaultSkinIndex = item; if( skinName == skin) skinsMenu->setItemChecked( item, TRUE); ++it; } } void PlayListWidget::skinsMenuActivated(int item) { - for(int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i--) { + for(uint i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i--) { skinsMenu->setItemChecked( i, FALSE); } skinsMenu->setItemChecked( item, TRUE); Config cfg( "OpiePlayer" ); cfg.setGroup("Options"); cfg.writeEntry("Skin", skinsMenu->text( item)); } diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 53837c7..ffda2e4 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -370,25 +370,25 @@ void VideoWidget::showEvent( QShowEvent* ) { void VideoWidget::backToNormal() { mediaPlayerState->setFullscreen( FALSE ); makeVisible(); } void VideoWidget::makeVisible() { if ( mediaPlayerState->fullscreen() ) { setBackgroundMode( QWidget::NoBackground ); showFullScreen(); resize( qApp->desktop()->size() ); slider->hide(); videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); - + qApp->processEvents(); } else { showNormal(); showMaximized(); setBackgroundPixmap( *pixBg ); if ( mediaPlayerState->streaming() ) { slider->hide(); disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); } else { slider->show(); connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |