* ======================================================
*/
+#include <config.h>
+
#ifdef __GNUG__
#pragma implementation
#endif
-#include <config.h>
-
-#include <assert.h>
-#include <algorithm>
-#include <functional>
-
-#include "frontends/Alert.h"
#include "bufferlist.h"
#include "lyx_main.h"
-#include "support/FileInfo.h"
-#include "support/filetools.h"
-#include "support/lyxmanip.h"
-#include "support/lyxfunctional.h"
-#include "support/LAssert.h"
#include "lyx_gui_misc.h"
#include "lastfiles.h"
#include "debug.h"
#include "vc-backend.h"
#include "TextCache.h"
+#include "frontends/Alert.h"
+
+#include "support/FileInfo.h"
+#include "support/filetools.h"
+#include "support/lyxmanip.h"
+#include "support/lyxfunctional.h"
+#include "support/LAssert.h"
+
+#include <assert.h>
+#include <algorithm>
+#include <functional>
+
+
using std::vector;
using std::find;
using std::endl;
return false;
}
}
- return false;
+ return true;
}
bool BufferList::qwriteAll()
{
- bool are_unsaved = false;
- string unsaved;
+ string unsaved;
for (BufferStorage::iterator it = bstore.begin();
- it != bstore.end(); ++it) {
+ it != bstore.end(); ++it)
+ {
if (!(*it)->isLyxClean()) {
string fname;
if ((*it)->isUnnamed())
fname = OnlyFilename((*it)->fileName());
else
fname = MakeDisplayPath((*it)->fileName(), 50);
- are_unsaved = qwriteOne(*it, fname, unsaved);
+ if (!qwriteOne(*it, fname, unsaved)) // cancel the request!
+ return false;
}
}
- if (are_unsaved && lyxrc.exit_confirmation) {
+ if (!unsaved.empty() && lyxrc.exit_confirmation) {
return Alert::askQuestion(_("Some documents were not saved:"),
- unsaved, _("Exit anyway?"));
- }
+ unsaved, _("Exit anyway?"));
+ }
- return true;
+ return true;
}