Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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)
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);
}
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -24,12 +24,12 @@
// public members
////////////////////////////////////////////////////////////////////////////////
GenreList::GenreList(bool createIndex = false) : QValueList<Genre>()
GenreList::GenreList(bool createIndex) : QValueList<Genre>()
{
hasIndex = createIndex;
}
GenreList::GenreList(QString file, bool createIndex = false) : QValueList<Genre>()
GenreList::GenreList(QString file, bool createIndex) : QValueList<Genre>()
{
hasIndex = createIndex;
load(file);
......
......@@ -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) {
......
......@@ -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
......@@ -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
////////////////////////////////////////////////////////////////////////////////
......
......@@ -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;
......
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