if (!url.isEmpty())
setUrl(url, parsingMode);
else {
- d = new QUrlPrivate;
+ d = new QUrlPrivate();
d->parsingMode = parsingMode;
}
}
{
if (d && !d->ref.deref())
delete d;
- d = 0;
+ d = nullptr;
}
/*!
*/
void QUrl::setUrl(const QString &url, ParsingMode parsingMode)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
detach(lock);
*/
void QUrl::setEncodedUrl(const QByteArray &encodedUrl, ParsingMode parsingMode)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
detach(lock);
*/
void QUrl::setScheme(const QString &scheme)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setAuthority(const QString &authority)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setUserInfo(const QString &userInfo)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setUserName(const QString &userName)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setEncodedUserName(const QByteArray &userName)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setPassword(const QString &password)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
detach(lock);
*/
void QUrl::setEncodedPassword(const QByteArray &password)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setHost(const QString &host)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setPort(int port)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setPath(const QString &path)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setEncodedPath(const QByteArray &path)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setQueryDelimiters(char valueDelimiter, char pairDelimiter)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
detach(lock);
*/
void QUrl::setEncodedQuery(const QByteArray &query)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setQueryItems(const QList<QPair<QString, QString> > &query)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setEncodedQueryItems(const QList<QPair<QByteArray, QByteArray> > &query)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::addQueryItem(const QString &key, const QString &value)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::addEncodedQueryItem(const QByteArray &key, const QByteArray &value)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setFragment(const QString &fragment)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
*/
void QUrl::setEncodedFragment(const QByteArray &fragment)
{
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
QMutexLocker lock(&d->mutex);
if (!QURL_HASFLAG(d->stateFlags, QUrlPrivate::Parsed)) d->parse();
t = relative;
qAtomicDetach(t.d);
} else {
- t.d = new QUrlPrivate;
+ t.d = new QUrlPrivate();
if (relative.d->encodedPath.isEmpty()) {
t.d->encodedPath = d->encodedPath;
t.d->query = relative.d->hasQuery ? relative.d->query : d->query;
clear();
} else {
QUrl tmp(url);
- if (!d) d = new QUrlPrivate;
+ if (!d) d = new QUrlPrivate();
qAtomicAssign(d, tmp.d);
}
return *this;