diff options
author | hjk <hjk@qt.io> | 2021-12-06 05:11:04 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2021-12-06 17:10:49 +0000 |
commit | 104ea4accc8bf7d2e317c10638a299c3af267ede (patch) | |
tree | 8ab53d49a45cb72372a5294d272a7e43c815d661 /src/plugins/projectexplorer/deployablefile.h | |
parent | 8cb5c3cfdd07f98449d3df0a676c5026c33f6b7a (diff) |
Make some qHash and comparison operators overloads hidden friends
Restricts lookup scope more to necessary bits.
Change-Id: Ia42c95aaa70534843b7f6a90bfc56d2a1202c612
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/deployablefile.h')
-rw-r--r-- | src/plugins/projectexplorer/deployablefile.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/plugins/projectexplorer/deployablefile.h b/src/plugins/projectexplorer/deployablefile.h index e3760e4a02..cc3273623e 100644 --- a/src/plugins/projectexplorer/deployablefile.h +++ b/src/plugins/projectexplorer/deployablefile.h @@ -55,23 +55,21 @@ public: bool isExecutable() const; + friend bool operator==(const DeployableFile &d1, const DeployableFile &d2) + { + return d1.localFilePath() == d2.localFilePath() && d1.remoteDirectory() == d2.remoteDirectory(); + } + + friend bool operator!=(const DeployableFile &d1, const DeployableFile &d2) + { + return !(d1 == d2); + } + friend PROJECTEXPLORER_EXPORT Utils::QHashValueType qHash(const DeployableFile &d); + private: Utils::FilePath m_localFilePath; QString m_remoteDir; Type m_type = TypeNormal; }; - -inline bool operator==(const DeployableFile &d1, const DeployableFile &d2) -{ - return d1.localFilePath() == d2.localFilePath() && d1.remoteDirectory() == d2.remoteDirectory(); -} - -inline bool operator!=(const DeployableFile &d1, const DeployableFile &d2) -{ - return !(d1 == d2); -} - -PROJECTEXPLORER_EXPORT Utils::QHashValueType qHash(const DeployableFile &d); - } // namespace ProjectExplorer |