mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2025-06-09 07:34:07 +02:00
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:
parent
cb69944b5c
commit
7019f03e46
@ -22,7 +22,7 @@ signals:
|
|||||||
void hooked(const QUrl &);
|
void hooked(const QUrl &);
|
||||||
public:
|
public:
|
||||||
DesktopServiceHook() { QDesktopServices::setUrlHandler("oauthtest", this, "hooked"); }
|
DesktopServiceHook() { QDesktopServices::setUrlHandler("oauthtest", this, "hooked"); }
|
||||||
} desktopServiceHook;
|
};
|
||||||
|
|
||||||
static const QUrl sOAuthTestServer("oauthtest://someserver/owncloud");
|
static const QUrl sOAuthTestServer("oauthtest://someserver/owncloud");
|
||||||
|
|
||||||
@ -90,6 +90,7 @@ public:
|
|||||||
class OAuthTestCase : public QObject
|
class OAuthTestCase : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
DesktopServiceHook desktopServiceHook;
|
||||||
public:
|
public:
|
||||||
enum State { StartState, BrowserOpened, TokenAsked, CustomState } state = StartState;
|
enum State { StartState, BrowserOpened, TokenAsked, CustomState } state = StartState;
|
||||||
Q_ENUM(State);
|
Q_ENUM(State);
|
||||||
|
Loading…
Reference in New Issue
Block a user