File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -482,7 +482,7 @@ WalletModel::UnlockContext::~UnlockContext()
482
482
}
483
483
}
484
484
485
- void WalletModel::UnlockContext::CopyFrom (const UnlockContext& rhs)
485
+ void WalletModel::UnlockContext::CopyFrom (UnlockContext& & rhs)
486
486
{
487
487
// Transfer context; old object no longer relocks wallet
488
488
*this = rhs;
Original file line number Diff line number Diff line change @@ -194,15 +194,18 @@ class WalletModel : public QObject
194
194
195
195
bool isValid () const { return valid; }
196
196
197
- // Copy operator and constructor transfer the context
198
- UnlockContext (const UnlockContext& obj) { CopyFrom (obj); }
199
- UnlockContext& operator =(const UnlockContext& rhs) { CopyFrom (rhs); return *this ; }
197
+ // Copy constructor is disabled.
198
+ UnlockContext (const UnlockContext&) = delete ;
199
+ // Move operator and constructor transfer the context
200
+ UnlockContext (UnlockContext&& obj) { CopyFrom (std::move (obj)); }
201
+ UnlockContext& operator =(UnlockContext&& rhs) { CopyFrom (std::move (rhs)); return *this ; }
200
202
private:
201
203
WalletModel *wallet;
202
204
bool valid;
203
205
mutable bool relock; // mutable, as it can be set to false by copying
204
206
205
- void CopyFrom (const UnlockContext& rhs);
207
+ UnlockContext& operator =(const UnlockContext&) = default ;
208
+ void CopyFrom (UnlockContext&& rhs);
206
209
};
207
210
208
211
UnlockContext requestUnlock ();
You can’t perform that action at this time.
0 commit comments