Use static-global macro.
This commit is contained in:
parent
768c430bd2
commit
c01ea84e7b
@ -120,7 +120,7 @@ class Application : public QtSingleApplication {
|
||||
|
||||
// Returns pointer to "GOD" application singleton.
|
||||
inline static Application* instance() {
|
||||
return static_cast<Application*>(QCoreApplication::instance());
|
||||
return static_cast<Application*>(QCoreApplication::instance());
|
||||
}
|
||||
|
||||
public slots:
|
||||
|
@ -22,8 +22,8 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QAuthenticator>
|
||||
|
||||
Q_GLOBAL_STATIC(SilentNetworkAccessManager, qz_silent_acmanager)
|
||||
|
||||
QPointer<SilentNetworkAccessManager> SilentNetworkAccessManager::s_instance;
|
||||
|
||||
SilentNetworkAccessManager::SilentNetworkAccessManager(QObject* parent)
|
||||
: BaseNetworkAccessManager(parent) {
|
||||
@ -36,11 +36,7 @@ SilentNetworkAccessManager::~SilentNetworkAccessManager() {
|
||||
}
|
||||
|
||||
SilentNetworkAccessManager* SilentNetworkAccessManager::instance() {
|
||||
if (s_instance.isNull()) {
|
||||
s_instance = new SilentNetworkAccessManager(qApp);
|
||||
}
|
||||
|
||||
return s_instance;
|
||||
return qz_silent_acmanager();
|
||||
}
|
||||
|
||||
void SilentNetworkAccessManager::onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator) {
|
||||
|
@ -38,10 +38,7 @@ class SilentNetworkAccessManager : public BaseNetworkAccessManager {
|
||||
|
||||
public slots:
|
||||
// This cannot do any GUI stuff.
|
||||
void onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator);
|
||||
|
||||
private:
|
||||
static QPointer<SilentNetworkAccessManager> s_instance;
|
||||
void onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator);
|
||||
};
|
||||
|
||||
#endif // SILENTNETWORKACCESSMANAGER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user