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