diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-08-23 16:57:18 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-08-24 15:54:15 +0200 |
commit | 4f338d2e707492e903c025e4db110e3f435ab063 (patch) | |
tree | d0787cad09d36f4146b129eb628ed1447be0cb20 /src/remoteobjects/qremoteobjectnode_p.h | |
parent | 8d496f7e2dbcfe1c91066ea33c206a171a8fe111 (diff) |
Get rid of calls to virtual methods inside constructors
Move the implementations of setRegistryUrl() and setHostUrl() virtual
methods to the non-virtual methods in the corresponding private classes
and call them from the constructors. Although in the context of the
current code the virtual method calls were legal and didn't lead to
anything unexpected, but generally it's not recommended (so the
codechecker complains) and can lead to issues in future, for example
when refactoring or changing the code.
Pick-to: 6.2
Task-number: QTBUG-95752
Change-Id: I13b97e3a1e179b0e5ce5bc7e9bbb9f5bb7166ebb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectnode_p.h')
-rw-r--r-- | src/remoteobjects/qremoteobjectnode_p.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/remoteobjects/qremoteobjectnode_p.h b/src/remoteobjects/qremoteobjectnode_p.h index 4c4e0b0..9bf9632 100644 --- a/src/remoteobjects/qremoteobjectnode_p.h +++ b/src/remoteobjects/qremoteobjectnode_p.h @@ -162,6 +162,8 @@ public: void handleReplicaConnection(const QString &name); void handleReplicaConnection(const QByteArray &sourceSignature, QConnectedReplicaImplementation *rep, QtROIoDeviceBase *connection); void initialize(); + bool setRegistryUrlNodeImpl(const QUrl ®istryAddr); + private: bool checkSignatures(const QByteArray &a, const QByteArray &b); @@ -201,6 +203,10 @@ public: ~QRemoteObjectHostBasePrivate() override; QReplicaImplementationInterface *handleNewAcquire(const QMetaObject *meta, QRemoteObjectReplica *instance, const QString &name) override; + bool setHostUrlBaseImpl(const QUrl &hostAddress, + QRemoteObjectHostBase::AllowedSchemas allowedSchemas = + QRemoteObjectHostBase::BuiltInSchemasOnly); + public: QRemoteObjectSourceIo *remoteObjectIo; ProxyInfo *proxyInfo = nullptr; @@ -212,6 +218,11 @@ class QRemoteObjectHostPrivate : public QRemoteObjectHostBasePrivate public: QRemoteObjectHostPrivate(); ~QRemoteObjectHostPrivate() override; + + bool setHostUrlHostImpl(const QUrl &hostAddress, + QRemoteObjectHostBase::AllowedSchemas allowedSchemas = + QRemoteObjectHostBase::BuiltInSchemasOnly); + Q_DECLARE_PUBLIC(QRemoteObjectHost); }; @@ -222,6 +233,9 @@ public: ~QRemoteObjectRegistryHostPrivate() override; QRemoteObjectSourceLocations remoteObjectAddresses() const override; QRegistrySource *registrySource; + + bool setRegistryUrlRegistryHostImpl(const QUrl ®istryUrl); + Q_DECLARE_PUBLIC(QRemoteObjectRegistryHost); }; |