Replace QString::null with QString()
This commit is contained in:
parent
f9627c2084
commit
0da490a5e1
@ -618,7 +618,7 @@ void Song::InitFromQuery(const SqlRow& q, bool reliable_metadata, int col) {
|
|||||||
d->valid_ = true;
|
d->valid_ = true;
|
||||||
d->init_from_file_ = reliable_metadata;
|
d->init_from_file_ = reliable_metadata;
|
||||||
|
|
||||||
#define tostr(n) (q.value(n).isNull() ? QString::null : q.value(n).toString())
|
#define tostr(n) (q.value(n).isNull() ? QString() : q.value(n).toString())
|
||||||
#define toint(n) (q.value(n).isNull() ? -1 : q.value(n).toInt())
|
#define toint(n) (q.value(n).isNull() ? -1 : q.value(n).toInt())
|
||||||
#define tolonglong(n) (q.value(n).isNull() ? -1 : q.value(n).toLongLong())
|
#define tolonglong(n) (q.value(n).isNull() ? -1 : q.value(n).toLongLong())
|
||||||
#define tofloat(n) (q.value(n).isNull() ? -1 : q.value(n).toDouble())
|
#define tofloat(n) (q.value(n).isNull() ? -1 : q.value(n).toDouble())
|
||||||
@ -1077,13 +1077,13 @@ QString Song::PrettyTitleWithArtist() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString Song::PrettyLength() const {
|
QString Song::PrettyLength() const {
|
||||||
if (length_nanosec() == -1) return QString::null;
|
if (length_nanosec() == -1) return QString();
|
||||||
|
|
||||||
return Utilities::PrettyTimeNanosec(length_nanosec());
|
return Utilities::PrettyTimeNanosec(length_nanosec());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Song::PrettyYear() const {
|
QString Song::PrettyYear() const {
|
||||||
if (d->year_ == -1) return QString::null;
|
if (d->year_ == -1) return QString();
|
||||||
|
|
||||||
return QString::number(d->year_);
|
return QString::number(d->year_);
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ QString GetConfigPath(ConfigPath config) {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
qFatal("%s", Q_FUNC_INFO);
|
qFatal("%s", Q_FUNC_INFO);
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ quint64 KittenLoader::LoadKitten(const AlbumCoverLoaderOptions& options) {
|
|||||||
if (!kitten_urls_.isEmpty()) {
|
if (!kitten_urls_.isEmpty()) {
|
||||||
QUrl url = kitten_urls_.dequeue();
|
QUrl url = kitten_urls_.dequeue();
|
||||||
return AlbumCoverLoader::LoadImageAsync(
|
return AlbumCoverLoader::LoadImageAsync(
|
||||||
options, QString::null, url.toString(), QString::null, QImage());
|
options, QString(), url.toString(), QString(), QImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
Task task;
|
Task task;
|
||||||
|
@ -88,7 +88,7 @@ void BoxService::Connect() {
|
|||||||
oauth->RefreshAuthorisation(kOAuthTokenEndpoint, refresh_token());
|
oauth->RefreshAuthorisation(kOAuthTokenEndpoint, refresh_token());
|
||||||
} else {
|
} else {
|
||||||
oauth->StartAuthorisation(kOAuthEndpoint, kOAuthTokenEndpoint,
|
oauth->StartAuthorisation(kOAuthEndpoint, kOAuthTokenEndpoint,
|
||||||
QString::null);
|
QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
NewClosure(oauth, SIGNAL(Finished()), this,
|
NewClosure(oauth, SIGNAL(Finished()), this,
|
||||||
|
@ -58,8 +58,8 @@ CloudFileService::CloudFileService(Application* app, InternetModel* parent,
|
|||||||
QString songs_table = service_id + "_songs";
|
QString songs_table = service_id + "_songs";
|
||||||
QString songs_fts_table = service_id + "_songs_fts";
|
QString songs_fts_table = service_id + "_songs_fts";
|
||||||
|
|
||||||
library_backend_->Init(app->database(), songs_table, QString::null,
|
library_backend_->Init(app->database(), songs_table, QString(),
|
||||||
QString::null, songs_fts_table);
|
QString(), songs_fts_table);
|
||||||
library_model_ = new LibraryModel(library_backend_, app_, this);
|
library_model_ = new LibraryModel(library_backend_, app_, this);
|
||||||
|
|
||||||
library_sort_model_->setSourceModel(library_model_);
|
library_sort_model_->setSourceModel(library_model_);
|
||||||
@ -232,7 +232,7 @@ QString CloudFileService::GuessMimeTypeForFile(const QString& filename) const {
|
|||||||
} else if (filename.endsWith(".wma", Qt::CaseInsensitive)) {
|
} else if (filename.endsWith(".wma", Qt::CaseInsensitive)) {
|
||||||
return "audio/x-ms-wma";
|
return "audio/x-ms-wma";
|
||||||
}
|
}
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloudFileService::AbortReadTagsReplies() {
|
void CloudFileService::AbortReadTagsReplies() {
|
||||||
|
@ -259,7 +259,7 @@ void DropboxService::FetchContentUrlFinished(QNetworkReply* reply,
|
|||||||
|
|
||||||
MaybeAddFileToDatabase(song, GuessMimeTypeForFile(url.toString()),
|
MaybeAddFileToDatabase(song, GuessMimeTypeForFile(url.toString()),
|
||||||
QUrl::fromEncoded(json_response["link"].toVariant().toByteArray()),
|
QUrl::fromEncoded(json_response["link"].toVariant().toByteArray()),
|
||||||
QString::null);
|
QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl DropboxService::GetStreamingUrlFromSongId(const QUrl& url) {
|
QUrl DropboxService::GetStreamingUrlFromSongId(const QUrl& url) {
|
||||||
|
@ -92,8 +92,8 @@ JamendoService::JamendoService(Application* app, InternetModel* parent)
|
|||||||
accepted_download_(false) {
|
accepted_download_(false) {
|
||||||
library_backend_ = new LibraryBackend;
|
library_backend_ = new LibraryBackend;
|
||||||
library_backend_->moveToThread(app_->database()->thread());
|
library_backend_->moveToThread(app_->database()->thread());
|
||||||
library_backend_->Init(app_->database(), kSongsTable, QString::null,
|
library_backend_->Init(app_->database(), kSongsTable, QString(),
|
||||||
QString::null, kFtsTable);
|
QString(), kFtsTable);
|
||||||
connect(library_backend_, SIGNAL(TotalSongCountUpdated(int)),
|
connect(library_backend_, SIGNAL(TotalSongCountUpdated(int)),
|
||||||
SLOT(UpdateTotalSongCount(int)));
|
SLOT(UpdateTotalSongCount(int)));
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ MagnatuneService::MagnatuneService(Application* app, InternetModel* parent)
|
|||||||
// Create the library backend in the database thread
|
// Create the library backend in the database thread
|
||||||
library_backend_ = new LibraryBackend;
|
library_backend_ = new LibraryBackend;
|
||||||
library_backend_->moveToThread(app_->database()->thread());
|
library_backend_->moveToThread(app_->database()->thread());
|
||||||
library_backend_->Init(app_->database(), kSongsTable, QString::null,
|
library_backend_->Init(app_->database(), kSongsTable, QString(),
|
||||||
QString::null, kFtsTable);
|
QString(), kFtsTable);
|
||||||
library_model_ = new LibraryModel(library_backend_, app_, this);
|
library_model_ = new LibraryModel(library_backend_, app_, this);
|
||||||
|
|
||||||
connect(library_backend_, SIGNAL(TotalSongCountUpdated(int)),
|
connect(library_backend_, SIGNAL(TotalSongCountUpdated(int)),
|
||||||
|
@ -264,7 +264,7 @@ QString SeafileTree::Entry::TypeToString(const Type& type) {
|
|||||||
case LIBRARY:
|
case LIBRARY:
|
||||||
return "library";
|
return "library";
|
||||||
default:
|
default:
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ void SkydriveService::ListFilesFinished(QNetworkReply* reply) {
|
|||||||
// HTTPS appears to be broken somehow between Qt & Skydrive downloads.
|
// HTTPS appears to be broken somehow between Qt & Skydrive downloads.
|
||||||
// Fortunately, just changing the scheme to HTTP works.
|
// Fortunately, just changing the scheme to HTTP works.
|
||||||
download_url.setScheme("http");
|
download_url.setScheme("http");
|
||||||
MaybeAddFileToDatabase(song, mime_type, download_url, QString::null);
|
MaybeAddFileToDatabase(song, mime_type, download_url, QString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,8 +83,8 @@ SubsonicService::SubsonicService(Application* app, InternetModel* parent)
|
|||||||
|
|
||||||
library_backend_ = new LibraryBackend;
|
library_backend_ = new LibraryBackend;
|
||||||
library_backend_->moveToThread(app_->database()->thread());
|
library_backend_->moveToThread(app_->database()->thread());
|
||||||
library_backend_->Init(app_->database(), kSongsTable, QString::null,
|
library_backend_->Init(app_->database(), kSongsTable, QString(),
|
||||||
QString::null, kFtsTable);
|
QString(), kFtsTable);
|
||||||
connect(library_backend_, SIGNAL(TotalSongCountUpdated(int)),
|
connect(library_backend_, SIGNAL(TotalSongCountUpdated(int)),
|
||||||
SLOT(UpdateTotalSongCount(int)));
|
SLOT(UpdateTotalSongCount(int)));
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ void AddService(const QString domain, const QString type, const QByteArray name,
|
|||||||
QString::fromUtf8(name.constData(), name.size()),
|
QString::fromUtf8(name.constData(), name.size()),
|
||||||
type, // Service type, eg. _clementine._tcp
|
type, // Service type, eg. _clementine._tcp
|
||||||
domain, // Domain, eg. local
|
domain, // Domain, eg. local
|
||||||
QString::null, // Hostname (filled in by Avahi)
|
QString(), // Hostname (filled in by Avahi)
|
||||||
port, // Port our service is running on
|
port, // Port our service is running on
|
||||||
QList<QByteArray>()); // TXT record
|
QList<QByteArray>()); // TXT record
|
||||||
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(reply);
|
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(reply);
|
||||||
|
@ -264,7 +264,7 @@ QString LengthItemDelegate::displayText(const QVariant& value,
|
|||||||
qint64 nanoseconds = value.toLongLong(&ok);
|
qint64 nanoseconds = value.toLongLong(&ok);
|
||||||
|
|
||||||
if (ok && nanoseconds > 0) return Utilities::PrettyTimeNanosec(nanoseconds);
|
if (ok && nanoseconds > 0) return Utilities::PrettyTimeNanosec(nanoseconds);
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SizeItemDelegate::displayText(const QVariant& value,
|
QString SizeItemDelegate::displayText(const QVariant& value,
|
||||||
@ -281,7 +281,7 @@ QString DateItemDelegate::displayText(const QVariant& value,
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
int time = value.toInt(&ok);
|
int time = value.toInt(&ok);
|
||||||
|
|
||||||
if (!ok || time == -1) return QString::null;
|
if (!ok || time == -1) return QString();
|
||||||
|
|
||||||
return QDateTime::fromTime_t(time)
|
return QDateTime::fromTime_t(time)
|
||||||
.toString(QLocale::system().dateTimeFormat(QLocale::ShortFormat));
|
.toString(QLocale::system().dateTimeFormat(QLocale::ShortFormat));
|
||||||
|
@ -173,7 +173,7 @@ QString ExtractExtract(const QJsonObject& json) {
|
|||||||
return it.value().toString();
|
return it.value().toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QString::null;
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -32,7 +32,7 @@ AddStreamDialog::AddStreamDialog(QWidget* parent)
|
|||||||
ui_->setupUi(this);
|
ui_->setupUi(this);
|
||||||
|
|
||||||
connect(ui_->url, SIGNAL(textChanged(QString)), SLOT(TextChanged(QString)));
|
connect(ui_->url, SIGNAL(textChanged(QString)), SLOT(TextChanged(QString)));
|
||||||
TextChanged(QString::null);
|
TextChanged(QString());
|
||||||
|
|
||||||
// Restore settings
|
// Restore settings
|
||||||
QSettings s;
|
QSettings s;
|
||||||
|
@ -26,7 +26,7 @@ BusyIndicator::BusyIndicator(const QString& text, QWidget* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BusyIndicator::BusyIndicator(QWidget* parent) : QWidget(parent) {
|
BusyIndicator::BusyIndicator(QWidget* parent) : QWidget(parent) {
|
||||||
Init(QString::null);
|
Init(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BusyIndicator::Init(const QString& text) {
|
void BusyIndicator::Init(const QString& text) {
|
||||||
|
@ -46,7 +46,7 @@ class LoginStateWidget : public QWidget {
|
|||||||
public slots:
|
public slots:
|
||||||
// Changes the "You are logged in/out" label, shows/hides any QGroupBoxes
|
// Changes the "You are logged in/out" label, shows/hides any QGroupBoxes
|
||||||
// added with AddCredentialGroup.
|
// added with AddCredentialGroup.
|
||||||
void SetLoggedIn(State state, const QString& account_name = QString::null);
|
void SetLoggedIn(State state, const QString& account_name = QString());
|
||||||
|
|
||||||
// Hides the "You are logged in/out" label completely.
|
// Hides the "You are logged in/out" label completely.
|
||||||
void HideLoggedInState();
|
void HideLoggedInState();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user