Remove usage of QString::null

Replaces by "QString()"
This commit is contained in:
Olivier Goffart 2017-12-08 10:58:55 +01:00
parent 74672d493d
commit 3df65460f5
17 changed files with 26 additions and 26 deletions

View file

@ -71,7 +71,7 @@ namespace Utility {
* @param unit an optional unit that is appended if present.
* @return the formatted string.
*/
OCSYNC_EXPORT QString compactFormatDouble(double value, int prec, const QString &unit = QString::null);
OCSYNC_EXPORT QString compactFormatDouble(double value, int prec, const QString &unit = QString());
// porting methods
OCSYNC_EXPORT QString escape(const QString &);

View file

@ -342,7 +342,7 @@ private:
};
void createGuiLog(const QString &filename, LogStatus status, int count,
const QString &renameTarget = QString::null);
const QString &renameTarget = QString());
AccountStatePtr _accountState;
FolderDefinition _definition;

View file

@ -1018,7 +1018,7 @@ QString FolderMan::getBackupName(QString fullPathName) const
fullPathName.chop(1);
if (fullPathName.isEmpty())
return QString::null;
return QString();
QString newName = fullPathName + tr(" (backup)");
QFileInfo fi(newName);

View file

@ -107,7 +107,7 @@ bool FolderWizardLocalPath::isComplete() const
_ui.warnLabel->setWordWrap(true);
if (isOk) {
_ui.warnLabel->hide();
_ui.warnLabel->setText(QString::null);
_ui.warnLabel->setText(QString());
} else {
_ui.warnLabel->show();
QString warnings = formatWarnings(warnStrings);

View file

@ -65,7 +65,7 @@ static inline QString removeTrailingSlash(QString path)
return path;
}
static QString buildMessage(const QString &verb, const QString &path, const QString &status = QString::null)
static QString buildMessage(const QString &verb, const QString &path, const QString &status = QString())
{
QString msg(verb);
@ -307,7 +307,7 @@ void SocketApi::slotUnregisterPath(const QString &alias)
Folder *f = FolderMan::instance()->folder(alias);
if (f)
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), removeTrailingSlash(f->path()), QString::null), true);
broadcastMessage(buildMessage(QLatin1String("UNREGISTER_PATH"), removeTrailingSlash(f->path()), QString()), true);
_registeredAliases.remove(alias);
}

View file

@ -90,7 +90,7 @@ QString Updater::getSystemInfo()
return QString::fromLocal8Bit(output.toBase64());
#else
return QString::null;
return QString();
#endif
}

View file

