mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
Fix move constructors and assignments of AudacityException classes
This commit is contained in:
parent
e9a4fc8354
commit
7927fe065f
@ -31,6 +31,7 @@ MessageBoxException &MessageBoxException::operator = ( MessageBoxException &&tha
|
||||
{
|
||||
caption = that.caption;
|
||||
if ( this != &that ) {
|
||||
AudacityException::operator=( std::move(that) );
|
||||
if (!moved)
|
||||
wxAtomicDec( sOutstandingMessages );
|
||||
|
||||
|
@ -27,8 +27,13 @@ public:
|
||||
|
||||
FileException(FileException&& that)
|
||||
: MessageBoxException(std::move(that))
|
||||
, cause{ that.cause }
|
||||
, fileName{ that.fileName }
|
||||
, renameTarget{ that.renameTarget }
|
||||
{}
|
||||
|
||||
FileException& operator= (FileException&&) PROHIBITED;
|
||||
|
||||
~FileException() override;
|
||||
|
||||
protected:
|
||||
|
@ -27,11 +27,18 @@ public:
|
||||
|
||||
InconsistencyException(InconsistencyException&& that)
|
||||
: MessageBoxException(std::move(that))
|
||||
, func{ that.func }
|
||||
, file{ that.file }
|
||||
, line{ that.line }
|
||||
{}
|
||||
InconsistencyException &operator = (InconsistencyException &&that)
|
||||
{
|
||||
if (this != &that)
|
||||
operator= (std::move(that));
|
||||
if (this != &that) {
|
||||
MessageBoxException::operator= (std::move(that));
|
||||
func = that.func;
|
||||
file = that.file;
|
||||
line = that.line;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,8 @@ public:
|
||||
: AudacityException{ std::move( that ) }
|
||||
{}
|
||||
|
||||
UserException& operator= (UserException&&) PROHIBITED;
|
||||
|
||||
~UserException() override;
|
||||
|
||||
void DelayedHandlerAction() override;
|
||||
|
@ -23,6 +23,6 @@ wxString NotYetAvailableException::ErrorMessage() const
|
||||
{
|
||||
return wxString::Format(
|
||||
_("This operation cannot be done until importation of %s completes."),
|
||||
mFileName.GetFullName()
|
||||
fileName.GetFullName()
|
||||
);
|
||||
}
|
||||
|
@ -21,14 +21,12 @@ public:
|
||||
: FileException{ Cause::Read, fileName } {}
|
||||
NotYetAvailableException(NotYetAvailableException &&that)
|
||||
: FileException( std::move( that ) ) {}
|
||||
NotYetAvailableException& operator= (NotYetAvailableException&&) PROHIBITED;
|
||||
~NotYetAvailableException();
|
||||
|
||||
protected:
|
||||
std::unique_ptr< AudacityException > Move() override;
|
||||
wxString ErrorMessage() const override;
|
||||
|
||||
private:
|
||||
wxFileName mFileName;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user