diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-11-20 16:22:22 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-11-20 16:22:22 +0100 |
commit | 0c861db7a201c813530e703257f286257f39872f (patch) | |
tree | 5ba0e10632ecef461f50bcc6e32512062932a193 /launcher/Usable.h | |
parent | eafeb64decf9fa3b4ae9617abc777698e51b24d0 (diff) | |
download | PrismLauncher-0c861db7a201c813530e703257f286257f39872f.tar.gz PrismLauncher-0c861db7a201c813530e703257f286257f39872f.tar.bz2 PrismLauncher-0c861db7a201c813530e703257f286257f39872f.zip |
NOISSUE Some happy little refactors
Diffstat (limited to 'launcher/Usable.h')
-rw-r--r-- | launcher/Usable.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/launcher/Usable.h b/launcher/Usable.h index 83dd083d..a3e880f3 100644 --- a/launcher/Usable.h +++ b/launcher/Usable.h @@ -3,6 +3,8 @@ #include <cstddef> #include <memory> +#include "QObjectPtr.h" + class Usable; /** @@ -14,11 +16,11 @@ class Usable { friend class UseLock; public: - std::size_t useCount() + std::size_t useCount() const { return m_useCount; } - bool isInUse() + bool isInUse() const { return m_useCount > 0; } @@ -43,7 +45,7 @@ private: class UseLock { public: - UseLock(std::shared_ptr<Usable> usable) + UseLock(shared_qobject_ptr<Usable> usable) : m_usable(usable) { // this doesn't use shared pointer use count, because that wouldn't be correct. this count is separate. @@ -54,5 +56,5 @@ public: m_usable->decrementUses(); } private: - std::shared_ptr<Usable> m_usable; + shared_qobject_ptr<Usable> m_usable; }; |