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
This commit is contained in:
Olivier Goffart 2018-06-29 10:06:57 +02:00 committed by Camila San
parent cb69944b5c
commit 7019f03e46
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4

View file

@ -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);