Some more NULL -> nullptr conversions.
This commit is contained in:
parent
0e4aff8b74
commit
5146bcdebc
@ -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();
|
||||
|
@ -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_; }
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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<CFArrayRef>(array.get()),
|
||||
kFSEventStreamEventIdSinceNow, latency,
|
||||
kFSEventStreamCreateFlagNone);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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_;
|
||||
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,9 @@
|
||||
template <typename T>
|
||||
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;
|
||||
|
@ -27,8 +27,8 @@ template <typename T>
|
||||
class SimpleTreeItem {
|
||||
public:
|
||||
SimpleTreeItem(int _type, SimpleTreeModel<T>* _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<T>::SimpleTreeItem(int _type, SimpleTreeModel<T>* _model)
|
||||
: type(_type),
|
||||
row(0),
|
||||
lazy_loaded(true),
|
||||
parent(NULL),
|
||||
child_model(NULL),
|
||||
parent(nullptr),
|
||||
child_model(nullptr),
|
||||
model(_model) {}
|
||||
|
||||
template <typename T>
|
||||
@ -74,8 +74,8 @@ SimpleTreeItem<T>::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<T*>(this);
|
||||
@ -87,8 +87,8 @@ SimpleTreeItem<T>::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<T*>(this);
|
||||
@ -151,7 +151,7 @@ T* SimpleTreeItem<T>::ChildByKey(const QString& key) const {
|
||||
for (T* child : children) {
|
||||
if (child->key == key) return child;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#endif // SIMPLETREEITEM_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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -45,7 +45,7 @@ class DiscogsCoverProvider : public CoverProvider {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DiscogsCoverProvider(QObject* parent = NULL);
|
||||
DiscogsCoverProvider(QObject* parent = nullptr);
|
||||
|
||||
static const char* kSearchUrl;
|
||||
|
||||
|
@ -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<ConnectedDevice>
|
||||
device_; // NULL if not connected to clementine
|
||||
device_; // nullptr if not connected to clementine
|
||||
QList<Backend> backends_;
|
||||
|
||||
QString friendly_name_;
|
||||
|
@ -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<void*>(this));
|
||||
DARegisterDiskDisappearedCallback(loop_session_, NULL, &DiskRemovedCallback,
|
||||
DARegisterDiskDisappearedCallback(loop_session_, nullptr, &DiskRemovedCallback,
|
||||
reinterpret_cast<void*>(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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -27,7 +27,7 @@ class IcecastItem : public SimpleTreeItem<IcecastItem> {
|
||||
|
||||
IcecastItem(SimpleTreeModel<IcecastItem>* model)
|
||||
: SimpleTreeItem<IcecastItem>(Type_Root, model) {}
|
||||
IcecastItem(Type type, IcecastItem* parent = NULL)
|
||||
IcecastItem(Type type, IcecastItem* parent = nullptr)
|
||||
: SimpleTreeItem<IcecastItem>(type, parent) {}
|
||||
|
||||
IcecastBackend::Station station;
|
||||
|
@ -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<QAction*>();
|
||||
}
|
||||
|
||||
virtual QWidget* HeaderWidget() const { return NULL; }
|
||||
virtual QWidget* HeaderWidget() const { return nullptr; }
|
||||
|
||||
virtual void ReloadSettings() {}
|
||||
|
||||
|
@ -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<lastfm::User>* users);
|
||||
|
||||
|
@ -39,12 +39,12 @@ class LibraryItem : public SimpleTreeItem<LibraryItem> {
|
||||
LibraryItem(SimpleTreeModel<LibraryItem>* model)
|
||||
: SimpleTreeItem<LibraryItem>(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<LibraryItem>(type, parent),
|
||||
container_level(-1),
|
||||
compilation_artist_node_(NULL) {}
|
||||
compilation_artist_node_(nullptr) {}
|
||||
|
||||
int container_level;
|
||||
Song metadata;
|
||||
|
@ -46,7 +46,7 @@ class Chromaprinter {
|
||||
|
||||
private:
|
||||
GstElement* CreateElement(const QString& factory_name,
|
||||
GstElement* bin = NULL);
|
||||
GstElement* bin = nullptr);
|
||||
|
||||
void ReportError(GstMessage* message);
|
||||
|
||||
|
@ -21,7 +21,7 @@ class PlaylistListView : public AutoExpandingTreeView {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PlaylistListView(QWidget* parent = NULL);
|
||||
PlaylistListView(QWidget* parent = nullptr);
|
||||
~PlaylistListView() {}
|
||||
|
||||
protected:
|
||||
|
@ -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;
|
||||
|
@ -29,7 +29,7 @@ class SongMimeData : public MimeData {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SongMimeData() : backend(NULL) {}
|
||||
SongMimeData() : backend(nullptr) {}
|
||||
|
||||
LibraryBackendInterface* backend;
|
||||
SongList songs;
|
||||
|
@ -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<ParserBase*> parsers_;
|
||||
|
@ -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_);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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) {}
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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) {}
|
||||
|
@ -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<QAction*>& actions);
|
||||
|
||||
// Call this from the parent's winEvent() function.
|
||||
|
@ -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");
|
||||
|
@ -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_;
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
class AsxIniParserTest : public ::testing::Test {
|
||||
protected:
|
||||
AsxIniParserTest() : parser_(NULL) {}
|
||||
AsxIniParserTest() : parser_(nullptr) {}
|
||||
|
||||
AsxIniParser parser_;
|
||||
};
|
||||
|
@ -41,7 +41,7 @@ TEST_F(ASXParserTest, ParsesOneTrackFromXML) {
|
||||
"</entry></asx>";
|
||||
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) {
|
||||
"</entry></asx>";
|
||||
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());
|
||||
|
@ -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.
|
||||
|
@ -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<Database::UnicodeTokenizerCursor*>(cursor);
|
||||
QList<Database::Token> 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<Database::UnicodeTokenizerCursor*>(cursor);
|
||||
QList<Database::Token> 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<Database::UnicodeTokenizerCursor*>(cursor);
|
||||
QList<Database::Token> 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<Database::UnicodeTokenizerCursor*>(cursor);
|
||||
QList<Database::Token> 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<Database::UnicodeTokenizerCursor*>(cursor);
|
||||
|
||||
|
@ -41,7 +41,7 @@ class FileformatsTest : public ::testing::TestWithParam<const char*> {
|
||||
|
||||
static void TearDownTestCase() {
|
||||
delete sGstEngine;
|
||||
sGstEngine = NULL;
|
||||
sGstEngine = nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -74,7 +74,7 @@ class FileformatsTest : public ::testing::TestWithParam<const char*> {
|
||||
QString temp_filetemplate_;
|
||||
};
|
||||
|
||||
GstEngine* FileformatsTest::sGstEngine = NULL;
|
||||
GstEngine* FileformatsTest::sGstEngine = nullptr;
|
||||
|
||||
|
||||
TEST_P(FileformatsTest, Exists) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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)
|
||||
|
@ -74,7 +74,7 @@ TEST_F(Mpris1BasicTest, CreatesDBusService) {
|
||||
isServiceRegistered(service_name()));
|
||||
|
||||
std::unique_ptr<mpris::Mpris1> 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::Mpris1> mpris_;
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ using std::shared_ptr;
|
||||
|
||||
class PLSParserTest : public ::testing::Test {
|
||||
protected:
|
||||
PLSParserTest() : parser_(NULL) {}
|
||||
PLSParserTest() : parser_(nullptr) {}
|
||||
|
||||
shared_ptr<QFile> Open(const QString& filename) {
|
||||
shared_ptr<QFile> ret(new QFile(":/testdata/" + filename));
|
||||
|
@ -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");
|
||||
|
@ -3,14 +3,14 @@
|
||||
#include <sqlite3.h>
|
||||
|
||||
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);
|
||||
|
@ -44,7 +44,7 @@ TEST_F(XSPFParserTest, ParsesOneTrackFromXML) {
|
||||
"</track></trackList></playlist>";
|
||||
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) {
|
||||
"</trackList></playlist>";
|
||||
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) {
|
||||
"</track></trackList></playlist>";
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user