Commit e5c9e4dd authored by Michael Pyne's avatar Michael Pyne

Change QString::null to QString() in JuK where it makes sense. I believe there is a

difference between having a empty genre and having no genre tag at all so I do not
intend to touch the tag-based stuff.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=666186
parent fe492e06
......@@ -17,10 +17,11 @@
#define DYNAMICPLAYLIST_H
#include "playlist.h"
//Added by qt3to4:
#include <QShowEvent>
#include <Q3ValueList>
#include <QPaintEvent>
class QPaintEvent;
class QShowEvent;
/**
* A Playlist that is a union of other playlists that is created dynamically.
......@@ -35,7 +36,7 @@ public:
*/
DynamicPlaylist(const PlaylistList &lists,
PlaylistCollection *collection,
const QString &name = QString::null,
const QString &name = QString(),
const QString &iconName = "midi",
bool setupPlaylist = true,
bool synchronizePlaying = false);
......
......@@ -170,7 +170,7 @@ CoverInfo *FileHandle::coverInfo() const
QString FileHandle::absFilePath() const
{
if(d->absFilePath.isNull())
if(d->absFilePath.isEmpty())
d->absFilePath = resolveSymLinks(d->fileInfo.absoluteFilePath());
return d->absFilePath;
}
......@@ -263,7 +263,7 @@ void FileHandle::setup(const QFileInfo &info, const QString &path)
if(d && !isNull())
return;
QString fileName = path.isNull() ? info.absoluteFilePath() : path;
QString fileName = path.isEmpty() ? info.absoluteFilePath() : path;
FileHandle cached = Cache::instance()->value(resolveSymLinks(fileName));
......
......@@ -16,15 +16,14 @@
#ifndef FILEHANDLE_H
#define FILEHANDLE_H
#include <qstringlist.h>
//Added by qt3to4:
#include <Q3ValueList>
class QFileInfo;
class QDateTime;
class QDataStream;
class CoverInfo;
class QStringList;
class CoverInfo;
class Tag;
class CacheDataStream;
......@@ -38,7 +37,7 @@ class FileHandle
public:
FileHandle();
FileHandle(const FileHandle &f);
explicit FileHandle(const QFileInfo &info, const QString &path = QString::null);
explicit FileHandle(const QFileInfo &info, const QString &path = QString());
explicit FileHandle(const QString &path);
FileHandle(const QString &path, CacheDataStream &s);
~FileHandle();
......
......@@ -15,6 +15,7 @@
#define FILEHANDLEPROPERTIES_H
#include <QMap>
#include <QStringList>
/*
* These ugly macros make possible a property registration system that makes it
......
......@@ -977,7 +977,7 @@ bool FileRenamer::moveFile(const QString &src, const QString &dest)
// Get just the directory.
KUrl dir = dstURL;
dir.setFileName(QString::null);
dir.setFileName(QString());
// Create the directory.
if(!KStandardDirs::exists(dir.path()))
......
......@@ -51,7 +51,7 @@ void FolderPlaylist::setFolder(const QString &s)
void FolderPlaylist::slotReload()
{
if(!m_folder.isNull())
if(!m_folder.isEmpty())
addFiles(QStringList(m_folder));
}
......
......@@ -22,8 +22,8 @@ class FolderPlaylist : public Playlist
Q_OBJECT
public:
explicit FolderPlaylist(PlaylistCollection *collection, const QString &folder = QString::null,
const QString &name = QString::null);
explicit FolderPlaylist(PlaylistCollection *collection, const QString &folder = QString(),
const QString &name = QString());
virtual ~FolderPlaylist();
QString folder() const;
......
......@@ -17,10 +17,6 @@
#include <kdialog.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include <QRegExp>
//Added by qt3to4:
#include <Q3ValueList>
#include "filehandle.h"
......@@ -29,12 +25,14 @@ namespace DOM {
class HTMLDocument;
}
class QPixmap;
class KUrl;
class GoogleImage
{
public:
explicit GoogleImage(QString thumbURL = QString::null, QString size = QString::null);
explicit GoogleImage(QString thumbURL = QString(), QString size = QString());
QString imageURL() const { return m_imageURL; }
QString thumbURL() const { return m_thumbURL; }
......
......@@ -43,7 +43,7 @@ GoogleFetcherDialog::GoogleFetcherDialog(const QString &name,
{
setObjectName(name.toAscii());
setModal(true);
setCaption(QString::null);
// setCaption(QString());
setButtons(Ok | Cancel | User1);
setDefaultButton(NoDefault);
showButtonSeparator(true);
......
......@@ -445,7 +445,7 @@ Playlist::~Playlist()
QString Playlist::name() const
{
if(m_playlistName.isNull())
if(m_playlistName.isEmpty())
return m_fileName.section(QDir::separator(), -1).section('.', 0, -2);
else
return m_playlistName;
......@@ -819,7 +819,7 @@ void Playlist::slotRemoveCover()
return;
int button = KMessageBox::warningContinueCancel(this,
i18n("Are you sure you want to delete these covers?"),
QString::null,
QString(),
KGuiItem(i18n("&Delete Covers")));
if(button == KMessageBox::Continue)
refreshAlbums(items);
......@@ -2279,7 +2279,7 @@ void Playlist::slotInlineEditDone(Q3ListViewItem *, const QString &, int column)
(l.count() > 1 && KMessageBox::warningContinueCancel(
0,
i18n("This will edit multiple files. Are you sure?"),
QString::null,
QString(),
KGuiItem(i18n("Edit")),
KStandardGuiItem::cancel(),
"DontWarnMultipleTags") == KMessageBox::Cancel))
......
......@@ -21,21 +21,9 @@
#include <kdebug.h>
#include <kglobalsettings.h>
#include <q3valuevector.h>
#include <qfileinfo.h>
#include <QPaintEvent>
#include <QKeyEvent>
#include <QEvent>
#include <QDropEvent>
#include <Q3ValueVector>
#include <Q3ValueList>
#include <QShowEvent>
#include <QResizeEvent>
#include <QDragEnterEvent>
#include <QMouseEvent>
#include <QCustomEvent>
#include <QMimeData>
#include <QDrag>
#include <QEvent>
#include "covermanager.h"
#include "stringhash.h"
......@@ -47,10 +35,11 @@
class KMenu;
class KActionMenu;
class QEvent;
class QFileInfo;
class QMimeData;
class QDrag;
class PlaylistCollection;
class PlaylistToolTip;
class UpcomingPlaylist;
......@@ -62,10 +51,10 @@ class Playlist : public K3ListView, public PlaylistInterface
public:
explicit Playlist(PlaylistCollection *collection, const QString &name = QString::null,
explicit Playlist(PlaylistCollection *collection, const QString &name = QString(),
const QString &iconName = "midi");
Playlist(PlaylistCollection *collection, const PlaylistItemList &items,
const QString &name = QString::null, const QString &iconName = "midi");
const QString &name = QString(), const QString &iconName = "midi");
Playlist(PlaylistCollection *collection, const QFileInfo &playlistFile,
const QString &iconName = "midi");
......@@ -205,7 +194,7 @@ public:
/**
* Returns the file name associated with this playlist (an m3u file) or
* QString::null if no such file exists.
* an empty QString if no such file exists.
*/
QString fileName() const { return m_fileName; }
......@@ -309,7 +298,7 @@ public:
/**
* Returns true if it's possible to reload this playlist.
*/
virtual bool canReload() const { return !m_fileName.isNull(); }
virtual bool canReload() const { return !m_fileName.isEmpty(); }
/**
* Returns true if the playlist is a search playlist and the search should be
......
......@@ -37,6 +37,7 @@
#include <Q3ValueList>
#include <QMenu>
#include <QMouseEvent>
#include <QFileInfo>
#include "playlist.h"
#include "collectionlist.h"
......@@ -307,7 +308,7 @@ void PlaylistBox::remove()
if(!files.isEmpty()) {
int remove = KMessageBox::warningYesNoCancelList(
this, i18n("Do you want to delete these files from the disk as well?"), files, QString::null, KStandardGuiItem::del(), KGuiItem(i18n("Keep")));
this, i18n("Do you want to delete these files from the disk as well?"), files, QString(), KStandardGuiItem::del(), KGuiItem(i18n("Keep")));
if(remove == KMessageBox::Yes) {
QStringList couldNotDelete;
......
......@@ -236,7 +236,7 @@ void PlaylistCollection::showMore(const QString &artist, const QString &album)
// so cache the value we want it to have now.
Playlist *belowShowMore = visiblePlaylist();
PlaylistCollection::setupPlaylist(m_showMorePlaylist, QString::null);
PlaylistCollection::setupPlaylist(m_showMorePlaylist, QString());
PlaylistCollection::raise(m_showMorePlaylist);
m_belowShowMorePlaylist = belowShowMore;
......@@ -333,7 +333,7 @@ void PlaylistCollection::open(const QStringList &l)
KMessageBox::questionYesNo(
JuK::JuKInstance(),
i18n("Do you want to add these items to the current list or to the collection list?"),
QString::null,
QString(),
KGuiItem(i18n("Current")),
KGuiItem(i18n("Collection"))) == KMessageBox::No)
{
......@@ -398,7 +398,7 @@ void PlaylistCollection::rename()
m_playlistNames.remove(old);
if(name.isNull())
if(name.isEmpty())
return;
visiblePlaylist()->setName(name);
......@@ -407,7 +407,7 @@ void PlaylistCollection::rename()
void PlaylistCollection::duplicate()
{
QString name = playlistNameDialog(i18n("Duplicate"), visiblePlaylist()->name());
if(name.isNull())
if(name.isEmpty())
return;
raise(new Playlist(this, visiblePlaylist()->items(), name));
}
......@@ -500,7 +500,7 @@ void PlaylistCollection::scanFolders()
void PlaylistCollection::createPlaylist()
{
QString name = playlistNameDialog();
if(!name.isNull())
if(!name.isEmpty())
raise(new Playlist(this, name));
}
......@@ -525,7 +525,7 @@ void PlaylistCollection::createFolderPlaylist()
QString name = uniquePlaylistName(folder.mid(folder.lastIndexOf('/') + 1));
name = playlistNameDialog(i18n("Create Folder Playlist"), name);
if(!name.isNull())
if(!name.isEmpty())
raise(new FolderPlaylist(this, folder, name));
}
......@@ -677,10 +677,10 @@ Q3WidgetStack *PlaylistCollection::playlistStack() const
void PlaylistCollection::setupPlaylist(Playlist *playlist, const QString &)
{
if(!playlist->fileName().isNull())
if(!playlist->fileName().isEmpty())
m_playlistFiles.insert(playlist->fileName());
if(!playlist->name().isNull())
if(!playlist->name().isEmpty())
m_playlistNames.insert(playlist->name());
QObject::connect(playlist, SIGNAL(selectionChanged()),
......
......@@ -16,17 +16,17 @@
#define PLAYLIST_COLLECTION_H
#include "stringhash.h"
#include "playlistinterface.h"
#include <kshortcut.h>
#include <klocale.h>
#include <kdirlister.h>
#include <qpointer.h>
//Added by qt3to4:
#include <QPixmap>
#include <QPointer>
#include <Q3ValueList>
#include <QList>
#include "playlistinterface.h"
class QPixmap;
class Q3WidgetStack;
class KAction;
class Playlist;
......@@ -166,7 +166,7 @@ protected:
bool containsPlaylistFile(const QString &file) const;
QString playlistNameDialog(const QString &caption = i18n("Create New Playlist"),
const QString &suggest = QString::null,
const QString &suggest = QString(),
bool forceUnique = true) const;
QString uniquePlaylistName(const QString &suggest = i18n("Playlist")) const;
......@@ -219,7 +219,7 @@ private:
KAction *createAction(const QString &text,
const char *slot,
const char *name,
const QString &icon = QString::null,
const QString &icon = QString(),
const KShortcut &shortcut = KShortcut());
private slots:
void slotPlayFirst() { m_collection->playFirst(); }
......
......@@ -24,7 +24,7 @@ class SearchPlaylist : public DynamicPlaylist
public:
explicit SearchPlaylist(PlaylistCollection *collection,
const PlaylistSearch &search = PlaylistSearch(),
const QString &name = QString::null,
const QString &name = QString(),
bool setupPlaylist = true,
bool synchronizePlaying = false);
......
......@@ -546,7 +546,7 @@ QColor SystemTray::interpolateColor(int step, int steps)
void SystemTray::setToolTip(const QString &tip, const QPixmap &cover)
{
if(tip.isNull())
if(tip.isEmpty())
KSystemTrayIcon::setToolTip( i18n("JuK"));
else {
QPixmap myCover = cover;
......
......@@ -85,7 +85,7 @@ private:
virtual void wheelEvent(QWheelEvent *e);
void createPopup();
void setToolTip(const QString &tip = QString::null, const QPixmap &cover = QPixmap());
void setToolTip(const QString &tip = QString(), const QPixmap &cover = QPixmap());
void slotActivated(QSystemTrayIcon::ActivationReason reason);
void ousePressEvent(QMouseEvent *e);
QPixmap createPixmap(const QString &pixName);
......
......@@ -435,7 +435,7 @@ void TagEditor::updateCollection()
m_genreList.sort();
m_genreBox->clear();
m_genreBox->addItem(QString::null);
m_genreBox->addItem(QString());
m_genreBox->addItems(m_genreList);
m_genreBox->completionObject()->setItems(m_genreList);
}
......
......@@ -74,7 +74,7 @@ private:
* Adds an item to JuK's tagging layout. This handles the creation and
* placement of the "enable" box as well.
*/
void addItem(const QString &text, QWidget *item, QBoxLayout *layout, const QString &iconName = QString::null);
void addItem(const QString &text, QWidget *item, QBoxLayout *layout, const QString &iconName = QString());
/**
* Adds a widget to m_hideList and returns that widget.
......
......@@ -88,7 +88,7 @@ Tag *TagTransactionManager::duplicateTag(const Tag *tag, const QString &fileName
{
Q_ASSERT(tag);
QString name = fileName.isNull() ? tag->fileName() : fileName;
QString name = fileName.isEmpty() ? tag->fileName() : fileName;
Tag *newTag = new Tag(*tag);
newTag->setFileName(name);
......
......@@ -139,13 +139,13 @@ class TagTransactionManager : public QObject
* object doesn't have a decent copy constructor.
*
* @param tag The Tag to duplicate.
* @param fileName The filename to assign to the tag. If QString::null
* @param fileName The filename to assign to the tag. If an empty QString
* (the default) is passed, the filename of the existing tag is
* used.
* @bug Tag should have a correct copy ctor and assignment operator.
* @return The duplicate Tag.
*/
static Tag *duplicateTag(const Tag *tag, const QString &fileName = QString::null);
static Tag *duplicateTag(const Tag *tag, const QString &fileName = QString());
/**
* Commits the changes to the PlaylistItems. It is important that the
......
......@@ -28,7 +28,7 @@ class TreeViewItemPlaylist : public SearchPlaylist
public:
explicit TreeViewItemPlaylist(PlaylistCollection *collection,
const PlaylistSearch &search = PlaylistSearch(),
const QString &name = QString::null);
const QString &name = QString());
virtual bool searchIsEditable() const { return false; }
void retag(const QStringList &files, Playlist *donorPlaylist);
......
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