forked from qt-creator/qt-creator
add errorString output argument to IFile::save()
this centralizes error reporting (in fact, in most cases it adds any in the first place). Task-number: QTCREATORBUG-1619
This commit is contained in:
@@ -138,7 +138,7 @@ bool ResourceEditorW::open(const QString &fileName /* = QString() */)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ResourceEditorFile::save(const QString &name /* = QString() */)
|
||||
bool ResourceEditorFile::save(QString *errorString, const QString &name /* = QString() */)
|
||||
{
|
||||
if (debugResourceEditorW)
|
||||
qDebug(">ResourceEditorW::save: %s", qPrintable(name));
|
||||
@@ -150,6 +150,7 @@ bool ResourceEditorFile::save(const QString &name /* = QString() */)
|
||||
|
||||
m_parent->m_resourceEditor->setFileName(actualName);
|
||||
if (!m_parent->m_resourceEditor->save()) {
|
||||
*errorString = m_parent->m_resourceEditor->errorMessage();
|
||||
m_parent->m_resourceEditor->setFileName(oldFileName);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user