Commit 5902b9ff authored by Scott Wheeler's avatar Scott Wheeler

Ok, you're welcome everyone. Moving away from my long standard style

of doing return(value);  Thankyou Perl!

svn path=/trunk/kdemultimedia/juk/; revision=206647
parent 60649b0c
......@@ -116,7 +116,7 @@ void ArtsPlayer::setVolume(float volume)
float ArtsPlayer::getVolume() const
{
return(currentVolume);
return currentVolume;
}
/////////////////////////////////////////////////////////////////////////////////
......@@ -126,33 +126,33 @@ float ArtsPlayer::getVolume() const
bool ArtsPlayer::playing() const
{
if(serverRunning() && media && media->state() == posPlaying)
return(true);
return true;
else
return(false);
return false;
}
bool ArtsPlayer::paused() const
{
if(serverRunning() && media && media->state() == posPaused)
return(true);
return true;
else
return(false);
return false;
}
long ArtsPlayer::totalTime() const
{
if(serverRunning() && media)
return(media->overallTime().seconds);
return media->overallTime().seconds;
else
return(-1);
return -1;
}
long ArtsPlayer::currentTime() const
{
if(serverRunning() && media && media->state() == posPlaying)
return(media->currentTime().seconds);
return media->currentTime().seconds;
else
return(-1);
return -1;
}
int ArtsPlayer::position() const
......@@ -163,10 +163,10 @@ int ArtsPlayer::position() const
long total = media->overallTime().seconds * 1000 + media->overallTime().ms;
long current = media->currentTime().seconds * 1000 + media->currentTime().ms;
// add .5 to make rounding happen properly
return(int(double(current) * 1000 / total + .5));
return int(double(current) * 1000 / total + .5);
}
else
return(-1);
return -1;
}
/////////////////////////////////////////////////////////////////////////////////
......@@ -231,7 +231,7 @@ void ArtsPlayer::setupVolumeControl()
bool ArtsPlayer::serverRunning() const
{
if(server)
return(!(server->isNull()));
return !(server->isNull());
else
return(0);
return 0;
}
......@@ -33,7 +33,7 @@ Cache *Cache::instance()
cache = new Cache();
cache->load();
}
return(cache);
return cache;
}
void Cache::save()
......
......@@ -41,81 +41,81 @@ void CachedTag::save()
QString CachedTag::track() const
{
if(externalTag)
return(externalTag->track());
return externalTag->track();
else
return(tagTrack);
return tagTrack;
}
QString CachedTag::artist() const
{
if(externalTag)
return(externalTag->artist());
return externalTag->artist();
else
return(tagArtist);
return tagArtist;
}
QString CachedTag::album() const
{
if(externalTag)
return(externalTag->album());
return externalTag->album();
else
return(tagAlbum);
return tagAlbum;
}
Genre CachedTag::genre() const
{
if(externalTag)
return(externalTag->genre());
return externalTag->genre();
else
return(tagGenre);
return tagGenre;
}
int CachedTag::trackNumber() const
{
if(externalTag)
return(externalTag->trackNumber());
return externalTag->trackNumber();
else
return(tagTrackNumber);
return tagTrackNumber;
}
QString CachedTag::trackNumberString() const
{
if(externalTag)
return(externalTag->trackNumberString());
return externalTag->trackNumberString();
else
return(tagTrackNumberString);
return tagTrackNumberString;
}
int CachedTag::year() const
{
if(externalTag)
return(externalTag->year());
return externalTag->year();
else
return(tagYear);
return tagYear;
}
QString CachedTag::yearString() const
{
if(externalTag)
return(externalTag->yearString());
return externalTag->yearString();
else
return(tagYearString);
return tagYearString;
}
QString CachedTag::comment() const
{
if(externalTag)
return(externalTag->comment());
return externalTag->comment();
else
return(tagComment);
return tagComment;
}
bool CachedTag::hasTag() const
{
if(externalTag)
return(externalTag->hasTag());
return externalTag->hasTag();
else
return(tagExists);
return tagExists;
}
void CachedTag::setTrack(const QString &value)
......@@ -155,17 +155,17 @@ void CachedTag::setComment(const QString &value)
QString CachedTag::bitrateString() const
{
return(tagBitrateString);
return tagBitrateString;
}
QString CachedTag::lengthString() const
{
return(tagLengthString);
return tagLengthString;
}
int CachedTag::seconds() const
{
return(tagSeconds);
return tagSeconds;
}
bool CachedTag::current() const
......@@ -197,7 +197,7 @@ QDataStream &CachedTag::read(QDataStream &s)
>> fileName
>> modificationTime;
return(s);
return s;
}
////////////////////////////////////////////////////////////////////////////////
......@@ -211,7 +211,7 @@ Tag *CachedTag::proxiedTag()
externalTag = Tag::createTag(absFilePath(), true);
}
return(externalTag);
return externalTag;
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -33,7 +33,7 @@ CollectionList *CollectionList::list = 0;
CollectionList *CollectionList::instance()
{
return(list);
return list;
}
void CollectionList::initialize(PlaylistSplitter *s, QWidget *parent, bool restoreOnLoad)
......@@ -51,26 +51,26 @@ void CollectionList::initialize(PlaylistSplitter *s, QWidget *parent, bool resto
QStringList CollectionList::artists() const
{
return(artistList.values());
return artistList.values();
}
QStringList CollectionList::albums() const
{
return(albumList.values());
return albumList.values();
}
CollectionListItem *CollectionList::lookup(const QString &file)
{
return(itemsDict.find(file));
return itemsDict.find(file);
}
PlaylistItem *CollectionList::createItem(const QFileInfo &file, QListViewItem *)
{
QString path = file.absFilePath();
if(itemsDict.find(path))
return(0);
return 0;
return(new CollectionListItem(file, path));
return new CollectionListItem(file, path);
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -53,10 +53,10 @@ int CustomAction::plug(QWidget *parent, int index)
return (containerCount() - 1);
}
return(-1);
return -1;
}
else {
return(-1);
return -1;
}
}
......@@ -82,6 +82,6 @@ void CustomAction::unplug(QWidget *parent)
KToolBar *CustomAction::getToolBar()
{
return(toolbar);
return toolbar;
}
#include "customaction.moc"
......@@ -41,12 +41,12 @@ Genre &Genre::operator=(const QString &genreName)
{
Genre genre(genreName, getID3v1());
*this = genre;
return(*this);
return *this;
}
int Genre::getID3v1() const
{
return(ID3v1);
return ID3v1;
}
void Genre::setID3v1(int ID3v1Number)
......@@ -61,7 +61,7 @@ void Genre::setID3v1(int ID3v1Number)
QDataStream &operator<<(QDataStream &s, const Genre &g)
{
s << QString(g) << g.getID3v1();
return(s);
return s;
}
QDataStream &operator>>(QDataStream &s, Genre &g)
......@@ -74,5 +74,5 @@ QDataStream &operator>>(QDataStream &s, Genre &g)
g = name;
g.setID3v1(n);
return(s);
return s;
}
......@@ -55,9 +55,9 @@ void GenreList::load(const QString &file)
QString GenreList::ID3v1Name(int ID3v1)
{
if(hasIndex && ID3v1 >= 0 && ID3v1 < int(index.size()))
return(index[ID3v1]);
return index[ID3v1];
else
return(QString::null);
return QString::null;
}
int GenreList::findIndex(const QString &item)
......@@ -72,23 +72,23 @@ int GenreList::findIndex(const QString &item)
// a cache hit
if(!lastItem.isEmpty() && lastItem == item)
return(lastIndex);
return lastIndex;
int i = 0;
for(GenreList::Iterator it = begin(); it != end(); ++it) {
if(item == (*it)) {
lastItem = item;
lastIndex = i;
return(i);
return i;
}
i++;
}
return(-1);
return -1;
}
QString GenreList::name() const
{
return(listName);
return listName;
}
void GenreList::setName(const QString &n)
......
......@@ -40,7 +40,7 @@ GenreList GenreListList::ID3v1List()
ID3v1->load(locate("data", "juk/id3v1.genreml"));
ID3v1->setReadOnly(true);
}
return(*ID3v1);
return *ID3v1;
}
GenreListList GenreListList::lists()
......@@ -59,7 +59,7 @@ GenreListList GenreListList::lists()
l.append(genreList);
}
return(l);
return l;
}
// private
......
......@@ -51,7 +51,7 @@ bool GenreListReader::startElement(const QString &, const QString &, const QStri
else
ID3v1 = 255;
return(true);
return true;
};
bool GenreListReader::endElement(const QString &, const QString &, const QString & element)
......@@ -59,7 +59,7 @@ bool GenreListReader::endElement(const QString &, const QString &, const QString
if(element.lower() == "genre")
inGenreTag = false;
return(true);
return true;
};
bool GenreListReader::characters(const QString &content)
......@@ -67,5 +67,5 @@ bool GenreListReader::characters(const QString &content)
if(inGenreTag)
list->append(Genre(content, ID3v1));
return(true);
return true;
};
......@@ -168,52 +168,52 @@ void ID3Tag::save()
bool ID3Tag::hasTag() const
{
return(tagExists);
return tagExists;
}
QString ID3Tag::track() const // The song's name, not it's track number
{
return(tagTrack);
return tagTrack;
}
QString ID3Tag::artist() const
{
return(tagArtist);
return tagArtist;
}
QString ID3Tag::album() const
{
return(tagAlbum);
return tagAlbum;
}
Genre ID3Tag::genre() const
{
return(tagGenre);
return tagGenre;
}
int ID3Tag::trackNumber() const
{
return(tagTrackNumber);
return tagTrackNumber;
}
QString ID3Tag::trackNumberString() const
{
return(tagTrackNumberString);
return tagTrackNumberString;
}
int ID3Tag::year() const
{
return(tagYear);
return tagYear;
}
QString ID3Tag::yearString() const
{
return(tagYearString);
return tagYearString;
}
QString ID3Tag::comment() const
{
return(tagComment);
return tagComment;
}
/////////////////////////////////////////////////////
......@@ -272,15 +272,15 @@ void ID3Tag::setComment(const QString &value)
QString ID3Tag::bitrateString() const
{
return(readBitrate(metaInfo));
return readBitrate(metaInfo);
}
QString ID3Tag::lengthString() const
{
return(readLength(metaInfo));
return readLength(metaInfo);
}
int ID3Tag::seconds() const
{
return(readSeconds(metaInfo));
return readSeconds(metaInfo);
}
......@@ -302,7 +302,7 @@ bool JuK::queryClose()
Cache::instance()->save();
saveConfig();
delete(splitter);
return(true);
return true;
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -47,9 +47,9 @@ void OggTag::save()
bool OggTag::hasTag() const
{
if(metaInfo.isValid() && !metaInfo.isEmpty())
return(true);
return true;
else
return(false);
return false;
}
QString OggTag::track() const
......@@ -59,7 +59,7 @@ QString OggTag::track() const
if(s.stripWhiteSpace().isEmpty())
s = fileInfo.baseName();
return(s);
return s;
}
QString OggTag::artist() const
......@@ -94,18 +94,18 @@ int OggTag::year() const
QDateTime d = QDateTime::fromString(readCommentString("Date"), Qt::ISODate);
if(d.isValid())
return(d.date().year());
return d.date().year();
else
return(0);
return 0;
}
QString OggTag::yearString() const
{
QDateTime d = QDate::fromString(readCommentString("Date"), Qt::ISODate);
if(d.isValid())
return(QString::number(d.date().year()));
return QString::number(d.date().year());
else
return(QString::null);
return QString::null;
}
QString OggTag::comment() const
......@@ -178,9 +178,9 @@ QString OggTag::readCommentString(const QString &key) const
commentGroup.contains(key))
// I'm throwing in the stripWhiteSpace() here, because the IOSlave/KFMI
// stuff seems to be padding fields arbitrarily.
return(commentGroup.item(key).string().stripWhiteSpace());
return commentGroup.item(key).string().stripWhiteSpace();
else
return(QString::null);
return QString::null;
}
int OggTag::readCommentInt(const QString &key) const
......@@ -191,12 +191,12 @@ int OggTag::readCommentInt(const QString &key) const
bool ok;
int value = commentGroup.item(key).value().toInt(&ok);
if(ok)
return(value);
return value;
else
return(-1);
return -1;
}
else
return(-1);
return -1;
}
void OggTag::writeCommentItem(const QString &key, const QString &value)
......
......@@ -200,7 +200,7 @@ QStringList Playlist::files() const
for(PlaylistItem *i = static_cast<PlaylistItem *>(firstChild()); i; i = static_cast<PlaylistItem *>(i->itemBelow()))
list.append(i->absFilePath());
return(list);
return list;
}
PlaylistItemList Playlist::items() const
......@@ -209,7 +209,7 @@ PlaylistItemList Playlist::items() const
for(PlaylistItem *i = static_cast<PlaylistItem *>(firstChild()); i; i = static_cast<PlaylistItem *>(i->itemBelow()))
list.append(i);
return(list);
return list;
}
PlaylistItemList Playlist::selectedItems() const
......@@ -219,7 +219,7 @@ PlaylistItemList Playlist::selectedItems() const
if(i->isSelected())
list.append(i);
return(list);
return list;
}
void Playlist::remove(const PlaylistItemList &items)
......@@ -255,7 +255,7 @@ void Playlist::remove(const PlaylistItemList &items)
PlaylistItem *Playlist::nextItem(PlaylistItem *current, bool random)
{
if(!current)
return(0);
return 0;
PlaylistItem *i;
......@@ -274,26 +274,26 @@ PlaylistItem *Playlist::nextItem(PlaylistItem *current, bool random)
else
i = static_cast<PlaylistItem *>(current->itemBelow());
return(i);
return i;
}
PlaylistItem *Playlist::previousItem(PlaylistItem *current, bool random)
{
if(!current)
return(0);
return 0;
if(random && !history.isEmpty())
return(history.pop());
return history.pop();
else
return(static_cast<PlaylistItem *>(current->itemAbove()));
return static_cast<PlaylistItem *>(current->itemAbove());
}
QString Playlist::name() const
{
if(playlistName == QString::null)
return(playlistFileName.section(QDir::separator(), -1).section('.', 0, -2));
return playlistFileName.section(QDir::separator(), -1).section('.', 0, -2);
else
return(playlistName);
return playlistName;
}
void Playlist::setName(const QString &n)
......@@ -319,7 +319,7 @@ QDragObject *Playlist::dragObject()
KURLDrag *drag = new KURLDrag(urls, this, "Playlist Items");
drag->setPixmap(SmallIcon("sound"));
return(drag);
return drag;
}
void Playlist::contentsDropEvent(QDropEvent *e)
......@@ -379,10 +379,10 @@ PlaylistItem *Playlist::createItem(const QFileInfo &file, QListViewItem *after)
else
i = new PlaylistItem(item, this);
emit(numberOfItemsChanged(this));
return(i);
return i;
}
else
return(0);
return 0;
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -98,9 +98,9 @@ public:
* Internal files are files which have not been saved by the user, but rather
* are stored in JuK's data directory and are restored by session management.
*/
bool isInternalFile() const { return(internalFile); }
bool isInternalFile() const { return internalFile; }
void setInternal(bool internal) { internalFile = internal; }
QString fileName() const { return(playlistFileName); }
QString fileName() const { return playlistFileName; }
void setFileName(const QString &n) { playlistFileName = n; }
/**
......@@ -115,10 +115,10 @@ public:
*/
void setName(const QString &n);
PlaylistBoxItem *playlistBoxItem() const { return(boxItem); }
PlaylistBoxItem *playlistBoxItem() const { return boxItem; }
void setPlaylistBoxItem(PlaylistBoxItem *item) { boxItem = item; }
int count() const { return(childCount()); }
int count() const { return childCount(); }
/**
* This gets the next item to be played. This is static because often we
......@@ -137,7 +137,7 @@ protected:
virtual QDragObject *dragObject();
virtual void contentsDropEvent(QDropEvent *e);
virtual void contentsDragMoveEvent(QDragMoveEvent *e);
PlaylistSplitter *playlistSplitter() const { return(splitter); }
PlaylistSplitter *playlistSplitter() const { return splitter; }
signals:
/**
......
......@@ -86,7 +86,7 @@ void PlaylistBox::sort()
QStringList PlaylistBox::names() const
{
return(nameList);
return nameList;
}
////////////////////////////////////////////////////////////////////////////////
......@@ -368,12 +368,12 @@ PlaylistBoxItem::~PlaylistBoxItem()
Playlist *PlaylistBoxItem::playlist() const
{
return(list);
return list;
}
PlaylistBox *PlaylistBoxItem::listBox() const
{
return(dynamic_cast<PlaylistBox *>(ListBoxPixmap::listBox()));
return dynamic_cast<PlaylistBox *>(ListBoxPixmap::listBox());
}
void PlaylistBoxItem::setName(const QString &name)
......
......@@ -102,7 +102,7 @@ private:
#if QT_VERSION < 0x031000
public:
// This method is defined in Qt 3.1 and later.
QListBoxItem *selectedItem() { return(item(currentItem())); }
QListBoxItem *selectedItem() { return item(currentItem()); }
#endif
};
......
......@@ -38,34 +38,34 @@ void PlaylistItem::setFile(const QString &file)
Tag *PlaylistItem::tag() const
{
return(data->tag());
return data->tag();
}
// some forwarding methods
QString PlaylistItem::fileName() const
{
return(data->fileName());
return data->fileName();