[Uml-devel] kdesdk/umbrello/umbrello
Jonathan Riddell
jri at jriddell.org
Mon Feb 10 08:33:04 UTC 2003
CVS commit by jriddell:
fixed bug 54183 autosave bug in default document
now saves to home directory rather than root directory
M +9 -6 umldoc.cpp 1.7
--- kdesdk/umbrello/umbrello/umldoc.cpp #1.6:1.7
@@ -29,4 +29,5 @@
#include <qtimer.h>
#include <qbuffer.h>
+#include <qdir.h>
#include <kapplication.h>
@@ -301,9 +302,9 @@ bool UMLDoc::saveDocument(const KURL& ur
if( !file.open( IO_WriteOnly ) ) {
- KMessageBox::error(0, i18n("There was a problem saving file: %1").arg(d.path()), i18n("Save Error"));
+ KMessageBox::error(0, i18n("There was a problem saving file: %1").arg(d.path()),
+ i18n("Save Error"));
return false;
}
- bool status = true;
- saveToXMI( file );
+ bool status = saveToXMI( file );
file.close();
if ( !url.isLocalFile() ) {
@@ -1618,13 +1619,15 @@ void UMLDoc::initSaveTimer() {
void UMLDoc::slotAutoSave() {
//Only save if modified.
- if( !m_modified )
+ if( !m_modified ) {
return;
+ }
KURL tempURL = doc_url;
if( tempURL.fileName() == i18n("Untitled") ) {
- tempURL.setFileName( i18n("autosave%1").arg(".xmi") );
+ tempURL.setPath( QDir::homeDirPath() + i18n("/autosave%1").arg(".xmi") );
saveDocument( tempURL );
m_modified = true;
- } else
+ } else {
saveDocument( tempURL );
+ }
return;
}
More information about the umbrello-devel
mailing list