summaryrefslogtreecommitdiffstats
path: root/src/library
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-12-15 01:43:38 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-12-15 01:57:06 +0100
commit73c750df852e7b6336154acd65bd39de975feadc (patch)
tree0ccacc0c3773324e7e97512eb3d1a0526d0017c3 /src/library
parent9326b65dd35d39c8180edc8c5200a84e81cd88c0 (diff)
Replace null pointer constants (e.g. NULL, 0) with nullptr
Diffstat (limited to 'src/library')
-rw-r--r--src/library/autodj/autodjprocessor.cpp6
-rw-r--r--src/library/autodj/dlgautodj.cpp8
-rw-r--r--src/library/banshee/bansheefeature.cpp8
-rw-r--r--src/library/baseexternallibraryfeature.cpp7
-rw-r--r--src/library/baseplaylistfeature.cpp26
-rw-r--r--src/library/bpmdelegate.cpp4
-rw-r--r--src/library/browse/browsetablemodel.cpp7
-rw-r--r--src/library/browse/browsethread.cpp2
-rw-r--r--src/library/browse/foldertreemodel.cpp6
-rw-r--r--src/library/coverartutils.cpp4
-rw-r--r--src/library/crate/cratefeature.cpp10
-rw-r--r--src/library/dao/analysisdao.cpp2
-rw-r--r--src/library/dao/autodjcratesdao.cpp2
-rw-r--r--src/library/export/trackexportdlg.cpp8
-rw-r--r--src/library/export/trackexportwizard.cpp2
-rw-r--r--src/library/itunes/itunesfeature.cpp20
-rw-r--r--src/library/library.cpp7
-rw-r--r--src/library/librarycontrol.cpp6
-rw-r--r--src/library/libraryfeature.cpp14
-rw-r--r--src/library/parsercsv.cpp10
-rw-r--r--src/library/parserm3u.cpp15
-rw-r--r--src/library/parserpls.cpp5
-rw-r--r--src/library/proxytrackmodel.cpp8
-rw-r--r--src/library/rhythmbox/rhythmboxfeature.cpp12
-rw-r--r--src/library/sidebarmodel.cpp4
-rw-r--r--src/library/stareditor.cpp4
-rw-r--r--src/library/traktor/traktorfeature.cpp14
27 files changed, 114 insertions, 107 deletions
diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp
index 029876bbb3..b9506a6133 100644
--- a/src/library/autodj/autodjprocessor.cpp
+++ b/src/library/autodj/autodjprocessor.cpp
@@ -105,7 +105,7 @@ void DeckAttributes::slotRateChanged(double v) {
}
TrackPointer DeckAttributes::getLoadedTrack() const {
- return m_pPlayer != NULL ? m_pPlayer->getLoadedTrack() : TrackPointer();
+ return m_pPlayer != nullptr ? m_pPlayer->getLoadedTrack() : TrackPointer();
}
AutoDJProcessor::AutoDJProcessor(
@@ -117,7 +117,7 @@ AutoDJProcessor::AutoDJProcessor(
: QObject(pParent),
m_pConfig(pConfig),
m_pPlayerManager(pPlayerManager),
- m_pAutoDJTableModel(NULL),
+ m_pAutoDJTableModel(nullptr),
m_eState(ADJ_DISABLED),
m_transitionProgress(0.0),
m_transitionTime(kTransitionPreferenceDefault) {
@@ -153,7 +153,7 @@ AutoDJProcessor::AutoDJProcessor(
QString group = PlayerManager::groupForDeck(i);
BaseTrackPlayer* pPlayer = pPlayerManager->getPlayer(group);
// Shouldn't be possible.
- if (pPlayer == NULL) {
+ if (pPlayer == nullptr) {
qWarning() << "PROGRAMMING ERROR deck does not exist" << i;
continue;
}
diff --git a/src/library/autodj/dlgautodj.cpp b/src/library/autodj/dlgautodj.cpp
index f56c0054e4..13302d2abf 100644
--- a/src/library/autodj/dlgautodj.cpp
+++ b/src/library/autodj/dlgautodj.cpp
@@ -273,16 +273,16 @@ void DlgAutoDJ::toggleAutoDJButton(bool enable) {
AutoDJProcessor::AutoDJError error = m_pAutoDJProcessor->toggleAutoDJ(enable);
switch (error) {
case AutoDJProcessor::ADJ_BOTH_DECKS_PLAYING:
- QMessageBox::warning(
- NULL, tr("Auto DJ"),
+ QMessageBox::warning(nullptr,
+ tr("Auto DJ"),
tr("One deck must be stopped to enable Auto DJ mode."),
QMessageBox::Ok);
// Make sure the button becomes unpushed.
pushButtonAutoDJ->setChecked(false);
break;
case AutoDJProcessor::ADJ_DECKS_3_4_PLAYING:
- QMessageBox::warning(
- NULL, tr("Auto DJ"),
+ QMessageBox::warning(nullptr,
+ tr("Auto DJ"),
tr("Decks 3 and 4 must be stopped to enable Auto DJ mode."),
QMessageBox::Ok);
pushButtonAutoDJ->setChecked(false);
diff --git a/src/library/banshee/bansheefeature.cpp b/src/library/banshee/bansheefeature.cpp
index faed634666..182cee18f6 100644
--- a/src/library/banshee/bansheefeature.cpp
+++ b/src/library/banshee/bansheefeature.cpp
@@ -72,19 +72,19 @@ void BansheeFeature::activate() {
if (!QFile::exists(m_databaseFile)) {
QMessageBox::warning(
- NULL,
+ nullptr,
tr("Error loading Banshee database"),
tr("Banshee database file not found at\n") +
- m_databaseFile);
+ m_databaseFile);
qDebug() << m_databaseFile << "does not exist";
}
if (!m_connection.open(m_databaseFile)) {
QMessageBox::warning(
- NULL,
+ nullptr,
tr("Error loading Banshee database"),
tr("There was an error loading your Banshee database at\n") +
- m_databaseFile);
+ m_databaseFile);
return;
}
diff --git a/src/library/baseexternallibraryfeature.cpp b/src/library/baseexternallibraryfeature.cpp
index de0caabd5f..8f1ef33cd2 100644
--- a/src/library/baseexternallibraryfeature.cpp
+++ b/src/library/baseexternallibraryfeature.cpp
@@ -117,10 +117,9 @@ void BaseExternalLibraryFeature::slotImportAsMixxxPlaylist() {
} else {
// Do not change strings here without also changing strings in
// src/library/baseplaylistfeature.cpp
- QMessageBox::warning(NULL,
- tr("Playlist Creation Failed"),
- tr("An unknown error occurred while creating playlist: ")
- + playlist);
+ QMessageBox::warning(nullptr,
+ tr("Playlist Creation Failed"),
+ tr("An unknown error occurred while creating playlist: ") + playlist);
}
}
diff --git a/src/library/baseplaylistfeature.cpp b/src/library/baseplaylistfeature.cpp
index 317a8bacbc..f7e8d8fca0 100644
--- a/src/library/baseplaylistfeature.cpp
+++ b/src/library/baseplaylistfeature.cpp
@@ -193,7 +193,7 @@ void BasePlaylistFeature::slotRenamePlaylist() {
while (!validNameGiven) {
bool ok = false;
- newName = QInputDialog::getText(NULL,
+ newName = QInputDialog::getText(nullptr,
tr("Rename Playlist"),
tr("Enter new name for playlist:"),
QLineEdit::Normal,
@@ -207,11 +207,11 @@ void BasePlaylistFeature::slotRenamePlaylist() {
int existingId = m_playlistDao.getPlaylistIdFromName(newName);
if (existingId != -1) {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Renaming Playlist Failed"),
tr("A playlist by that name already exists."));
} else if (newName.isEmpty()) {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Renaming Playlist Failed"),
tr("A playlist cannot have a blank name."));
} else {
@@ -235,7 +235,7 @@ void BasePlaylistFeature::slotDuplicatePlaylist() {
while (!validNameGiven) {
bool ok = false;
- name = QInputDialog::getText(NULL,
+ name = QInputDialog::getText(nullptr,
tr("Duplicate Playlist"),
tr("Enter name for new playlist:"),
QLineEdit::Normal,
@@ -250,11 +250,11 @@ void BasePlaylistFeature::slotDuplicatePlaylist() {
int existingId = m_playlistDao.getPlaylistIdFromName(name);
if (existingId != -1) {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Playlist Creation Failed"),
tr("A playlist by that name already exists."));
} else if (name.isEmpty()) {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Playlist Creation Failed"),
tr("A playlist cannot have a blank name."));
} else {
@@ -288,7 +288,7 @@ void BasePlaylistFeature::slotCreatePlaylist() {
while (!validNameGiven) {
bool ok = false;
- name = QInputDialog::getText(NULL,
+ name = QInputDialog::getText(nullptr,
tr("Create New Playlist"),
tr("Enter name for new playlist:"),
QLineEdit::Normal,
@@ -302,11 +302,11 @@ void BasePlaylistFeature::slotCreatePlaylist() {
int existingId = m_playlistDao.getPlaylistIdFromName(name);
if (existingId != -1) {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Playlist Creation Failed"),
tr("A playlist by that name already exists."));
} else if (name.isEmpty()) {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Playlist Creation Failed"),
tr("A playlist cannot have a blank name."));
} else {
@@ -319,7 +319,7 @@ void BasePlaylistFeature::slotCreatePlaylist() {
if (playlistId != -1) {
activatePlaylist(playlistId);
} else {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Playlist Creation Failed"),
tr("An unknown error occurred while creating playlist: ") + name);
}
@@ -370,7 +370,7 @@ void BasePlaylistFeature::slotImportPlaylistFile(const QString& playlist_file) {
// folder. We don't need access to this file on a regular basis so we do not
// register a security bookmark.
- Parser* playlist_parser = NULL;
+ Parser* playlist_parser = nullptr;
if (playlist_file.endsWith(".m3u", Qt::CaseInsensitive) ||
playlist_file.endsWith(".m3u8", Qt::CaseInsensitive)) {
@@ -435,7 +435,7 @@ void BasePlaylistFeature::slotCreateImportPlaylist() {
if (lastPlaylistId != -1) {
m_pPlaylistTableModel->setTableModel(lastPlaylistId);
} else {
- QMessageBox::warning(NULL,
+ QMessageBox::warning(nullptr,
tr("Playlist Creation Failed"),
tr("An unknown error occurred while creating playlist: ") + name);
return;
@@ -463,7 +463,7 @@ void BasePlaylistFeature::slotExportPlaylist() {
// name to the playlist name.
QString filefilter = tr("M3U Playlist (*.m3u)");
QString file_location = QFileDialog::getSaveFileName(
- NULL,
+ nullptr,
tr("Export Playlist"),
lastPlaylistDirectory.append("/").append(playlistName),
tr("M3U Playlist (*.m3u);;M3U8 Playlist (*.m3u8);;"
diff --git a/src/library/bpmdelegate.cpp b/src/library/bpmdelegate.cpp
index 6c8b5d8eb5..695a17450a 100644
--- a/src/library/bpmdelegate.cpp
+++ b/src/library/bpmdelegate.cpp
@@ -79,9 +79,9 @@ void BPMDelegate::paintItem(QPainter* painter,const QStyleOptionViewItem &option
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
- if (m_pTableView != NULL) {
+ if (m_pTableView != nullptr) {
QStyle* style = m_pTableView->style();
- if (style != NULL) {
+ if (style != nullptr) {
style->drawControl(QStyle::CE_ItemViewItem, &opt, painter,
m_pCheckBox);
}
diff --git a/src/library/browse/browsetablemodel.cpp b/src/library/browse/browsetablemodel.cpp
index 6d1ac08f92..05acc20f94 100644
--- a/src/library/browse/browsetablemodel.cpp
+++ b/src/library/browse/browsetablemodel.cpp
@@ -196,10 +196,9 @@ TrackPointer BrowseTableModel::getTrack(const QModelIndex& index) const {
TrackPointer BrowseTableModel::getTrackByRef(const TrackRef& trackRef) const {
if (m_pRecordingManager->getRecordingLocation() == trackRef.getLocation()) {
QMessageBox::critical(
- 0, tr("Mixxx Library"),
- tr("Could not load the following file because"
- " it is in use by Mixxx or another application.")
- + "\n" + trackRef.getLocation());
+ nullptr, tr("Mixxx Library"), tr("Could not load the following file because"
+ " it is in use by Mixxx or another application.") +
+ "\n" + trackRef.getLocation());
return TrackPointer();
}
// NOTE(uklotzde, 2015-12-08): Accessing tracks from the browse view
diff --git a/src/library/browse/browsethread.cpp b/src/library/browse/browsethread.cpp
index eae977680b..75e3d27333 100644
--- a/src/library/browse/browsethread.cpp
+++ b/src/library/browse/browsethread.cpp
@@ -33,7 +33,7 @@ static QMutex s_Mutex;
BrowseThread::BrowseThread(QObject *parent)
: QThread(parent) {
m_bStopThread = false;
- m_model_observer = NULL;
+ m_model_observer = nullptr;
//start Thread
start(QThread::LowPriority);
diff --git a/src/library/browse/foldertreemodel.cpp b/src/library/browse/foldertreemodel.cpp
index a763136b48..e1d03d1fdd 100644
--- a/src/library/browse/foldertreemodel.cpp
+++ b/src/library/browse/foldertreemodel.cpp
@@ -93,9 +93,9 @@ bool FolderTreeModel::directoryHasChildren(const QString& path) const {
DIR *directory = opendir(ba);
int unknown_count = 0;
int total_count = 0;
- if (directory != NULL) {
+ if (directory != nullptr) {
struct dirent *entry;
- while (!has_children && ((entry = readdir(directory)) != NULL)) {
+ while (!has_children && ((entry = readdir(directory)) != nullptr)) {
if (entry->d_name != dot && entry->d_name != dotdot) {
total_count++;
if (entry->d_type == DT_UNKNOWN) {
@@ -110,7 +110,7 @@ bool FolderTreeModel::directoryHasChildren(const QString& path) const {
// If all files are of type DH_UNKNOWN then do a costlier analysis to
// determine if the directory has subdirectories. This affects folders on
// filesystems that do not fully implement readdir such as JFS.
- if (directory == NULL || (unknown_count == total_count && total_count > 0)) {
+ if (directory == nullptr || (unknown_count == total_count && total_count > 0)) {
QDir dir(path);
QFileInfoList all = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
has_children = all.count() > 0;
diff --git a/src/library/coverartutils.cpp b/src/library/coverartutils.cpp
index e70404b43d..7a750a4e42 100644
--- a/src/library/coverartutils.cpp
+++ b/src/library/coverartutils.cpp
@@ -93,7 +93,7 @@ CoverInfoRelative CoverArtUtils::selectCoverArtForTrack(
}
PreferredCoverType bestType = NONE;
- const QFileInfo* bestInfo = NULL;
+ const QFileInfo* bestInfo = nullptr;
// If there is a single image then we use it unconditionally. Otherwise
// we use the priority order described in PreferredCoverType. Notably,
@@ -143,7 +143,7 @@ CoverInfoRelative CoverArtUtils::selectCoverArtForTrack(
}
}
- if (bestInfo != NULL) {
+ if (bestInfo != nullptr) {
QImage image(bestInfo->filePath());
if (!image.isNull()) {
coverInfoRelative.type = CoverInfo::FILE;
diff --git a/src/library/crate/cratefeature.cpp b/src/library/crate/cratefeature.cpp
index d977f95f17..2d0de89876 100644
--- a/src/library/crate/cratefeature.cpp
+++ b/src/library/crate/cratefeature.cpp
@@ -686,11 +686,11 @@ void CrateFeature::slotExportPlaylist() {
ConfigKey("[Library]", "LastImportExportCrateDirectory"),
QStandardPaths::writableLocation(QStandardPaths::MusicLocation));
- QString file_location = QFileDialog::getSaveFileName(
- NULL,
- tr("Export Crate"),
- lastCrateDirectory.append("/").append(crate.getName()),
- tr("M3U Playlist (*.m3u);;M3U8 Playlist (*.m3u8);;PLS Playlist (*.pls);;Text CSV (*.csv);;Readable Text (*.txt)"));
+ QString file_location = QFileDialog::getSaveFileName(nullptr,
+ tr("Export Crate"),
+ lastCrateDirectory.append("/").append(crate.getName()),
+ tr("M3U Playlist (*.m3u);;M3U8 Playlist (*.m3u8);;PLS Playlist "
+ "(*.pls);;Text CSV (*.csv);;Readable Text (*.txt)"));
// Exit method if user cancelled the open dialog.
if (file_location.isNull() || file_location.isEmpty()) {
return;
diff --git a/src/library/dao/analysisdao.cpp b/src/library/dao/analysisdao.cpp
index ff7ca74783..1e8d2faa2d 100644
--- a/src/library/dao/analysisdao.cpp
+++ b/src/library/dao/analysisdao.cpp
@@ -103,7 +103,7 @@ QList<AnalysisDao::AnalysisInfo> AnalysisDao::loadAnalysesFromQuery(TrackId trac
}
bool AnalysisDao::saveAnalysis(AnalysisDao::AnalysisInfo* info) {
- if (!m_database.isOpen() || info == NULL) {
+ if (!m_database.isOpen() || info == nullptr) {
return false;
}
diff --git a/src/library/dao/autodjcratesdao.cpp b/src/library/dao/autodjcratesdao.cpp
index 02bacbca90..fd0a702eeb 100644
--- a/src/library/dao/autodjcratesdao.cpp
+++ b/src/library/dao/autodjcratesdao.cpp
@@ -1078,7 +1078,7 @@ void AutoDJCratesDAO::slotPlaylistTrackRemoved(int playlistId,
void AutoDJCratesDAO::slotPlayerInfoTrackLoaded(const QString& a_strGroup,
TrackPointer a_pTrack) {
// This gets called with a null track during an unload. Filter that out.
- if (a_pTrack == NULL) {
+ if (a_pTrack == nullptr) {
return;
}
diff --git a/src/library/export/trackexportdlg.cpp b/src/library/export/trackexportdlg.cpp
index d185e39043..d6c6c0335e 100644
--- a/src/library/export/trackexportdlg.cpp
+++ b/src/library/export/trackexportdlg.cpp
@@ -106,9 +106,11 @@ void TrackExportDlg::finish() {
m_worker->wait();
if (m_worker->errorMessage().length()) {
QMessageBox::warning(
- NULL,
- tr("Export Error"), m_worker->errorMessage(),
- QMessageBox::Ok, QMessageBox::Ok);
+ nullptr,
+ tr("Export Error"),
+ m_worker->errorMessage(),
+ QMessageBox::Ok,
+ QMessageBox::Ok);
}
hide();
accept();
diff --git a/src/library/export/trackexportwizard.cpp b/src/library/export/trackexportwizard.cpp
index 12aee6081a..932b865b3f 100644
--- a/src/library/export/trackexportwizard.cpp
+++ b/src/library/export/trackexportwizard.cpp
@@ -22,7 +22,7 @@ bool TrackExportWizard::selectDestinationDirectory() {
QStandardPaths::writableLocation(QStandardPaths::MusicLocation));
QString destDir = QFileDialog::getExistingDirectory(
- NULL, tr("Export Track Files To"), lastExportDirectory);
+ nullptr, tr("Export Track Files To"), lastExportDirectory);
if (destDir.isEmpty()) {
return false;
}
diff --git a/src/library/itunes/itunesfeature.cpp b/src/library/itunes/itunesfeature.cpp
index c0ae347120..df697bef00 100644
--- a/src/library/itunes/itunesfeature.cpp
+++ b/src/library/itunes/itunesfeature.cpp
@@ -194,7 +194,7 @@ void ITunesFeature::activate(bool forceReload) {
// if the path we got between the default and the database doesn't
// exist, ask for a new one and use/save it if it exists
m_dbfile = QFileDialog::getOpenFileName(
- NULL, tr("Select your iTunes library"), QDir::homePath(), "*.xml");
+ nullptr, tr("Select your iTunes library"), QDir::homePath(), "*.xml");
QFileInfo dbFile(m_dbfile);
if (m_dbfile.isEmpty() || !dbFile.exists()) {
return;
@@ -249,7 +249,7 @@ void ITunesFeature::onRightClick(const QPoint& globalPos) {
} else if (chosen == &chooseNew) {
SettingsDAO settings(m_database);
QString dbfile = QFileDialog::getOpenFileName(
- NULL, tr("Select your iTunes library"), QDir::homePath(), "*.xml");
+ nullptr, tr("Select your iTunes library"), QDir::homePath(), "*.xml");
QFileInfo dbFileInfo(dbfile);
if (dbfile.isEmpty() || !dbFileInfo.exists()) {
@@ -390,11 +390,11 @@ TreeItem* ITunesFeature::importLibrary() {
QFile itunes_file(m_dbfile);
if (!itunes_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "Cannot open iTunes music collection";
- return NULL;
+ return nullptr;
}
QXmlStreamReader xml(&itunes_file);
- TreeItem* playlist_root = NULL;
+ TreeItem* playlist_root = nullptr;
while (!xml.atEnd() && !m_cancelImport) {
xml.readNext();
if (xml.isStartElement()) {
@@ -409,7 +409,7 @@ TreeItem* ITunesFeature::importLibrary() {
}
} else if (key == "Tracks") {
parseTracks(xml);
- if (playlist_root != NULL) {
+ if (playlist_root != nullptr) {
delete playlist_root;
}
playlist_root = parsePlaylists(xml);
@@ -448,7 +448,7 @@ TreeItem* ITunesFeature::importLibrary() {
if (playlist_root) {
delete playlist_root;
}
- playlist_root = NULL;
+ playlist_root = nullptr;
}
return playlist_root;
}
@@ -823,10 +823,10 @@ void ITunesFeature::onTrackCollectionLoaded() {
qDebug() << "Itunes library loaded: success";
} else {
QMessageBox::warning(
- NULL,
- tr("Error Loading iTunes Library"),
- tr("There was an error loading your iTunes library. Some of "
- "your iTunes tracks or playlists may not have loaded."));
+ nullptr,
+ tr("Error Loading iTunes Library"),
+ tr("There was an error loading your iTunes library. Some of "
+ "your iTunes tracks or playlists may not have loaded."));
}
// calls a slot in the sidebarmodel such that 'isLoading' is removed from the feature title.
m_title = tr("iTunes");
diff --git a/src/library/library.cpp b/src/library/library.cpp
index e5f2c8ae8c..dec5cc5b3a 100644
--- a/src/library/library.cpp
+++ b/src/library/library.cpp
@@ -457,10 +457,11 @@ void Library::slotRequestAddDir(const QString& dir) {
Sandbox::createSecurityToken(directory);
if (!m_pTrackCollectionManager->addDirectory(dir)) {
- QMessageBox::information(0, tr("Add Directory to Library"),
+ QMessageBox::information(nullptr,
+ tr("Add Directory to Library"),
tr("Could not add the directory to your library. Either this "
- "directory is already in your library or you are currently "
- "rescanning your library."));
+ "directory is already in your library or you are currently "
+ "rescanning your library."));
}
// set at least one directory in the config file so that it will be possible
// to downgrade from 1.12
diff --git a/src/library/librarycontrol.cpp b/src/library/librarycontrol.cpp
index 5e85f351ef..3b73e36bbd 100644
--- a/src/library/librarycontrol.cpp
+++ b/src/library/librarycontrol.cpp
@@ -314,7 +314,7 @@ void LibraryControl::slotNumPreviewDecksChanged(double v) {
void LibraryControl::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) {
if (m_pSidebarWidget) {
- disconnect(m_pSidebarWidget, 0, this, 0);
+ disconnect(m_pSidebarWidget, nullptr, this, nullptr);
}
m_pSidebarWidget = pSidebarWidget;
connect(m_pSidebarWidget,
@@ -326,7 +326,7 @@ void LibraryControl::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) {
void LibraryControl::bindLibraryWidget(WLibrary* pLibraryWidget, KeyboardEventFilter* pKeyboard) {
Q_UNUSED(pKeyboard);
if (m_pLibraryWidget) {
- disconnect(m_pLibraryWidget, 0, this, 0);
+ disconnect(m_pLibraryWidget, nullptr, this, nullptr);
}
m_pLibraryWidget = pLibraryWidget;
connect(m_pLibraryWidget,
@@ -337,7 +337,7 @@ void LibraryControl::bindLibraryWidget(WLibrary* pLibraryWidget, KeyboardEventFi
void LibraryControl::bindSearchboxWidget(WSearchLineEdit* pSearchbox) {
if (m_pSearchbox) {
- disconnect(m_pSearchbox, 0, this, 0);
+ disconnect(m_pSearchbox, nullptr, this, nullptr);
}
m_pSearchbox = pSearchbox;
connect(this,
diff --git a/src/library/libraryfeature.cpp b/src/library/libraryfeature.cpp
index 137667a36f..20de2aa318 100644
--- a/src/library/libraryfeature.cpp
+++ b/src/library/libraryfeature.cpp
@@ -31,10 +31,10 @@ QStringList LibraryFeature::getPlaylistFiles(QFileDialog::FileMode mode) const {
ConfigKey("[Library]", "LastImportExportPlaylistDirectory"),
QStandardPaths::writableLocation(QStandardPaths::MusicLocation));
- QFileDialog dialog(NULL,
- tr("Import Playlist"),
- lastPlaylistDirectory,
- tr("Playlist Files (*.m3u *.m3u8 *.pls *.csv)"));
+ QFileDialog dialog(nullptr,
+ tr("Import Playlist"),
+ lastPlaylistDirectory,
+ tr("Playlist Files (*.m3u *.m3u8 *.pls *.csv)"));
dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setFileMode(mode);
dialog.setModal(true);
@@ -75,12 +75,12 @@ bool LibraryFeature::exportPlaylistItemsIntoFile(
playlistFilePath.append(QStringLiteral(".m3u"));
if (QFileInfo::exists(playlistFilePath)) {
auto overwrite = QMessageBox::question(
- NULL,
+ nullptr,
tr("Overwrite File?"),
tr("A playlist file with the name \"%1\" already exists.\n"
"The default \"m3u\" extension was added because none was specified.\n\n"
- "Do you really want to overwrite it?").arg(playlistFilePath)
- );
+ "Do you really want to overwrite it?")
+ .arg(playlistFilePath));
if (overwrite != QMessageBox::StandardButton::Yes) {
return false;
}
diff --git a/src/library/parsercsv.cpp b/src/library/parsercsv.cpp
index 10f39fff30..0970a80d78 100644
--- a/src/library/parsercsv.cpp
+++ b/src/library/parsercsv.cpp
@@ -129,8 +129,9 @@ bool ParserCsv::writeCSVFile(const QString &file_str, BaseSqlTableModel* pPlayli
QFile file(file_str);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QMessageBox::warning(NULL,tr("Playlist Export Failed"),
- tr("Could not create file")+" "+file_str);
+ QMessageBox::warning(nullptr,
+ tr("Playlist Export Failed"),
+ tr("Could not create file") + " " + file_str);
return false;
}
//Base folder of file
@@ -201,8 +202,9 @@ bool ParserCsv::writeReadableTextFile(const QString &file_str, BaseSqlTableModel
QFile file(file_str);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QMessageBox::warning(NULL,tr("Readable text Export Failed"),
- tr("Could not create file")+" "+file_str);
+ QMessageBox::warning(nullptr,
+ tr("Readable text Export Failed"),
+ tr("Could not create file") + " " + file_str);
return false;
}
diff --git a/src/library/parserm3u.cpp b/src/library/parserm3u.cpp
index cfab773c2b..fac4540a00 100644
--- a/src/library/parserm3u.cpp
+++ b/src/library/parserm3u.cpp
@@ -133,10 +133,12 @@ bool ParserM3u::writeM3UFile(const QString &file_str, const QList<QString> &item
for (int i = 0; i < items.size(); ++i) {
if (!codec->canEncode(items.at(i))) {
// filepath contains incompatible character
- QMessageBox::warning(NULL,tr("Playlist Export Failed"),
- tr("File path contains characters, not allowed in m3u playlists.\n") +
- tr("Export a m3u8 playlist instead!\n") +
- items.at(i));
+ QMessageBox::warning(nullptr,
+ tr("Playlist Export Failed"),
+ tr("File path contains characters, not allowed in m3u "
+ "playlists.\n") +
+ tr("Export a m3u8 playlist instead!\n") +
+ items.at(i));
return false;
}
}
@@ -144,8 +146,9 @@ bool ParserM3u::writeM3UFile(const QString &file_str, const QList<QString> &item
QFile file(file_str);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QMessageBox::warning(NULL,tr("Playlist Export Failed"),
- tr("Could not create file") + " " + file_str);
+ QMessageBox::warning(nullptr,
+ tr("Playlist Export Failed"),
+ tr("Could not create file") + " " + file_str);
return false;
}
diff --git a/src/library/parserpls.cpp b/src/library/parserpls.cpp
index d949b846d8..5e26bd2b50 100644
--- a/src/library/parserpls.cpp
+++ b/src/library/parserpls.cpp
@@ -132,8 +132,9 @@ bool ParserPls::writePLSFile(const QString &file_str, const QList<QString> &item
{
QFile file(file_str);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QMessageBox::warning(NULL,tr("Playlist Export Failed"),
- tr("Could not create file")+" "+file_str);
+ QMessageBox::warning(nullptr,
+ tr("Playlist Export Failed"),
+ tr("Could not create file") + " " + file_str);
return false;
}
//Base folder of file
diff --git a/src/library/proxytrackmodel.cpp b/src/library/proxytrackmodel.cpp
index edb2dca060..35181e8397 100644
--- a/src/library/proxytrackmodel.cpp
+++ b/src/library/proxytrackmodel.cpp
@@ -105,7 +105,7 @@ void ProxyTrackModel::moveTrack(const QModelIndex& sourceIndex,
}
QAbstractItemDelegate* ProxyTrackModel::delegateForColumn(const int i, QObject* pParent) {
- return m_pTrackModel ? m_pTrackModel->delegateForColumn(i, pParent) : NULL;
+ return m_pTrackModel ? m_pTrackModel->delegateForColumn(i, pParent) : nullptr;
}
TrackModel::CapabilitiesFlags ProxyTrackModel::getCapabilities() const {
@@ -122,7 +122,7 @@ bool ProxyTrackModel::filterAcceptsRow(int sourceRow,
return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent);
}
- if (m_pTrackModel == NULL) {
+ if (m_pTrackModel == nullptr) {
return false;
}
@@ -149,14 +149,14 @@ bool ProxyTrackModel::filterAcceptsRow(int sourceRow,
}
QString ProxyTrackModel::getModelSetting(const QString& name) {
- if (m_pTrackModel == NULL) {
+ if (m_pTrackModel == nullptr) {