@ -230,7 +230,7 @@ bool OwncloudAdvancedSetupPage::isConfirmBigFolderChecked() const
bool OwncloudAdvancedSetupPage::validatePage()
{
if (!_created) {
setErrorString(QString::null);
setErrorString(QString());
_checking = true;
startSpinner();
emit completeChanged();

View file

@ -221,7 +221,7 @@ QString OwncloudSetupPage::url() const
bool OwncloudSetupPage::validatePage()
{
if (!_authTypeKnown) {
setErrorString(QString::null, false);
setErrorString(QString(), false);
_checking = true;
startSpinner();
emit completeChanged();

View file

@ -195,7 +195,7 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
if (id == WizardCommon::Page_Result) {
disconnect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
emit basicSetupFinished(QDialog::Accepted);
appendToConfigurationLog(QString::null);
appendToConfigurationLog(QString());
// Immediately close on show, we currently don't want this page anymore
done(Accepted);
}

View file

@ -70,7 +70,7 @@ bool OwncloudWizardResultPage::isComplete() const
void OwncloudWizardResultPage::initializePage()
{
_ui.localFolderLabel->setText(QString::null);
_ui.localFolderLabel->setText(QString());
}
void OwncloudWizardResultPage::setRemoteFolder(const QString &remoteFolder)
@ -81,7 +81,7 @@ void OwncloudWizardResultPage::setRemoteFolder(const QString &remoteFolder)
void OwncloudWizardResultPage::setupCustomization()
{
// set defaults for the customize labels.
_ui.topLabel->setText(QString::null);
_ui.topLabel->setText(QString());
_ui.topLabel->hide();
QVariant variant = Theme::instance()->customMedia(Theme::oCSetupResultTop);

View file

@ -326,7 +326,7 @@ QString extractErrorMessage(const QByteArray &errorResponse)
QXmlStreamReader reader(errorResponse);
reader.readNextStartElement();
if (reader.name() != "error") {
return QString::null;
return QString();
}
QString exception;

View file

@ -84,7 +84,7 @@ static const char maxLogLinesC[] = "Logging/maxLogLines";
const char certPath[] = "http_certificatePath";
const char certPasswd[] = "http_certificatePasswd";
QString ConfigFile::_confDir = QString::null;
QString ConfigFile::_confDir = QString();
bool ConfigFile::_askedUser = false;
ConfigFile::ConfigFile()
@ -609,12 +609,12 @@ QString ConfigFile::proxyPassword() const
int ConfigFile::useUploadLimit() const
{
return getValue(useUploadLimitC, QString::null, 0).toInt();
return getValue(useUploadLimitC, QString(), 0).toInt();
}
int ConfigFile::useDownloadLimit() const
{
return getValue(useDownloadLimitC, QString::null, 0).toInt();
return getValue(useDownloadLimitC, QString(), 0).toInt();
}
void ConfigFile::setUseUploadLimit(int val)
@ -629,12 +629,12 @@ void ConfigFile::setUseDownloadLimit(int val)
int ConfigFile::uploadLimit() const
{
return getValue(uploadLimitC, QString::null, 10).toInt();
return getValue(uploadLimitC, QString(), 10).toInt();
}
int ConfigFile::downloadLimit() const
{
return getValue(downloadLimitC, QString::null, 80).toInt();
return getValue(downloadLimitC, QString(), 80).toInt();
}
void ConfigFile::setUploadLimit(int kbytes)

View file

@ -56,7 +56,7 @@ public:
QByteArray caCerts();
void setCaCerts(const QByteArray &);
bool passwordStorageAllowed(const QString &connection = QString::null);
bool passwordStorageAllowed(const QString &connection = QString());
// max count of lines in the log window
int maxLogLines() const;
@ -165,7 +165,7 @@ protected:
bool dataExists(const QString &group, const QString &key) const;
private:
QVariant getValue(const QString &param, const QString &group = QString::null,
QVariant getValue(const QString &param, const QString &group = QString(),
const QVariant &defaultValue = QVariant()) const;
void setValue(const QString &key, const QVariant &value);

View file

@ -40,11 +40,11 @@ QString AbstractCredentials::keychainKey(const QString &url, const QString &user
QString u(url);
if (u.isEmpty()) {
qCWarning(lcCredentials) << "Empty url in keyChain, error!";
return QString::null;
return QString();
}
if (user.isEmpty()) {
qCWarning(lcCredentials) << "Error: User is empty!";
return QString::null;
return QString();
}
if (!u.endsWith(QChar('/'))) {

View file

@ -106,7 +106,7 @@ void SyncResult::appendErrorString(const QString &err)
QString SyncResult::errorString() const
{
if (_errors.isEmpty())
return QString::null;
return QString();
return _errors.first();
}

View file

@ -219,7 +219,7 @@ QString Theme::defaultServerFolder() const
QString Theme::overrideServerUrl() const
{
return QString::null;
return QString();
}
QString Theme::forceConfigAuthType() const

View file

@ -120,7 +120,7 @@ public:
/**
* URL to help file
*/
virtual QString helpUrl() const { return QString::null; }
virtual QString helpUrl() const { return QString(); }
/**
* Setting a value here will pre-define the server url.
@ -149,7 +149,7 @@ public:
/**
* Override to encforce a particular locale, i.e. "de" or "pt_BR"
*/
virtual QString enforcedLocale() const { return QString::null; }
virtual QString enforcedLocale() const { return QString(); }
/** colored, white or black */
QString systrayIconFlavor(bool mono, bool sysTrayMenuVisible = false) const;