From 7019f03e46f7f90c765be9dc7b2ee2061f3f86f5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 29 Jun 2018 10:06:57 +0200 Subject: [PATCH] TestOAuth: Don't have global static QObject Fix a strange warning seen on the log from the CI on Windows in https://github.com/owncloud/client/pull/6621 The test shows, at the beginning QObject::connect: No such signal DesktopServiceHook::destroyed(QObject*) And crashes at the and. My guess is that when QDesktopServices::setUrlHandler is called, the QMetaObject is not yet initialized But this is probably not the reason of the crash --- test/testoauth.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testoauth.cpp b/test/testoauth.cpp index 49eb3ce6c..72126c55e 100644 --- a/test/testoauth.cpp +++ b/test/testoauth.cpp @@ -22,7 +22,7 @@ signals: void hooked(const QUrl &); public: DesktopServiceHook() { QDesktopServices::setUrlHandler("oauthtest", this, "hooked"); } -} desktopServiceHook; +}; static const QUrl sOAuthTestServer("oauthtest://someserver/owncloud"); @@ -90,6 +90,7 @@ public: class OAuthTestCase : public QObject { Q_OBJECT + DesktopServiceHook desktopServiceHook; public: enum State { StartState, BrowserOpened, TokenAsked, CustomState } state = StartState; Q_ENUM(State);