File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 17
17
// todo: #31
18
18
19
19
#include < QLoggingCategory>
20
+ #include < QNetworkCookie>
20
21
21
22
namespace OCC {
22
23
@@ -31,4 +32,11 @@ CookieJar::~CookieJar()
31
32
{
32
33
}
33
34
35
+ CookieJar *CookieJar::clone (QObject *parent)
36
+ {
37
+ auto newJar = new CookieJar (parent);
38
+ newJar->setAllCookies (allCookies ());
39
+ return newJar;
40
+ }
41
+
34
42
} // namespace OCC
Original file line number Diff line number Diff line change 22
22
namespace OCC {
23
23
24
24
/* *
25
- * @brief The CookieJar class
25
+ * @brief A clonable cookie jar. This can be used when we don't want to spoil the original cookie jar.
26
26
* @ingroup libsync
27
27
*/
28
28
class OWNCLOUDSYNC_EXPORT CookieJar : public QNetworkCookieJar
@@ -32,8 +32,10 @@ class OWNCLOUDSYNC_EXPORT CookieJar : public QNetworkCookieJar
32
32
explicit CookieJar (QObject *parent = nullptr );
33
33
~CookieJar () override ;
34
34
35
- using QNetworkCookieJar::setAllCookies;
36
- using QNetworkCookieJar::allCookies;
35
+ /* *
36
+ * Return a clone of this cookie jar, with a copy of all cookies.
37
+ */
38
+ CookieJar *clone (QObject *parent = nullptr );
37
39
};
38
40
39
41
} // namespace OCC
Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ CheckServerJobFactory CheckServerJobFactory::createFromAccount(const AccountPtr
76
76
nam->setParent (parent);
77
77
// do we start with the old cookies or new
78
78
if (!(clearCookies && Theme::instance ()->connectionValidatorClearCookies ())) {
79
- const auto accountCookies = account->accessManager ()->ownCloudCookieJar ()->allCookies ();
80
- nam->ownCloudCookieJar ()-> setAllCookies (accountCookies );
79
+ const auto newJar = account->accessManager ()->ownCloudCookieJar ()->clone ();
80
+ nam->setCookieJar (newJar );
81
81
}
82
82
return CheckServerJobFactory (nam);
83
83
}
You can’t perform that action at this time.
0 commit comments