diff --git a/src/core/appearance.h b/src/core/appearance.h index 7b44b83e3..e7fb36d0d 100644 --- a/src/core/appearance.h +++ b/src/core/appearance.h @@ -23,7 +23,7 @@ class Appearance : public QObject { public: - Appearance(QObject* parent = NULL); + Appearance(QObject* parent = nullptr); // Load the user preferred theme, which could the default system theme or a // custom set of colors that user has chosen void LoadUserTheme(); diff --git a/src/core/application.h b/src/core/application.h index c95543a9f..9eadafb66 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -53,7 +53,7 @@ class Application : public QObject { public: static bool kIsPortable; - Application(QObject* parent = NULL); + Application(QObject* parent = nullptr); ~Application(); const QString& language_name() const { return language_name_; } diff --git a/src/core/backgroundstreams.h b/src/core/backgroundstreams.h index d768569c5..6bd03bba9 100644 --- a/src/core/backgroundstreams.h +++ b/src/core/backgroundstreams.h @@ -39,7 +39,7 @@ signals: private: struct Stream { - Stream() : volume(0), id(0), action(NULL) {} + Stream() : volume(0), id(0), action(nullptr) {} QString name; QUrl url; diff --git a/src/core/commandlineoptions.h b/src/core/commandlineoptions.h index 95474a4c0..60bef1042 100644 --- a/src/core/commandlineoptions.h +++ b/src/core/commandlineoptions.h @@ -27,7 +27,7 @@ class CommandlineOptions { friend QDataStream& operator>>(QDataStream& s, CommandlineOptions& a); public: - CommandlineOptions(int argc = 0, char* *argv = NULL); + CommandlineOptions(int argc = 0, char* *argv = nullptr); static const char* kHelpText; static const char* kVersionText; diff --git a/src/core/mac_startup.mm b/src/core/mac_startup.mm index c1745326c..9d90ce941 100644 --- a/src/core/mac_startup.mm +++ b/src/core/mac_startup.mm @@ -97,7 +97,7 @@ static BreakpadRef InitBreakpad() { NSDictionary* plist = [[NSBundle mainBundle] infoDictionary]; if (plist) { breakpad = BreakpadCreate(plist); - BreakpadSetFilterCallback(breakpad, &BreakpadCallback, NULL); + BreakpadSetFilterCallback(breakpad, &BreakpadCallback, nullptr); } [pool release]; return breakpad; diff --git a/src/core/macfslistener.mm b/src/core/macfslistener.mm index 1c683b966..746109808 100644 --- a/src/core/macfslistener.mm +++ b/src/core/macfslistener.mm @@ -25,7 +25,7 @@ #include "core/scoped_nsobject.h" MacFSListener::MacFSListener(QObject* parent) - : FileSystemWatcherInterface(parent), run_loop_(NULL), stream_(NULL) { + : FileSystemWatcherInterface(parent), run_loop_(nullptr), stream_(nullptr) { update_timer_.setSingleShot(true); update_timer_.setInterval(2000); connect(&update_timer_, SIGNAL(timeout()), SLOT(UpdateStream())); @@ -73,7 +73,7 @@ void MacFSListener::UpdateStream() { FSEventStreamStop(stream_); FSEventStreamInvalidate(stream_); FSEventStreamRelease(stream_); - stream_ = NULL; + stream_ = nullptr; } if (paths_.empty()) { @@ -93,7 +93,7 @@ void MacFSListener::UpdateStream() { context.info = this; CFAbsoluteTime latency = 1.0; - stream_ = FSEventStreamCreate(NULL, &EventStreamCallback, &context, // Copied + stream_ = FSEventStreamCreate(nullptr, &EventStreamCallback, &context, // Copied reinterpret_cast(array.get()), kFSEventStreamEventIdSinceNow, latency, kFSEventStreamCreateFlagNone); diff --git a/src/core/multisortfilterproxy.h b/src/core/multisortfilterproxy.h index 9bc98107a..b8c4fd314 100644 --- a/src/core/multisortfilterproxy.h +++ b/src/core/multisortfilterproxy.h @@ -5,7 +5,7 @@ class MultiSortFilterProxy : public QSortFilterProxyModel { public: - MultiSortFilterProxy(QObject* parent = NULL); + MultiSortFilterProxy(QObject* parent = nullptr); void AddSortSpec(int role, Qt::SortOrder order = Qt::AscendingOrder); diff --git a/src/core/organiseformat.h b/src/core/organiseformat.h index 29a775bed..04c3b8f35 100644 --- a/src/core/organiseformat.h +++ b/src/core/organiseformat.h @@ -69,7 +69,7 @@ class OrganiseFormat { private: QString ParseBlock(QString block, const Song& song, - bool* any_empty = NULL) const; + bool* any_empty = nullptr) const; QString TagValue(const QString& tag, const Song& song) const; QString format_; diff --git a/src/core/potranslator.h b/src/core/potranslator.h index e6077173b..de6dc9085 100644 --- a/src/core/potranslator.h +++ b/src/core/potranslator.h @@ -30,7 +30,7 @@ class PoTranslator : public QTranslator { const char* disambiguation = 0) const { QString ret = QTranslator::translate(context, source_text, disambiguation); if (!ret.isEmpty()) return ret; - return QTranslator::translate(NULL, source_text, disambiguation); + return QTranslator::translate(nullptr, source_text, disambiguation); } }; diff --git a/src/core/scoped_cftyperef.h b/src/core/scoped_cftyperef.h index 57d817d5f..a526103c2 100644 --- a/src/core/scoped_cftyperef.h +++ b/src/core/scoped_cftyperef.h @@ -22,13 +22,13 @@ class ScopedCFTypeRef { public: typedef CFT element_type; - explicit ScopedCFTypeRef(CFT object = NULL) : object_(object) {} + explicit ScopedCFTypeRef(CFT object = nullptr) : object_(object) {} ~ScopedCFTypeRef() { if (object_) CFRelease(object_); } - void reset(CFT object = NULL) { + void reset(CFT object = nullptr) { if (object_) CFRelease(object_); object_ = object; } @@ -52,7 +52,7 @@ class ScopedCFTypeRef { // CFRelease(), use ScopedCFTypeRef<>::reset(). CFT release() __attribute__((warn_unused_result)) { CFT temp = object_; - object_ = NULL; + object_ = nullptr; return temp; } diff --git a/src/core/scopedgobject.h b/src/core/scopedgobject.h index 1fcad5573..c75178de4 100644 --- a/src/core/scopedgobject.h +++ b/src/core/scopedgobject.h @@ -25,9 +25,9 @@ template class ScopedGObject { public: - ScopedGObject() : object_(NULL) {} + ScopedGObject() : object_(nullptr) {} - explicit ScopedGObject(const ScopedGObject& other) : object_(NULL) { + explicit ScopedGObject(const ScopedGObject& other) : object_(nullptr) { reset(other.object_); } @@ -38,12 +38,12 @@ class ScopedGObject { return *this; } - void reset(T* new_object = NULL) { + void reset(T* new_object = nullptr) { if (new_object) g_object_ref(new_object); reset_without_add(new_object); } - void reset_without_add(T* new_object = NULL) { + void reset_without_add(T* new_object = nullptr) { if (object_) g_object_unref(object_); object_ = new_object; diff --git a/src/core/simpletreeitem.h b/src/core/simpletreeitem.h index c6ac66135..02eceb4ab 100644 --- a/src/core/simpletreeitem.h +++ b/src/core/simpletreeitem.h @@ -27,8 +27,8 @@ template class SimpleTreeItem { public: SimpleTreeItem(int _type, SimpleTreeModel* _model); // For the root item - SimpleTreeItem(int _type, const QString& _key, T* _parent = NULL); - SimpleTreeItem(int _type, T* _parent = NULL); + SimpleTreeItem(int _type, const QString& _key, T* _parent = nullptr); + SimpleTreeItem(int _type, T* _parent = nullptr); virtual ~SimpleTreeItem(); void InsertNotify(T* _parent); @@ -64,8 +64,8 @@ SimpleTreeItem::SimpleTreeItem(int _type, SimpleTreeModel* _model) : type(_type), row(0), lazy_loaded(true), - parent(NULL), - child_model(NULL), + parent(nullptr), + child_model(nullptr), model(_model) {} template @@ -74,8 +74,8 @@ SimpleTreeItem::SimpleTreeItem(int _type, const QString& _key, T* _parent) key(_key), lazy_loaded(false), parent(_parent), - child_model(NULL), - model(_parent ? _parent->model : NULL) { + child_model(nullptr), + model(_parent ? _parent->model : nullptr) { if (parent) { row = parent->children.count(); parent->children << static_cast(this); @@ -87,8 +87,8 @@ SimpleTreeItem::SimpleTreeItem(int _type, T* _parent) : type(_type), lazy_loaded(false), parent(_parent), - child_model(NULL), - model(_parent ? _parent->model : NULL) { + child_model(nullptr), + model(_parent ? _parent->model : nullptr) { if (parent) { row = parent->children.count(); parent->children << static_cast(this); @@ -151,7 +151,7 @@ T* SimpleTreeItem::ChildByKey(const QString& key) const { for (T* child : children) { if (child->key == key) return child; } - return NULL; + return nullptr; } #endif // SIMPLETREEITEM_H diff --git a/src/core/song.h b/src/core/song.h index 7d298b416..46e50b04e 100644 --- a/src/core/song.h +++ b/src/core/song.h @@ -130,7 +130,7 @@ class Song { // but you want to keep user stats. void MergeUserSetData(const Song& other); - static QString Decode(const QString& tag, const QTextCodec* codec = NULL); + static QString Decode(const QString& tag, const QTextCodec* codec = nullptr); // Save void BindToQuery(QSqlQuery* query) const; diff --git a/src/core/ubuntuunityhack.h b/src/core/ubuntuunityhack.h index 324f96731..c09e96304 100644 --- a/src/core/ubuntuunityhack.h +++ b/src/core/ubuntuunityhack.h @@ -25,7 +25,7 @@ class QProcess; class UbuntuUnityHack : public QObject { Q_OBJECT public: - UbuntuUnityHack(QObject* parent = NULL); + UbuntuUnityHack(QObject* parent = nullptr); private slots: void GetFinished(int exit_code); diff --git a/src/covers/amazoncoverprovider.h b/src/covers/amazoncoverprovider.h index 73fa94691..fd77073ee 100644 --- a/src/covers/amazoncoverprovider.h +++ b/src/covers/amazoncoverprovider.h @@ -28,7 +28,7 @@ class AmazonCoverProvider : public CoverProvider { Q_OBJECT public: - AmazonCoverProvider(QObject* parent = NULL); + AmazonCoverProvider(QObject* parent = nullptr); static const char* kAccessKeyB64; static const char* kSecretAccessKeyB64; diff --git a/src/covers/coverproviders.h b/src/covers/coverproviders.h index f56ea3b80..308e28a83 100644 --- a/src/covers/coverproviders.h +++ b/src/covers/coverproviders.h @@ -32,7 +32,7 @@ class CoverProviders : public QObject { Q_OBJECT public: - CoverProviders(QObject* parent = NULL); + CoverProviders(QObject* parent = nullptr); // Lets a cover provider register itself in the repository. void AddProvider(CoverProvider* provider); diff --git a/src/covers/discogscoverprovider.h b/src/covers/discogscoverprovider.h index cae51b0ce..98a53bbc9 100644 --- a/src/covers/discogscoverprovider.h +++ b/src/covers/discogscoverprovider.h @@ -45,7 +45,7 @@ class DiscogsCoverProvider : public CoverProvider { Q_OBJECT public: - DiscogsCoverProvider(QObject* parent = NULL); + DiscogsCoverProvider(QObject* parent = nullptr); static const char* kSearchUrl; diff --git a/src/devices/devicemanager.h b/src/devices/devicemanager.h index 64ec0edf1..439031333 100644 --- a/src/devices/devicemanager.h +++ b/src/devices/devicemanager.h @@ -127,10 +127,10 @@ signals: // Sometimes the same device is discovered more than once. In this case // the device will have multiple "backends". struct Backend { - Backend(DeviceLister* lister = NULL, const QString& id = QString()) + Backend(DeviceLister* lister = nullptr, const QString& id = QString()) : lister_(lister), unique_id_(id) {} - DeviceLister* lister_; // NULL if not physically connected + DeviceLister* lister_; // nullptr if not physically connected QString unique_id_; }; @@ -146,7 +146,7 @@ signals: int database_id_; // -1 if not remembered in the database std::shared_ptr - device_; // NULL if not connected to clementine + device_; // nullptr if not connected to clementine QList backends_; QString friendly_name_; diff --git a/src/devices/macdevicelister.mm b/src/devices/macdevicelister.mm index d99c092d5..e4d8934a8 100644 --- a/src/devices/macdevicelister.mm +++ b/src/devices/macdevicelister.mm @@ -110,7 +110,7 @@ void MacDeviceLister::Init() { // Populate MTP Device list. if (sMTPDeviceList.empty()) { - LIBMTP_device_entry_t* devices = NULL; + LIBMTP_device_entry_t* devices = nullptr; int num = 0; if (LIBMTP_Get_Supported_Devices_List(&devices, &num) != 0) { qLog(Warning) << "Failed to get MTP device list"; @@ -144,7 +144,7 @@ void MacDeviceLister::Init() { DARegisterDiskAppearedCallback( loop_session_, kDADiskDescriptionMatchVolumeMountable, &DiskAddedCallback, reinterpret_cast(this)); - DARegisterDiskDisappearedCallback(loop_session_, NULL, &DiskRemovedCallback, + DARegisterDiskDisappearedCallback(loop_session_, nullptr, &DiskRemovedCallback, reinterpret_cast(this)); DASessionScheduleWithRunLoop(loop_session_, run_loop_, kCFRunLoopDefaultMode); @@ -213,7 +213,7 @@ CFTypeRef GetUSBRegistryEntry(io_object_t device, CFStringRef key) { } IOObjectRelease(it); - return NULL; + return nullptr; } QString GetUSBRegistryEntryString(io_object_t device, CFStringRef key) { @@ -520,7 +520,7 @@ void MacDeviceLister::USBDeviceAddedCallback(void* refcon, io_iterator_t it) { continue; } - IOCFPlugInInterface** plugin_interface = NULL; + IOCFPlugInInterface** plugin_interface = nullptr; SInt32 score; kern_return_t err = IOCreatePlugInInterfaceForService( object, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, @@ -529,7 +529,7 @@ void MacDeviceLister::USBDeviceAddedCallback(void* refcon, io_iterator_t it) { continue; } - IOUSBDeviceInterface** dev = NULL; + IOUSBDeviceInterface** dev = nullptr; HRESULT result = (*plugin_interface)->QueryInterface( plugin_interface, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVOID*)&dev); diff --git a/src/globalsearch/searchprovider.h b/src/globalsearch/searchprovider.h index 6c8460efe..81d65d9e4 100644 --- a/src/globalsearch/searchprovider.h +++ b/src/globalsearch/searchprovider.h @@ -142,9 +142,9 @@ class SearchProvider : public QObject { // be reimplemented virtual bool IsLoggedIn() { return true; } virtual void ShowConfig() {} // Remember to set the CanShowConfig hint - // Returns the Internet service in charge of this provider, or NULL if there + // Returns the Internet service in charge of this provider, or nullptr if there // is none - virtual InternetService* internet_service() { return NULL; } + virtual InternetService* internet_service() { return nullptr; } static QImage ScaleAndPad(const QImage& image); diff --git a/src/internet/digitallyimportedservicebase.h b/src/internet/digitallyimportedservicebase.h index 5471c780e..31a8faace 100644 --- a/src/internet/digitallyimportedservicebase.h +++ b/src/internet/digitallyimportedservicebase.h @@ -38,7 +38,7 @@ class DigitallyImportedServiceBase : public InternetService { const QUrl& homepage_url, const QIcon& icon, const QString& api_service_name, Application* app, InternetModel* model, - QObject* parent = NULL); + QObject* parent = nullptr); ~DigitallyImportedServiceBase(); static const char* kSettingsGroup; @@ -111,24 +111,24 @@ signals: class DigitallyImportedService : public DigitallyImportedServiceBase { public: DigitallyImportedService(Application* app, InternetModel* model, - QObject* parent = NULL); + QObject* parent = nullptr); }; class SkyFmService : public DigitallyImportedServiceBase { public: - SkyFmService(Application* app, InternetModel* model, QObject* parent = NULL); + SkyFmService(Application* app, InternetModel* model, QObject* parent = nullptr); }; class JazzRadioService : public DigitallyImportedServiceBase { public: JazzRadioService(Application* app, InternetModel* model, - QObject* parent = NULL); + QObject* parent = nullptr); }; class RockRadioService : public DigitallyImportedServiceBase { public: RockRadioService(Application* app, InternetModel* model, - QObject* parent = NULL); + QObject* parent = nullptr); }; #endif // DIGITALLYIMPORTEDSERVICEBASE_H diff --git a/src/internet/groovesharkservice.h b/src/internet/groovesharkservice.h index 9141c09cc..d2e0c60cb 100644 --- a/src/internet/groovesharkservice.h +++ b/src/internet/groovesharkservice.h @@ -139,7 +139,7 @@ signals: protected: struct PlaylistInfo { PlaylistInfo() {} - PlaylistInfo(int id, QString name, QStandardItem* item = NULL) + PlaylistInfo(int id, QString name, QStandardItem* item = nullptr) : id_(id), name_(name), item_(item) {} bool operator<(const PlaylistInfo other) const { diff --git a/src/internet/icecastitem.h b/src/internet/icecastitem.h index 60d6c6dea..d1178d002 100644 --- a/src/internet/icecastitem.h +++ b/src/internet/icecastitem.h @@ -27,7 +27,7 @@ class IcecastItem : public SimpleTreeItem { IcecastItem(SimpleTreeModel* model) : SimpleTreeItem(Type_Root, model) {} - IcecastItem(Type type, IcecastItem* parent = NULL) + IcecastItem(Type type, IcecastItem* parent = nullptr) : SimpleTreeItem(type, parent) {} IcecastBackend::Station station; diff --git a/src/internet/internetservice.h b/src/internet/internetservice.h index 3aeb355b2..abcadc024 100644 --- a/src/internet/internetservice.h +++ b/src/internet/internetservice.h @@ -40,7 +40,7 @@ class InternetService : public QObject { // Constructs a new internet service with the given name and model. The name // should be user-friendly (like 'DigitallyImported' or 'Last.fm'). InternetService(const QString& name, Application* app, InternetModel* model, - QObject* parent = NULL); + QObject* parent = nullptr); virtual ~InternetService() {} QString name() const { return name_; } @@ -67,7 +67,7 @@ class InternetService : public QObject { return QList(); } - virtual QWidget* HeaderWidget() const { return NULL; } + virtual QWidget* HeaderWidget() const { return nullptr; } virtual void ReloadSettings() {} diff --git a/src/internet/lastfmcompat.h b/src/internet/lastfmcompat.h index 007dd2e06..cdd149be4 100644 --- a/src/internet/lastfmcompat.h +++ b/src/internet/lastfmcompat.h @@ -45,7 +45,7 @@ namespace compat { lastfm::XmlQuery EmptyXmlQuery(); bool ParseQuery(const QByteArray& data, lastfm::XmlQuery* query, - bool* connection_problems = NULL); + bool* connection_problems = nullptr); bool ParseUserList(QNetworkReply* reply, QList* users); diff --git a/src/library/libraryitem.h b/src/library/libraryitem.h index e9363b36e..9461d83eb 100644 --- a/src/library/libraryitem.h +++ b/src/library/libraryitem.h @@ -39,12 +39,12 @@ class LibraryItem : public SimpleTreeItem { LibraryItem(SimpleTreeModel* model) : SimpleTreeItem(Type_Root, model), container_level(-1), - compilation_artist_node_(NULL) {} + compilation_artist_node_(nullptr) {} - LibraryItem(Type type, LibraryItem* parent = NULL) + LibraryItem(Type type, LibraryItem* parent = nullptr) : SimpleTreeItem(type, parent), container_level(-1), - compilation_artist_node_(NULL) {} + compilation_artist_node_(nullptr) {} int container_level; Song metadata; diff --git a/src/musicbrainz/chromaprinter.h b/src/musicbrainz/chromaprinter.h index 93b22e515..7174cfc0f 100644 --- a/src/musicbrainz/chromaprinter.h +++ b/src/musicbrainz/chromaprinter.h @@ -46,7 +46,7 @@ class Chromaprinter { private: GstElement* CreateElement(const QString& factory_name, - GstElement* bin = NULL); + GstElement* bin = nullptr); void ReportError(GstMessage* message); diff --git a/src/playlist/playlistlistview.h b/src/playlist/playlistlistview.h index d4e5fba3e..e5ac1c33a 100644 --- a/src/playlist/playlistlistview.h +++ b/src/playlist/playlistlistview.h @@ -21,7 +21,7 @@ class PlaylistListView : public AutoExpandingTreeView { Q_OBJECT public: - PlaylistListView(QWidget* parent = NULL); + PlaylistListView(QWidget* parent = nullptr); ~PlaylistListView() {} protected: diff --git a/src/playlist/playlistmanager.h b/src/playlist/playlistmanager.h index a3eeeace0..6e82ede99 100644 --- a/src/playlist/playlistmanager.h +++ b/src/playlist/playlistmanager.h @@ -240,7 +240,7 @@ class PlaylistManager : public PlaylistManagerInterface { private: struct Data { - Data(Playlist* _p = NULL, const QString& _name = QString()) + Data(Playlist* _p = nullptr, const QString& _name = QString()) : p(_p), name(_name) {} Playlist* p; QString name; diff --git a/src/playlist/songmimedata.h b/src/playlist/songmimedata.h index 065b00fa6..182709bd6 100644 --- a/src/playlist/songmimedata.h +++ b/src/playlist/songmimedata.h @@ -29,7 +29,7 @@ class SongMimeData : public MimeData { Q_OBJECT public: - SongMimeData() : backend(NULL) {} + SongMimeData() : backend(nullptr) {} LibraryBackendInterface* backend; SongList songs; diff --git a/src/playlistparsers/playlistparser.h b/src/playlistparsers/playlistparser.h index 6e42c7210..455afb087 100644 --- a/src/playlistparsers/playlistparser.h +++ b/src/playlistparsers/playlistparser.h @@ -52,7 +52,7 @@ class PlaylistParser : public QObject { private: QString FilterForParser(const ParserBase* parser, - QStringList* all_extensions = NULL) const; + QStringList* all_extensions = nullptr) const; private: QList parsers_; diff --git a/src/smartplaylists/searchpreview.cpp b/src/smartplaylists/searchpreview.cpp index c6d195495..7f29b09d7 100644 --- a/src/smartplaylists/searchpreview.cpp +++ b/src/smartplaylists/searchpreview.cpp @@ -55,7 +55,7 @@ void SearchPreview::set_application(Application* app) { void SearchPreview::set_library(LibraryBackend* backend) { backend_ = backend; - model_ = new Playlist(nullptr, NULL, backend_, -1, QString(), false, this); + model_ = new Playlist(nullptr, nullptr, backend_, -1, QString(), false, this); ui_->tree->setModel(model_); ui_->tree->SetPlaylist(model_); ui_->tree->SetItemDelegates(backend_); diff --git a/src/transcoder/transcoder.h b/src/transcoder/transcoder.h index 3e4f91a14..61d45f2b8 100644 --- a/src/transcoder/transcoder.h +++ b/src/transcoder/transcoder.h @@ -89,8 +89,8 @@ signals: JobState(const Job& job, Transcoder* parent) : job_(job), parent_(parent), - pipeline_(NULL), - convert_element_(NULL), + pipeline_(nullptr), + convert_element_(nullptr), bus_callback_id_(0) {} ~JobState(); @@ -125,11 +125,11 @@ signals: StartJobStatus MaybeStartNextJob(); bool StartJob(const Job& job); - GstElement* CreateElement(const QString& factory_name, GstElement* bin = NULL, + GstElement* CreateElement(const QString& factory_name, GstElement* bin = nullptr, const QString& name = QString()); GstElement* CreateElementForMimeType(const QString& element_type, const QString& mime_type, - GstElement* bin = NULL); + GstElement* bin = nullptr); void SetElementProperties(const QString& name, GObject* element); static void NewPadCallback(GstElement*, GstPad* pad, gboolean, gpointer data); diff --git a/src/ui/albumcoversearcher.h b/src/ui/albumcoversearcher.h index b460639f4..2c58d792f 100644 --- a/src/ui/albumcoversearcher.h +++ b/src/ui/albumcoversearcher.h @@ -43,7 +43,7 @@ class SizeOverlayDelegate : public QStyledItemDelegate { static const int kBorderAlpha; static const int kBackgroundAlpha; - SizeOverlayDelegate(QObject* parent = NULL); + SizeOverlayDelegate(QObject* parent = nullptr); void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const; diff --git a/src/ui/edittagdialog.h b/src/ui/edittagdialog.h index 6f03f903b..522887f29 100644 --- a/src/ui/edittagdialog.h +++ b/src/ui/edittagdialog.h @@ -108,7 +108,7 @@ signals: }; struct FieldData { - FieldData(QLabel* label = NULL, QWidget* editor = NULL, + FieldData(QLabel* label = nullptr, QWidget* editor = nullptr, const QString& id = QString()) : label_(label), editor_(editor), id_(id) {} diff --git a/src/ui/macsystemtrayicon.mm b/src/ui/macsystemtrayicon.mm index 5ff661ab1..f789ec458 100644 --- a/src/ui/macsystemtrayicon.mm +++ b/src/ui/macsystemtrayicon.mm @@ -65,16 +65,16 @@ class MacSystemTrayIconPrivate { NSString* t = [[NSString alloc] initWithUTF8String:title.toUtf8().constData()]; now_playing_ = - [[NSMenuItem alloc] initWithTitle:t action:NULL keyEquivalent:@""]; + [[NSMenuItem alloc] initWithTitle:t action:nullptr keyEquivalent:@""]; now_playing_artist_ = [[NSMenuItem alloc] initWithTitle:@"Nothing to see here" - action:NULL + action:nullptr keyEquivalent:@""]; now_playing_title_ = [[NSMenuItem alloc] initWithTitle:@"Nothing to see here" - action:NULL + action:nullptr keyEquivalent:@""]; [dock_menu_ insertItem:now_playing_title_ atIndex:0]; diff --git a/src/ui/settingsdialog.h b/src/ui/settingsdialog.h index 32c2f9dc2..38f15e4aa 100644 --- a/src/ui/settingsdialog.h +++ b/src/ui/settingsdialog.h @@ -129,7 +129,7 @@ signals: }; QTreeWidgetItem* AddCategory(const QString& name); - void AddPage(Page id, SettingsPage* page, QTreeWidgetItem* parent = NULL); + void AddPage(Page id, SettingsPage* page, QTreeWidgetItem* parent = nullptr); void Save(); diff --git a/src/ui/systemtrayicon.h b/src/ui/systemtrayicon.h index cdeac88d0..614001434 100644 --- a/src/ui/systemtrayicon.h +++ b/src/ui/systemtrayicon.h @@ -42,7 +42,7 @@ class SystemTrayIcon : public QObject { virtual void ShowPopup(const QString& summary, const QString& message, int timeout) {} /** - * If this get's invoked with image_path equal to NULL, the tooltip should + * If this get's invoked with image_path equal to nullptr, the tooltip should * still be shown - just without the cover art. */ virtual void SetNowPlaying(const Song& song, const QString& image_path) {} diff --git a/src/ui/windows7thumbbar.h b/src/ui/windows7thumbbar.h index 731a87c67..48973dd98 100644 --- a/src/ui/windows7thumbbar.h +++ b/src/ui/windows7thumbbar.h @@ -37,7 +37,7 @@ class Windows7ThumbBar : public QObject { static const int kMaxButtonCount; // You must call this in the parent widget's constructor before returning - // to the event loop. If an action is NULL it becomes a spacer. + // to the event loop. If an action is nullptr it becomes a spacer. void SetActions(const QList& actions); // Call this from the parent's winEvent() function. diff --git a/tests/albumcoverfetcher_test.cpp b/tests/albumcoverfetcher_test.cpp index bfb104c38..a1a052c05 100644 --- a/tests/albumcoverfetcher_test.cpp +++ b/tests/albumcoverfetcher_test.cpp @@ -40,7 +40,7 @@ class AlbumCoverFetcherTest : public ::testing::Test { } void SetUp() { - network_ = new NetworkAccessManager(NULL, mock_network_); + network_ = new NetworkAccessManager(nullptr, mock_network_); } void TearDown() { @@ -71,7 +71,7 @@ TEST_F(AlbumCoverFetcherTest, FetchesAlbumCover) { params.clear(); MockNetworkReply* album_reply = mock_network_->ExpectGet("http://example.com/image.jpg", params, 200, ""); - AlbumCoverFetcher fetcher(network_, NULL); + AlbumCoverFetcher fetcher(network_, nullptr); QSignalSpy spy(&fetcher, SIGNAL(AlbumCoverFetched(quint64, const QImage&))); ASSERT_TRUE(spy.isValid()); fetcher.FetchAlbumCover("Foo", "Bar"); diff --git a/tests/albumcovermanager_test.cpp b/tests/albumcovermanager_test.cpp index 2315c7866..8c0b3fa02 100644 --- a/tests/albumcovermanager_test.cpp +++ b/tests/albumcovermanager_test.cpp @@ -27,7 +27,7 @@ class AlbumCoverManagerTest : public ::testing::Test { protected: AlbumCoverManagerTest() - : manager_(NULL, &cover_providers_, NULL, &mock_network_) { + : manager_(nullptr, &cover_providers_, nullptr, &mock_network_) { } MockNetworkAccessManager mock_network_; diff --git a/tests/asxiniparser_test.cpp b/tests/asxiniparser_test.cpp index 4702bea9b..035969860 100644 --- a/tests/asxiniparser_test.cpp +++ b/tests/asxiniparser_test.cpp @@ -27,7 +27,7 @@ class AsxIniParserTest : public ::testing::Test { protected: - AsxIniParserTest() : parser_(NULL) {} + AsxIniParserTest() : parser_(nullptr) {} AsxIniParser parser_; }; diff --git a/tests/asxparser_test.cpp b/tests/asxparser_test.cpp index bf14bd453..adba1833a 100644 --- a/tests/asxparser_test.cpp +++ b/tests/asxparser_test.cpp @@ -41,7 +41,7 @@ TEST_F(ASXParserTest, ParsesOneTrackFromXML) { ""; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - ASXParser parser(NULL); + ASXParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(1, songs.length()); const Song& song = songs[0]; @@ -63,7 +63,7 @@ TEST_F(ASXParserTest, ParsesMoreThanOneTrackFromXML) { ""; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - ASXParser parser(NULL); + ASXParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(2, songs.length()); EXPECT_EQ(QUrl("http://example.com/foo.mp3"), songs[0].url()); @@ -89,7 +89,7 @@ TEST_F(ASXParserTest, ParsesBrokenXmlEntities) { QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - ASXParser parser(NULL); + ASXParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(1, songs.length()); EXPECT_EQ(QUrl("mms://72.26.204.105/classictrance128k?user=h&pass=xxxxxxxxxxxxxxx"), songs[0].url()); @@ -99,7 +99,7 @@ TEST_F(ASXParserTest, SavesSong) { QByteArray data; QBuffer buffer(&data); buffer.open(QIODevice::WriteOnly); - ASXParser parser(NULL); + ASXParser parser(nullptr); Song one; one.set_url(QUrl("http://www.example.com/foo.mp3")); one.set_filetype(Song::Type_Stream); @@ -119,7 +119,7 @@ TEST_F(ASXParserTest, ParsesSomaFM) { QFile somafm(":/testdata/secretagent.asx"); somafm.open(QIODevice::ReadOnly); - ASXParser parser(NULL); + ASXParser parser(nullptr); SongList songs = parser.Load(&somafm); ASSERT_EQ(4, songs.count()); diff --git a/tests/cueparser_test.cpp b/tests/cueparser_test.cpp index 25db6daed..28257174c 100644 --- a/tests/cueparser_test.cpp +++ b/tests/cueparser_test.cpp @@ -28,7 +28,7 @@ class CueParserTest : public ::testing::Test { protected: CueParserTest() - : parser_(NULL) { + : parser_(nullptr) { } // We believe CUE - all songs with proper CUE entries should be valid. diff --git a/tests/database_test.cpp b/tests/database_test.cpp index e0235f64c..0e726dcf7 100644 --- a/tests/database_test.cpp +++ b/tests/database_test.cpp @@ -54,8 +54,8 @@ TEST_F(DatabaseTest, DatabaseInitialises) { } TEST_F(DatabaseTest, FTSOpenParsesSimpleInput) { - sqlite3_tokenizer_cursor* cursor = NULL; - Database::FTSOpen(NULL, "foo", 3, &cursor); + sqlite3_tokenizer_cursor* cursor = nullptr; + Database::FTSOpen(nullptr, "foo", 3, &cursor); ASSERT_TRUE(cursor); Database::UnicodeTokenizerCursor* real_cursor = reinterpret_cast(cursor); QList tokens = real_cursor->tokens; @@ -69,8 +69,8 @@ TEST_F(DatabaseTest, FTSOpenParsesSimpleInput) { } TEST_F(DatabaseTest, FTSOpenParsesUTF8Input) { - sqlite3_tokenizer_cursor* cursor = NULL; - Database::FTSOpen(NULL, "Röyksopp", 9, &cursor); + sqlite3_tokenizer_cursor* cursor = nullptr; + Database::FTSOpen(nullptr, "Röyksopp", 9, &cursor); ASSERT_TRUE(cursor); Database::UnicodeTokenizerCursor* real_cursor = reinterpret_cast(cursor); QList tokens = real_cursor->tokens; @@ -84,8 +84,8 @@ TEST_F(DatabaseTest, FTSOpenParsesUTF8Input) { } TEST_F(DatabaseTest, FTSOpenParsesMultipleTokens) { - sqlite3_tokenizer_cursor* cursor = NULL; - Database::FTSOpen(NULL, "Röyksopp foo", 13, &cursor); + sqlite3_tokenizer_cursor* cursor = nullptr; + Database::FTSOpen(nullptr, "Röyksopp foo", 13, &cursor); ASSERT_TRUE(cursor); Database::UnicodeTokenizerCursor* real_cursor = reinterpret_cast(cursor); QList tokens = real_cursor->tokens; @@ -103,9 +103,9 @@ TEST_F(DatabaseTest, FTSOpenParsesMultipleTokens) { } TEST_F(DatabaseTest, FTSOpenLeavesCyrillicQueries) { - sqlite3_tokenizer_cursor* cursor = NULL; + sqlite3_tokenizer_cursor* cursor = nullptr; const char* query = "Снег"; - Database::FTSOpen(NULL, query, strlen(query), &cursor); + Database::FTSOpen(nullptr, query, strlen(query), &cursor); ASSERT_TRUE(cursor); Database::UnicodeTokenizerCursor* real_cursor = reinterpret_cast(cursor); QList tokens = real_cursor->tokens; @@ -119,8 +119,8 @@ TEST_F(DatabaseTest, FTSOpenLeavesCyrillicQueries) { } TEST_F(DatabaseTest, FTSCursorWorks) { - sqlite3_tokenizer_cursor* cursor = NULL; - Database::FTSOpen(NULL, "Röyksopp foo", 13, &cursor); + sqlite3_tokenizer_cursor* cursor = nullptr; + Database::FTSOpen(nullptr, "Röyksopp foo", 13, &cursor); ASSERT_TRUE(cursor); Database::UnicodeTokenizerCursor* real_cursor = reinterpret_cast(cursor); diff --git a/tests/fileformats_test.cpp b/tests/fileformats_test.cpp index 209ce94b6..caa0166c7 100644 --- a/tests/fileformats_test.cpp +++ b/tests/fileformats_test.cpp @@ -41,7 +41,7 @@ class FileformatsTest : public ::testing::TestWithParam { static void TearDownTestCase() { delete sGstEngine; - sGstEngine = NULL; + sGstEngine = nullptr; } protected: @@ -74,7 +74,7 @@ class FileformatsTest : public ::testing::TestWithParam { QString temp_filetemplate_; }; -GstEngine* FileformatsTest::sGstEngine = NULL; +GstEngine* FileformatsTest::sGstEngine = nullptr; TEST_P(FileformatsTest, Exists) { diff --git a/tests/librarymodel_test.cpp b/tests/librarymodel_test.cpp index fc31b4e08..e265978ec 100644 --- a/tests/librarymodel_test.cpp +++ b/tests/librarymodel_test.cpp @@ -39,7 +39,7 @@ class LibraryModelTest : public ::testing::Test { backend_.reset(new LibraryBackend); backend_->Init(database_, Library::kSongsTable, Library::kDirsTable, Library::kSubdirsTable, Library::kFtsTable); - model_.reset(new LibraryModel(backend_.get(), NULL)); + model_.reset(new LibraryModel(backend_.get(), nullptr)); added_dir_ = false; diff --git a/tests/m3uparser_test.cpp b/tests/m3uparser_test.cpp index 7e96ea4a3..650f12127 100644 --- a/tests/m3uparser_test.cpp +++ b/tests/m3uparser_test.cpp @@ -30,7 +30,7 @@ using ::testing::HasSubstr; class M3UParserTest : public ::testing::Test { protected: M3UParserTest() - : parser_(NULL) { + : parser_(nullptr) { } M3UParser parser_; @@ -66,7 +66,7 @@ TEST_F(M3UParserTest, ParsesTrackLocationRelative) { temp.open(); QFileInfo info(temp); taglib_.ExpectCall(temp.fileName(), "foo", "bar", "baz"); - M3UParser parser(NULL); + M3UParser parser(nullptr); QString line(info.fileName()); Song song(&taglib_); parser.LoadSong(line, 0, info.dir(), &song); @@ -90,7 +90,7 @@ TEST_F(M3UParserTest, ParsesSongsFromDevice) { "http://foo.com/bar/somefile.mp3\n"; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - M3UParser parser(NULL); + M3UParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(1, songs.size()); Song s = songs[0]; @@ -105,7 +105,7 @@ TEST_F(M3UParserTest, ParsesNonExtendedM3U) { "http://baz.com/thing.mp3\n"; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - M3UParser parser(NULL); + M3UParser parser(nullptr); SongList songs = parser.Load(&buffer, "", QDir("somedir")); ASSERT_EQ(2, songs.size()); EXPECT_EQ(QUrl("http://foo.com/bar/somefile.mp3"), songs[0].url()); @@ -118,7 +118,7 @@ TEST_F(M3UParserTest, ParsesNonExtendedM3U) { TEST_F(M3UParserTest, ParsesActualM3U) { QFile file(":testdata/test.m3u"); file.open(QIODevice::ReadOnly); - M3UParser parser(NULL); + M3UParser parser(nullptr); SongList songs = parser.Load(&file, "", QDir("somedir")); ASSERT_EQ(239, songs.size()); EXPECT_EQ("gravity", songs[0].title()); @@ -139,7 +139,7 @@ TEST_F(M3UParserTest, SavesSong) { one.set_url(QUrl("http://www.example.com/foo.mp3")); SongList songs; songs << one; - M3UParser parser(NULL); + M3UParser parser(nullptr); parser.Save(songs, &buffer); EXPECT_THAT(data.constData(), HasSubstr("#EXTM3U")); EXPECT_THAT(data.constData(), HasSubstr("#EXTINF:123,bar - foo")); @@ -152,7 +152,7 @@ TEST_F(M3UParserTest, ParsesUTF8) { "/foo/Разные/исполнители.mp3\n"; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - M3UParser parser(NULL); + M3UParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(1, songs.length()); EXPECT_EQ(6, songs[0].artist().length()); diff --git a/tests/mock_networkaccessmanager.cpp b/tests/mock_networkaccessmanager.cpp index 99b95a9fe..64d6d5f68 100644 --- a/tests/mock_networkaccessmanager.cpp +++ b/tests/mock_networkaccessmanager.cpp @@ -83,14 +83,14 @@ MockNetworkReply* MockNetworkAccessManager::ExpectGet( reply->setAttribute(QNetworkRequest::HttpStatusCodeAttribute, status); EXPECT_CALL(*this, createRequest( - GetOperation, RequestForUrl(contains, expected_params), NULL)). + GetOperation, RequestForUrl(contains, expected_params), nullptr)). WillOnce(Return(reply)); return reply; } MockNetworkReply::MockNetworkReply() - : data_(NULL) { + : data_(nullptr) { } MockNetworkReply::MockNetworkReply(const QByteArray& data) diff --git a/tests/mpris1_test.cpp b/tests/mpris1_test.cpp index 6a3396132..01c3b27e7 100644 --- a/tests/mpris1_test.cpp +++ b/tests/mpris1_test.cpp @@ -74,7 +74,7 @@ TEST_F(Mpris1BasicTest, CreatesDBusService) { isServiceRegistered(service_name())); std::unique_ptr mpris( - new mpris::Mpris1(&player_, NULL, NULL, service_name())); + new mpris::Mpris1(&player_, nullptr, nullptr, service_name())); EXPECT_TRUE(QDBusConnection::sessionBus().interface()-> isServiceRegistered(service_name())); @@ -89,7 +89,7 @@ protected: void SetUp() { Mpris1BasicTest::SetUp(); - mpris_.reset(new mpris::Mpris1(&player_, NULL, NULL, service_name())); + mpris_.reset(new mpris::Mpris1(&player_, nullptr, nullptr, service_name())); } std::unique_ptr mpris_; diff --git a/tests/playlist_test.cpp b/tests/playlist_test.cpp index 98dcdb4af..417bb0cdb 100644 --- a/tests/playlist_test.cpp +++ b/tests/playlist_test.cpp @@ -36,8 +36,8 @@ namespace { class PlaylistTest : public ::testing::Test { protected: PlaylistTest() - : playlist_(NULL, NULL, NULL, 1), - sequence_(NULL, new DummySettingsProvider) + : playlist_(nullptr, nullptr, nullptr, 1), + sequence_(nullptr, new DummySettingsProvider) { } diff --git a/tests/plsparser_test.cpp b/tests/plsparser_test.cpp index c92f1da02..8af6daaaa 100644 --- a/tests/plsparser_test.cpp +++ b/tests/plsparser_test.cpp @@ -33,7 +33,7 @@ using std::shared_ptr; class PLSParserTest : public ::testing::Test { protected: - PLSParserTest() : parser_(NULL) {} + PLSParserTest() : parser_(nullptr) {} shared_ptr Open(const QString& filename) { shared_ptr ret(new QFile(":/testdata/" + filename)); diff --git a/tests/songloader_test.cpp b/tests/songloader_test.cpp index 2bab9f585..b72c09075 100644 --- a/tests/songloader_test.cpp +++ b/tests/songloader_test.cpp @@ -46,7 +46,7 @@ public: static void TearDownTestCase() { delete sGstEngine; - sGstEngine = NULL; + sGstEngine = nullptr; } protected: @@ -69,7 +69,7 @@ protected: }; const char* SongLoaderTest::kRemoteUrl = "http://remotetestdata.clementine-player.org"; -GstEngine* SongLoaderTest::sGstEngine = NULL; +GstEngine* SongLoaderTest::sGstEngine = nullptr; TEST_F(SongLoaderTest, LoadLocalMp3) { TemporaryResource file(":/testdata/beep.mp3"); diff --git a/tests/sqlite_test.cpp b/tests/sqlite_test.cpp index e1181845a..2470101fd 100644 --- a/tests/sqlite_test.cpp +++ b/tests/sqlite_test.cpp @@ -3,14 +3,14 @@ #include TEST(SqliteTest, FTS3SupportEnabled) { - sqlite3* db = NULL; + sqlite3* db = nullptr; int rc = sqlite3_open(":memory:", &db); ASSERT_EQ(0, rc); - char* errmsg = NULL; + char* errmsg = nullptr; rc = sqlite3_exec( db, "CREATE VIRTUAL TABLE foo USING fts3(content, TEXT)", - NULL, NULL, &errmsg); + nullptr, nullptr, &errmsg); ASSERT_EQ(0, rc) << errmsg; sqlite3_close(db); diff --git a/tests/xspfparser_test.cpp b/tests/xspfparser_test.cpp index 982d9ce31..becdabbbc 100644 --- a/tests/xspfparser_test.cpp +++ b/tests/xspfparser_test.cpp @@ -44,7 +44,7 @@ TEST_F(XSPFParserTest, ParsesOneTrackFromXML) { ""; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - XSPFParser parser(NULL); + XSPFParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(1, songs.length()); const Song& song = songs[0]; @@ -68,7 +68,7 @@ TEST_F(XSPFParserTest, ParsesMoreThanOneTrackFromXML) { ""; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - XSPFParser parser(NULL); + XSPFParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(2, songs.length()); EXPECT_EQ(QUrl("http://example.com/foo.mp3"), songs[0].url()); @@ -90,7 +90,7 @@ TEST_F(XSPFParserTest, IgnoresInvalidLength) { ""; QBuffer buffer(&data); buffer.open(QIODevice::ReadOnly); - XSPFParser parser(NULL); + XSPFParser parser(nullptr); SongList songs = parser.Load(&buffer); ASSERT_EQ(1, songs.length()); EXPECT_EQ(-1, songs[0].length_nanosec()); @@ -100,7 +100,7 @@ TEST_F(XSPFParserTest, SavesSong) { QByteArray data; QBuffer buffer(&data); buffer.open(QIODevice::WriteOnly); - XSPFParser parser(NULL); + XSPFParser parser(nullptr); Song one; one.set_url(QUrl("http://www.example.com/foo.mp3")); one.set_filetype(Song::Type_Stream); @@ -121,7 +121,7 @@ TEST_F(XSPFParserTest, SavesLocalFile) { QByteArray data; QBuffer buffer(&data); buffer.open(QIODevice::WriteOnly); - XSPFParser parser(NULL); + XSPFParser parser(nullptr); Song one; one.set_url(QUrl("file:///bar/foo.mp3")); one.set_filetype(Song::Type_Mpeg);