[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Jul 10 16:41:07 UTC 2004
CVS commit by okellogg:
Umbrello is compilable with KDE 3.1 but if you have such an "ancient" KDE
version the new compressed-XMI file format will not work.
M +17 -11 umldoc.cpp 1.160
--- kdesdk/umbrello/umbrello/umldoc.cpp #1.159:1.160
@@ -55,5 +55,7 @@
#include <kprinter.h>
#include <ktar.h>
-#include <ktempdir.h>
+#if KDE_IS_VERSION(3,2,0)
+# include <ktempdir.h>
+#endif
#include <ktempfile.h>
@@ -308,4 +310,5 @@ bool UMLDoc::openDocument(const KURL& ur
// check if the xmi file is a compressed archive like tar.bzip2 or tar.gz
QString mimetype = KMimeType::findByPath(m_doc_url.path(0), 0, true)->name();
+# if KDE_IS_VERSION(3,1,90)
if (mimetype == "application/x-tgz" || mimetype == "application/x-tbz" || mimetype == "application/x-bzip2")
{
@@ -401,5 +404,7 @@ bool UMLDoc::openDocument(const KURL& ur
archive.close();
- } else {
+ } else
+# endif
+ {
// no, it seems to be an ordinary file
if( !file.open( IO_ReadOnly ) ) {
@@ -457,4 +462,5 @@ bool UMLDoc::saveDocument(const KURL& ur
initSaveTimer();
+#if KDE_IS_VERSION(3,2,0)
if (fileFormat == "tgz" || fileFormat == "bz2")
{
@@ -515,9 +521,6 @@ bool UMLDoc::saveDocument(const KURL& ur
// now we have to check, if we have to upload the file
if ( !url.isLocalFile() ) {
- uploaded = KIO::NetAccess::upload( tmp_tgz_file.name(), m_doc_url
- #if KDE_IS_VERSION(3,1,90)
- , UMLApp::app()
- #endif
- );
+ uploaded = KIO::NetAccess::upload( tmp_tgz_file.name(), m_doc_url,
+ UMLApp::app() );
}
@@ -528,10 +531,12 @@ bool UMLDoc::saveDocument(const KURL& ur
delete archive;
- } else {
+ } else
+#else
+ {
// save as normal uncompressed XMI
KTempFile tmpfile; // we need this tmp file if we are writing to a remote file
- // now check if we are writting to a local file
+ // now check if we are writing to a local file
if ( url.isLocalFile() )
{
@@ -552,7 +557,7 @@ bool UMLDoc::saveDocument(const KURL& ur
if ( !url.isLocalFile() ) {
uploaded = KIO::NetAccess::upload( tmpfile.name(), m_doc_url
- #if KDE_IS_VERSION(3,1,90)
+# if KDE_IS_VERSION(3,1,90)
, UMLApp::app()
- #endif
+# endif
);
}
@@ -561,4 +566,5 @@ bool UMLDoc::saveDocument(const KURL& ur
tmpfile.unlink();
}
+#endif
if( !uploaded )
{
More information about the umbrello-devel
mailing list