forked from teamnwah/openmw-tes3coop
(slightly) improved error reporting during save operations
This commit is contained in:
parent
23095ec3ec
commit
6f2c418a5c
3 changed files with 11 additions and 1 deletions
|
@ -2175,6 +2175,8 @@ CSMDoc::Document::Document (const std::vector<boost::filesystem::path>& files,
|
|||
|
||||
connect (&mSaving, SIGNAL (progress (int, int, int)), this, SLOT (progress (int, int, int)));
|
||||
connect (&mSaving, SIGNAL (done (int)), this, SLOT (operationDone (int)));
|
||||
connect (&mSaving, SIGNAL (reportMessage (const QString&, int)),
|
||||
this, SLOT (reportMessage (const QString&, int)));
|
||||
}
|
||||
|
||||
CSMDoc::Document::~Document()
|
||||
|
@ -2243,6 +2245,11 @@ void CSMDoc::Document::modificationStateChanged (bool clean)
|
|||
emit stateChanged (getState(), this);
|
||||
}
|
||||
|
||||
void CSMDoc::Document::reportMessage (const QString& message, int type)
|
||||
{
|
||||
/// \todo find a better way to get these messages to the user.
|
||||
std::cout << message.toUtf8().constData() << std::endl;
|
||||
}
|
||||
|
||||
void CSMDoc::Document::operationDone (int type)
|
||||
{
|
||||
|
|
|
@ -105,6 +105,8 @@ namespace CSMDoc
|
|||
|
||||
void modificationStateChanged (bool clean);
|
||||
|
||||
void reportMessage (const QString& message, int type);
|
||||
|
||||
void operationDone (int type);
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -95,8 +95,9 @@ void CSMDoc::Operation::executeStage()
|
|||
{
|
||||
mCurrentStage->first->perform (mCurrentStep++, messages);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
emit reportMessage (e.what(), mType);
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue