diff --git a/customaction.cpp b/customaction.cpp index 569f27b72735004f5eeba72fdae9c444487b63a8..343809d43ff89415d428a4254c1deda5cf628773 100644 --- a/customaction.cpp +++ b/customaction.cpp @@ -68,7 +68,7 @@ void CustomAction::unplug(QWidget *parent) toolbar->removeItem(itemId(index)); removeContainer(index); - toolbar=NULL; + toolbar = 0; } } } @@ -81,8 +81,3 @@ KToolBar *CustomAction::getToolBar() { return(toolbar); } - -QWidget *CustomAction::createWidget(QWidget *parent) // virtual, should be reimplemented in subclasses -{ - return(0); -} diff --git a/customaction.h b/customaction.h index db71ddb775bd1a87d1e98fcf49c2dc99fd1a610d..eeb9b63bddb51def89a6de9549c291765a50a364 100644 --- a/customaction.h +++ b/customaction.h @@ -36,12 +36,12 @@ public: protected: KToolBar *getToolBar(); - virtual QWidget *createWidget(QWidget *parent); QWidget *customWidget; KToolBar *toolbar; private: + virtual QWidget *createWidget(QWidget *parent) = 0; signals: void pluggedIn(QWidget *parent); diff --git a/filelist.cpp b/filelist.cpp index 0569069a6112e15edaa3dc66146d7a9ffda99edd..8de8f06513981475d45a7305c39f16b07e88eb29 100644 --- a/filelist.cpp +++ b/filelist.cpp @@ -28,18 +28,18 @@ // public members //////////////////////////////////////////////////////////////////////////////// -FileList::FileList(QWidget *parent = 0, const char *name = 0) : KListView(parent, name) +FileList::FileList(QWidget *parent, const char *name) : KListView(parent, name) { setup(); } -FileList::FileList(QString item, QWidget *parent = 0, const char *name = 0) : KListView(parent, name) +FileList::FileList(QString item, QWidget *parent, const char *name) : KListView(parent, name) { setup(); append(item); } -FileList::FileList(QStringList *items, QWidget *parent = 0, const char *name = 0) : KListView(parent, name) +FileList::FileList(QStringList *items, QWidget *parent, const char *name) : KListView(parent, name) { setup(); append(items); diff --git a/filelistitem.h b/filelistitem.h index d2370a49e78568c04b7a855a01da75d7c89ec94b..d140902b87c6217089d752498160af3e6d1feeaf 100644 --- a/filelistitem.h +++ b/filelistitem.h @@ -36,7 +36,7 @@ public: protected: private: - virtual int compare(QListViewItem *item, int column, bool ascending) const; + int compare(QListViewItem *item, int column, bool ascending) const; int compare(FileListItem *firstItem, FileListItem *secondItem, int column, bool ascending) const; QFileInfo *fileInfo; Tag *tag; diff --git a/genrelist.cpp b/genrelist.cpp index 53d1a08bc8407a2c297c9da72a6f67e60b07f7a3..bc0bef8c494a0c9e778a3997dd373fd82f553733 100644 --- a/genrelist.cpp +++ b/genrelist.cpp @@ -24,12 +24,12 @@ // public members //////////////////////////////////////////////////////////////////////////////// -GenreList::GenreList(bool createIndex = false) : QValueList() +GenreList::GenreList(bool createIndex) : QValueList() { hasIndex = createIndex; } -GenreList::GenreList(QString file, bool createIndex = false) : QValueList() +GenreList::GenreList(QString file, bool createIndex) : QValueList() { hasIndex = createIndex; load(file); diff --git a/player.cpp b/player.cpp index b4e92d104af3dee3c42691b78cd3766d776a442a..403f6099e74bb51dd0d8b3245dde2a718e839e0a 100644 --- a/player.cpp +++ b/player.cpp @@ -55,13 +55,13 @@ Player::~Player() delete(dispatcher); } -void Player::play(QString fileName, float volume = 1.0) +void Player::play(QString fileName, float volume) { currentFile=fileName; play(volume); } -void Player::play(float volume = 1.0) +void Player::play(float volume) { if(serverRunning()) { if(media && media->state()==posPaused) { @@ -110,9 +110,9 @@ void Player::stop() } } -void Player::setVolume(float volume=1.0) +void Player::setVolume(float volume) { - if(serverRunning()) { + if(serverRunning() && media && !media->isNull()) { if(!volumeControl) setupVolumeControl(); if(volumeControl) { diff --git a/slideraction.cpp b/slideraction.cpp index 37c7b498dd14e5582f2b66fe56001b74e090e837..66c3912c00db14bda04b6a74c515a8051b3e7968 100644 --- a/slideraction.cpp +++ b/slideraction.cpp @@ -55,7 +55,29 @@ QSlider *SliderAction::getVolumeSlider() } //////////////////////////////////////////////////////////////////////////////// -// protected members +// public slots +//////////////////////////////////////////////////////////////////////////////// + +void SliderAction::updateOrientation(QDockWindow *dockWindow) +{ + // if the toolbar is not null and either the dockWindow not defined or is the toolbar + if(customWidget && toolbar && (!dockWindow || dockWindow == dynamic_cast(toolbar))) { + if(toolbar->barPos() == KToolBar::Right || toolbar->barPos() == KToolBar::Left) { + trackPositionSlider->setOrientation(Qt::Vertical); + volumeSlider->setOrientation(Qt::Vertical); + layout->setDirection(QBoxLayout::TopToBottom); + } + else { + trackPositionSlider->setOrientation(Qt::Horizontal); + volumeSlider->setOrientation(Qt::Horizontal); + layout->setDirection(QBoxLayout::LeftToRight); + } + } + updateSize(); +} + +//////////////////////////////////////////////////////////////////////////////// +// private members //////////////////////////////////////////////////////////////////////////////// QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base class @@ -90,28 +112,6 @@ QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base } } -//////////////////////////////////////////////////////////////////////////////// -// public slots -//////////////////////////////////////////////////////////////////////////////// - -void SliderAction::updateOrientation(QDockWindow *dockWindow=NULL) -{ - // if the toolbar is not null and either the dockWindow not defined or is the toolbar - if(customWidget && toolbar && (!dockWindow || dockWindow == dynamic_cast(toolbar))) { - if(toolbar->barPos() == KToolBar::Right || toolbar->barPos() == KToolBar::Left) { - trackPositionSlider->setOrientation(Qt::Vertical); - volumeSlider->setOrientation(Qt::Vertical); - layout->setDirection(QBoxLayout::TopToBottom); - } - else { - trackPositionSlider->setOrientation(Qt::Horizontal); - volumeSlider->setOrientation(Qt::Horizontal); - layout->setDirection(QBoxLayout::LeftToRight); - } - } - updateSize(); -} - //////////////////////////////////////////////////////////////////////////////// // private slots //////////////////////////////////////////////////////////////////////////////// diff --git a/slideraction.h b/slideraction.h index f737e56d2bdf67d6a4875696f313607ff6aa80d6..7baf9803c47fe24552538621f92cd11d7cc332d2 100644 --- a/slideraction.h +++ b/slideraction.h @@ -39,12 +39,11 @@ public: QSlider *getTrackPositionSlider(); public slots: - void updateOrientation(QDockWindow *dockWindow=NULL); - -protected: - virtual QWidget *createWidget(QWidget *parent); + void updateOrientation(QDockWindow *dockWindow = 0); private: + QWidget *createWidget(QWidget *parent); + QBoxLayout *layout; QSlider *trackPositionSlider; QSlider *volumeSlider;