Commit c4195357 authored by Scott Wheeler's avatar Scott Wheeler

Fixed a lot of little bugs to get rid of compiler warnings.

svn path=/trunk/kdemultimedia/juk/; revision=142327
parent da02d118
...@@ -68,7 +68,7 @@ void CustomAction::unplug(QWidget *parent) ...@@ -68,7 +68,7 @@ void CustomAction::unplug(QWidget *parent)
toolbar->removeItem(itemId(index)); toolbar->removeItem(itemId(index));
removeContainer(index); removeContainer(index);
toolbar=NULL; toolbar = 0;
} }
} }
} }
...@@ -81,8 +81,3 @@ KToolBar *CustomAction::getToolBar() ...@@ -81,8 +81,3 @@ KToolBar *CustomAction::getToolBar()
{ {
return(toolbar); return(toolbar);
} }
QWidget *CustomAction::createWidget(QWidget *parent) // virtual, should be reimplemented in subclasses
{
return(0);
}
...@@ -36,12 +36,12 @@ public: ...@@ -36,12 +36,12 @@ public:
protected: protected:
KToolBar *getToolBar(); KToolBar *getToolBar();
virtual QWidget *createWidget(QWidget *parent);
QWidget *customWidget; QWidget *customWidget;
KToolBar *toolbar; KToolBar *toolbar;
private: private:
virtual QWidget *createWidget(QWidget *parent) = 0;
signals: signals:
void pluggedIn(QWidget *parent); void pluggedIn(QWidget *parent);
......
...@@ -28,18 +28,18 @@ ...@@ -28,18 +28,18 @@
// public members // 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(); 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(); setup();
append(item); 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(); setup();
append(items); append(items);
......
...@@ -36,7 +36,7 @@ public: ...@@ -36,7 +36,7 @@ public:
protected: protected:
private: 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; int compare(FileListItem *firstItem, FileListItem *secondItem, int column, bool ascending) const;
QFileInfo *fileInfo; QFileInfo *fileInfo;
Tag *tag; Tag *tag;
......
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
// public members // public members
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
GenreList::GenreList(bool createIndex = false) : QValueList<Genre>() GenreList::GenreList(bool createIndex) : QValueList<Genre>()
{ {
hasIndex = createIndex; hasIndex = createIndex;
} }
GenreList::GenreList(QString file, bool createIndex = false) : QValueList<Genre>() GenreList::GenreList(QString file, bool createIndex) : QValueList<Genre>()
{ {
hasIndex = createIndex; hasIndex = createIndex;
load(file); load(file);
......
...@@ -55,13 +55,13 @@ Player::~Player() ...@@ -55,13 +55,13 @@ Player::~Player()
delete(dispatcher); delete(dispatcher);
} }
void Player::play(QString fileName, float volume = 1.0) void Player::play(QString fileName, float volume)
{ {
currentFile=fileName; currentFile=fileName;
play(volume); play(volume);
} }
void Player::play(float volume = 1.0) void Player::play(float volume)
{ {
if(serverRunning()) { if(serverRunning()) {
if(media && media->state()==posPaused) { if(media && media->state()==posPaused) {
...@@ -110,9 +110,9 @@ void Player::stop() ...@@ -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) if(!volumeControl)
setupVolumeControl(); setupVolumeControl();
if(volumeControl) { if(volumeControl) {
......
...@@ -55,7 +55,29 @@ QSlider *SliderAction::getVolumeSlider() ...@@ -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<QDockWindow *>(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 QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base class
...@@ -90,28 +112,6 @@ QWidget *SliderAction::createWidget(QWidget *parent) // virtual -- used by base ...@@ -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<QDockWindow *>(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 // private slots
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
...@@ -39,12 +39,11 @@ public: ...@@ -39,12 +39,11 @@ public:
QSlider *getTrackPositionSlider(); QSlider *getTrackPositionSlider();
public slots: public slots:
void updateOrientation(QDockWindow *dockWindow=NULL); void updateOrientation(QDockWindow *dockWindow = 0);
protected:
virtual QWidget *createWidget(QWidget *parent);
private: private:
QWidget *createWidget(QWidget *parent);
QBoxLayout *layout; QBoxLayout *layout;
QSlider *trackPositionSlider; QSlider *trackPositionSlider;
QSlider *volumeSlider; QSlider *volumeSlider;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment