constintres=KMessageBox::warningYesNoCancel(widget(),i18n("Do you want to save your changes to \"%1\" or discard them?",url().fileName()),i18n("Close Document"),KStandardGuiItem::save(),KStandardGuiItem::discard());
// Not all things are saveable (e.g. files opened from stdin, folders)
if(m_save->isEnabled()){
constintres=KMessageBox::warningYesNoCancel(widget(),i18n("Do you want to save your changes to \"%1\" or discard them?",url().fileName()),i18n("Close Document"),KStandardGuiItem::save(),KStandardGuiItem::discard());
switch(res){
caseKMessageBox::Yes:// Save
saveFile();
return!isModified();// Only allow closing if file was really saved
caseKMessageBox::No:// Discard
switch(res){
caseKMessageBox::Yes:// Save
saveFile();
return!isModified();// Only allow closing if file was really saved