|
|
|
@ -451,7 +451,7 @@ bool UMLDoc::openDocument(const KURL& url, const char* /*format =0*/) {
|
|
|
|
|
newDocument();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
status = loadFromXMI( *TQT_TQIODEVICE(&xmi_file), ENC_UNKNOWN );
|
|
|
|
|
status = loadFromXMI( xmi_file, ENC_UNKNOWN );
|
|
|
|
|
|
|
|
|
|
// close the extracted file and the temporary directory
|
|
|
|
|
xmi_file.close();
|
|
|
|
@ -476,9 +476,9 @@ bool UMLDoc::openDocument(const KURL& url, const char* /*format =0*/) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (filetype.endsWith(".mdl"))
|
|
|
|
|
status = Import_Rose::loadFromMDL(*TQT_TQIODEVICE(&file));
|
|
|
|
|
status = Import_Rose::loadFromMDL(file);
|
|
|
|
|
else
|
|
|
|
|
status = loadFromXMI( *TQT_TQIODEVICE(&file), ENC_UNKNOWN );
|
|
|
|
|
status = loadFromXMI( file, ENC_UNKNOWN );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file.close();
|
|
|
|
@ -565,7 +565,7 @@ bool UMLDoc::saveDocument(const KURL& url, const char * /* format */) {
|
|
|
|
|
KMessageBox::error(0, i18n("There was a problem saving file: %1").arg(d.path()), i18n("Save Error"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
saveToXMI(*TQT_TQIODEVICE(&file)); // save XMI to this file...
|
|
|
|
|
saveToXMI(file); // save XMI to this file...
|
|
|
|
|
file.close(); // ...and close it
|
|
|
|
|
|
|
|
|
|
// now add this file to the archive, but without the extension
|
|
|
|
@ -620,7 +620,7 @@ bool UMLDoc::saveDocument(const KURL& url, const char * /* format */) {
|
|
|
|
|
KMessageBox::error(0, i18n("There was a problem saving file: %1").arg(d.path()), i18n("Save Error"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
saveToXMI(*TQT_TQIODEVICE(&file)); // save the xmi stuff to it
|
|
|
|
|
saveToXMI(file); // save the xmi stuff to it
|
|
|
|
|
file.close();
|
|
|
|
|
tmpfile.close();
|
|
|
|
|
|
|
|
|
@ -2148,7 +2148,7 @@ void UMLDoc::addToUndoStack() {
|
|
|
|
|
buffer->open(IO_WriteOnly);
|
|
|
|
|
TQDataStream* undoData = new TQDataStream();
|
|
|
|
|
undoData->setDevice(buffer);
|
|
|
|
|
saveToXMI(*TQT_TQIODEVICE(buffer));
|
|
|
|
|
saveToXMI(*buffer);
|
|
|
|
|
buffer->close();
|
|
|
|
|
undoStack.prepend(undoData);
|
|
|
|
|
|
|
|
|
@ -2196,7 +2196,7 @@ void UMLDoc::loadUndoData() {
|
|
|
|
|
TQDataStream* undoData = undoStack.getFirst();
|
|
|
|
|
TQBuffer* buffer = static_cast<TQBuffer*>( undoData->device() );
|
|
|
|
|
buffer->open(IO_ReadOnly);
|
|
|
|
|
loadFromXMI(*TQT_TQIODEVICE(buffer));
|
|
|
|
|
loadFromXMI(*buffer);
|
|
|
|
|
buffer->close();
|
|
|
|
|
|
|
|
|
|
setModified(true, false);
|
|
|
|
@ -2235,7 +2235,7 @@ void UMLDoc::loadRedoData() {
|
|
|
|
|
redoStack.removeFirst();
|
|
|
|
|
TQBuffer* buffer = static_cast<TQBuffer*>( redoData->device() );
|
|
|
|
|
buffer->open(IO_ReadOnly);
|
|
|
|
|
loadFromXMI(*TQT_TQIODEVICE(buffer));
|
|
|
|
|
loadFromXMI(*buffer);
|
|
|
|
|
buffer->close();
|
|
|
|
|
|
|
|
|
|
setModified(true, false);
|
|
|
|
|