code improvements to RCoreLocked

This commit is contained in:
mrexodia 2017-04-09 20:42:45 +02:00
parent 0dc64f8eac
commit b91ea94543
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 6 additions and 5 deletions

View File

@ -10,8 +10,9 @@ RCoreLocked::RCoreLocked(RCore *core)
} }
RCoreLocked::RCoreLocked(RCoreLocked&& o) RCoreLocked::RCoreLocked(RCoreLocked&& o)
: core(o.core)
{ {
core = o.core; o.core = nullptr;
} }
RCoreLocked::~RCoreLocked() RCoreLocked::~RCoreLocked()

View File

@ -27,8 +27,11 @@
#define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok) #define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok)
#define __question(x) (QMessageBox::Yes==QMessageBox::question (this, "Alert", QString(x), QMessageBox::Yes| QMessageBox::No)) #define __question(x) (QMessageBox::Yes==QMessageBox::question (this, "Alert", QString(x), QMessageBox::Yes| QMessageBox::No))
struct RCoreLocked class RCoreLocked
{ {
RCore* core;
public:
explicit RCoreLocked(RCore* core); explicit RCoreLocked(RCore* core);
RCoreLocked(const RCoreLocked&) = delete; RCoreLocked(const RCoreLocked&) = delete;
RCoreLocked& operator=(const RCoreLocked&) = delete; RCoreLocked& operator=(const RCoreLocked&) = delete;
@ -36,9 +39,6 @@ struct RCoreLocked
~RCoreLocked(); ~RCoreLocked();
operator RCore*() const; operator RCore*() const;
RCore* operator->() const; RCore* operator->() const;
private:
RCore* core;
}; };
#define QNOTUSED(x) do { (void)(x); } while ( 0 ); #define QNOTUSED(x) do { (void)(x); } while ( 0 );