diff --git a/src/libs/qtlibs/config.cpp b/src/libs/qtlibs/config.cpp index 24002244d70b7c1e7f8863009485a68c01ddf799..11e0de575c9050a752bdb5fc9266fbccfc602fc6 100644 --- a/src/libs/qtlibs/config.cpp +++ b/src/libs/qtlibs/config.cpp @@ -21,15 +21,14 @@ Config::Config(const QString &configDirPath, QObject *parent) : QObject(parent), configDirPath_(configDirPath) {} -Config::Config(const Config &other) +Config::Config(const Config &other, QObject *parent) + : QObject(parent) { - this->setParent(other.parent()); setConfigDirPath(other.configDirPath()); } Config &Config::operator =(const Config &other) { - this->setParent(other.parent()); setConfigDirPath(other.configDirPath()); return *this; } diff --git a/src/libs/qtlibs/config.h b/src/libs/qtlibs/config.h index 5f0df5fdc310e2e3688416dbd8074a2eeca2c467..17f0a4d1d390fd4e9fa0606014b0088c13501623 100644 --- a/src/libs/qtlibs/config.h +++ b/src/libs/qtlibs/config.h @@ -23,7 +23,7 @@ class Config : public QObject public: explicit Config(const QString &configDirPath = QString(), QObject *parent = 0); - Config(const Config &other); + Config(const Config &other, QObject *parent = 0); Config &operator =(const Config &other); QString configDirPath() const; diff --git a/src/libs/qtlibs/dir.cpp b/src/libs/qtlibs/dir.cpp index e0b579a97f3c6616f9463959c2ace7e8f12729c0..c444ae6c02651e72d2ba6056417de56bec151e94 100644 --- a/src/libs/qtlibs/dir.cpp +++ b/src/libs/qtlibs/dir.cpp @@ -22,15 +22,14 @@ Dir::Dir(const QString &path, QObject *parent) : QObject(parent), path_(path) {} -Dir::Dir(const Dir &other) +Dir::Dir(const Dir &other, QObject *parent) + : QObject(parent) { - this->setParent(other.parent()); setPath(other.path()); } Dir &Dir::operator =(const Dir &other) { - this->setParent(other.parent()); setPath(other.path()); return *this; } diff --git a/src/libs/qtlibs/dir.h b/src/libs/qtlibs/dir.h index 31e63a556e58a335a4b5fe808f43751f0f453042..ca98375003679b22d7f710b8b2dcf67a326c2613 100644 --- a/src/libs/qtlibs/dir.h +++ b/src/libs/qtlibs/dir.h @@ -23,7 +23,7 @@ class Dir : public QObject public: explicit Dir(const QString &path = QString(), QObject *parent = 0); - Dir(const Dir &other); + Dir(const Dir &other, QObject *parent = 0); Dir &operator =(const Dir &other); QString path() const; diff --git a/src/libs/qtlibs/file.cpp b/src/libs/qtlibs/file.cpp index d092cfa776502579fe06ba4f6b4be3b8ccf4820e..39d9542826fb3f92a6ed853e23dfe3326f20f169 100644 --- a/src/libs/qtlibs/file.cpp +++ b/src/libs/qtlibs/file.cpp @@ -21,15 +21,14 @@ File::File(const QString &path, QObject *parent) : QObject(parent), path_(path) {} -File::File(const File &other) +File::File(const File &other, QObject *parent) + : QObject(parent) { - this->setParent(other.parent()); setPath(other.path()); } File &File::operator =(const File &other) { - this->setParent(other.parent()); setPath(other.path()); return *this; } diff --git a/src/libs/qtlibs/file.h b/src/libs/qtlibs/file.h index bfc1389045ffcb21db10b13381e763e6105bd18c..dab67a8a5049f740724705d84069d4b5929ef9fe 100644 --- a/src/libs/qtlibs/file.h +++ b/src/libs/qtlibs/file.h @@ -22,7 +22,7 @@ class File : public QObject public: explicit File(const QString &path = QString(), QObject *parent = 0); - File(const File &other); + File(const File &other, QObject *parent = 0); File &operator =(const File &other); QString path() const; diff --git a/src/libs/qtlibs/json.cpp b/src/libs/qtlibs/json.cpp index 1cddfe0f6df31516a78394e85af0f1a62a28dc35..09d992231a8aa3dc577b0304fd6b787493f9bfb1 100644 --- a/src/libs/qtlibs/json.cpp +++ b/src/libs/qtlibs/json.cpp @@ -32,15 +32,14 @@ Json::Json(const QJsonArray &array, QObject *parent) fromArray(array); } -Json::Json(const Json &other) +Json::Json(const Json &other, QObject *parent) + : QObject(parent) { - this->setParent(other.parent()); setJson(other.json()); } Json &Json::operator =(const Json &other) { - this->setParent(other.parent()); setJson(other.json()); return *this; } diff --git a/src/libs/qtlibs/json.h b/src/libs/qtlibs/json.h index 9d6cd4e165bee8067b7da2d43801e1e09443a8e0..1c60a145c6c75f831670f0e274d1e97b6e33d6c0 100644 --- a/src/libs/qtlibs/json.h +++ b/src/libs/qtlibs/json.h @@ -26,7 +26,7 @@ public: explicit Json(const QJsonObject &object, QObject *parent = 0); explicit Json(const QJsonArray &array, QObject *parent = 0); - Json(const Json &other); + Json(const Json &other, QObject *parent = 0); Json &operator =(const Json &other); QByteArray json() const; diff --git a/src/libs/qtlibs/networkresource.cpp b/src/libs/qtlibs/networkresource.cpp index 16238f0f4bdac1686ed462e2d9ff88bd5c52e4d1..1e11226eb77f3ebf5506718b07822f519a9af4af 100644 --- a/src/libs/qtlibs/networkresource.cpp +++ b/src/libs/qtlibs/networkresource.cpp @@ -28,30 +28,22 @@ NetworkResource::~NetworkResource() manager()->deleteLater(); } -NetworkResource::NetworkResource(const NetworkResource &other) +NetworkResource::NetworkResource(const NetworkResource &other, QObject *parent) + : QObject(parent) { - this->setParent(other.parent()); setName(other.name()); setUrl(other.url()); setAsync(other.async()); setRequest(other.request()); - setManager(other.manager()); - setReply(other.reply()); - setMethod(other.method()); + setManager(new QNetworkAccessManager(this)); } NetworkResource &NetworkResource::operator =(const NetworkResource &other) { - manager()->deleteLater(); - - this->setParent(other.parent()); setName(other.name()); setUrl(other.url()); setAsync(other.async()); setRequest(other.request()); - setManager(other.manager()); - setReply(other.reply()); - setMethod(other.method()); return *this; } diff --git a/src/libs/qtlibs/networkresource.h b/src/libs/qtlibs/networkresource.h index 4186ee64de4f3c38c76f7cfaa3dae5348737e1c9..72a3e3580e719696f7eb3fa9b2cb1e817742a17c 100644 --- a/src/libs/qtlibs/networkresource.h +++ b/src/libs/qtlibs/networkresource.h @@ -27,7 +27,7 @@ public: explicit NetworkResource(const QString &name = QString(), const QUrl &url = QUrl(), const bool &async = true, QObject *parent = 0); ~NetworkResource(); - NetworkResource(const NetworkResource &other); + NetworkResource(const NetworkResource &other, QObject *parent = 0); NetworkResource &operator =(const NetworkResource &other); QString name() const; diff --git a/src/libs/qtlibs/package.cpp b/src/libs/qtlibs/package.cpp index d857f14d3757da60393880615e8fa4d7da6d86ad..9db1ae9ab9c872e4733834780e5e9b656b5edd92 100644 --- a/src/libs/qtlibs/package.cpp +++ b/src/libs/qtlibs/package.cpp @@ -27,15 +27,14 @@ Package::Package(const QString &path, QObject *parent) : QObject(parent), path_(path) {} -Package::Package(const Package &other) +Package::Package(const Package &other, QObject *parent) + : QObject(parent) { - this->setParent(other.parent()); setPath(other.path()); } Package &Package::operator =(const Package &other) { - this->setParent(other.parent()); setPath(other.path()); return *this; } diff --git a/src/libs/qtlibs/package.h b/src/libs/qtlibs/package.h index b11e77569696cbba1bc0027a19818d2c78ca5ed6..fd7422f2cf268c39d95b6f2eac50bd7f48079fc8 100644 --- a/src/libs/qtlibs/package.h +++ b/src/libs/qtlibs/package.h @@ -22,7 +22,7 @@ class Package : public QObject public: explicit Package(const QString &path = QString(), QObject *parent = 0); - Package(const Package &other); + Package(const Package &other, QObject *parent = 0); Package &operator =(const Package &other); QString path() const;