From cf8fea2d11f5d72e5715a863a9ab440348fc255e Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Mon, 14 Nov 2016 22:28:15 +0900
Subject: [PATCH] Update qtlibs

---
 src/libs/qtlibs/config.cpp          |  5 ++---
 src/libs/qtlibs/config.h            |  2 +-
 src/libs/qtlibs/dir.cpp             |  5 ++---
 src/libs/qtlibs/dir.h               |  2 +-
 src/libs/qtlibs/file.cpp            |  5 ++---
 src/libs/qtlibs/file.h              |  2 +-
 src/libs/qtlibs/json.cpp            |  5 ++---
 src/libs/qtlibs/json.h              |  2 +-
 src/libs/qtlibs/networkresource.cpp | 14 +++-----------
 src/libs/qtlibs/networkresource.h   |  2 +-
 src/libs/qtlibs/package.cpp         |  5 ++---
 src/libs/qtlibs/package.h           |  2 +-
 12 files changed, 19 insertions(+), 32 deletions(-)

diff --git a/src/libs/qtlibs/config.cpp b/src/libs/qtlibs/config.cpp
index 2400224..11e0de5 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 5f0df5f..17f0a4d 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 e0b579a..c444ae6 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 31e63a5..ca98375 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 d092cfa..39d9542 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 bfc1389..dab67a8 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 1cddfe0..09d9922 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 9d6cd4e..1c60a14 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 16238f0..1e11226 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 4186ee6..72a3e35 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 d857f14..9db1ae9 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 b11e775..fd7422f 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;
-- 
GitLab