Commit 00ce839d authored by wongk's avatar wongk Committed by Eike Ziller

If user cancels save file prompt, cancel entire action.

Task-Number: QTCREATORBUG-6440
Change-Id: I8807de53b1a05a0abd57c140dab5ba8df441efd5
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent a037609c
......@@ -527,11 +527,12 @@ void FileManager::updateExpectedState(const QString &fileName)
/*!
\fn QList<IFile*> FileManager::saveModifiedFilesSilently(const QList<IFile*> &files)
Tries to save the files listed in \a files . Returns the files that could not be saved.
Tries to save the files listed in \a files. The \a cancelled argument is set to true
if the user cancelled the dialog. Returns the files that could not be saved.
*/
QList<IFile *> FileManager::saveModifiedFilesSilently(const QList<IFile *> &files)
QList<IFile *> FileManager::saveModifiedFilesSilently(const QList<IFile *> &files, bool *cancelled)
{
return saveModifiedFiles(files, 0, true, QString());
return saveModifiedFiles(files, cancelled, true, QString());
}
/*!
......
......@@ -108,7 +108,7 @@ public:
QString getSaveAsFileName(IFile *file, const QString &filter = QString(),
QString *selectedFilter = 0);
QList<IFile *> saveModifiedFilesSilently(const QList<IFile *> &files);
QList<IFile *> saveModifiedFilesSilently(const QList<IFile *> &files, bool *cancelled = 0);
QList<IFile *> saveModifiedFiles(const QList<IFile *> &files,
bool *cancelled = 0,
const QString &message = QString(),
......
......@@ -1715,7 +1715,10 @@ bool ProjectExplorerPlugin::saveModifiedFiles()
QList<Core::IFile *> filesToSave = Core::ICore::instance()->fileManager()->modifiedFiles();
if (!filesToSave.isEmpty()) {
if (d->m_projectExplorerSettings.saveBeforeBuild) {
Core::ICore::instance()->fileManager()->saveModifiedFilesSilently(filesToSave);
bool cancelled = false;
Core::ICore::instance()->fileManager()->saveModifiedFilesSilently(filesToSave, &cancelled);
if (cancelled)
return false;
} else {
bool cancelled = false;
bool alwaysSave = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment