Bug 130600 - command line switches: graphics export to directory does not work with relative paths
Summary: command line switches: graphics export to directory does not work with relati...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-11 10:32 UTC by Daniel Franke
Modified: 2006-07-12 17:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2006-07-11 10:32:06 UTC
Version:           1.5.3 (using KDE 3.5.3 Level "a" , unofficial build of SUSE )
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.16.13-4-smp

$> umbrello --export eps ../../doc/foo.xmi --directory .
umbrello: ERROR: Errors while exporting:
umbrello: ERROR: foo: There was a problem saving file: /foo.eps

Using an absolute path, e.g. 
$> umbrello --export eps ../../doc/foo.xmi --directory $HOME
works as expected.
Comment 1 Daniel Calviño Sánchez 2006-07-12 15:30:06 UTC
SVN commit 561550 by danxuliu:

Added support for relative paths when exporting images from command line
BUG: 130600

 M  +11 -1     main.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/main.cpp #561549:561550
@@ -182,7 +182,17 @@
     KURL directory;
     QCStringList directoryOpt = args->getOptionList("directory");
     if (directoryOpt.size() > 0) {
-        directory = KURL(directoryOpt.last());
+        QString directoryPath(directoryOpt.last());
+
+        if (KURL::isRelativeURL(directoryPath)) {
+            QString currentDirectory = KCmdLineArgs::cwd();
+            if (!currentDirectory.endsWith("/")) {
+                currentDirectory.append("/");
+            }
+            directory = KURL(currentDirectory, directoryPath);
+        } else {
+            directory = KURL(directoryPath);
+        }
     } else {
         directory = KURL(UMLApp::app()->getDocument()->URL().directory());
     }
Comment 2 Carsten Pfeiffer 2006-07-12 15:48:09 UTC
On Wednesday 12 July 2006 15:29, Daniel Calvi
Comment 3 Daniel Calviño Sánchez 2006-07-12 17:40:14 UTC
SVN commit 561582 by danxuliu:

Simplified creation of directory URL to export images to.
Thanks to Carsten Pfeiffer for the suggestion.
CCBUG: 130600

 M  +1 -11     main.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/main.cpp #561581:561582
@@ -182,17 +182,7 @@
     KURL directory;
     QCStringList directoryOpt = args->getOptionList("directory");
     if (directoryOpt.size() > 0) {
-        QString directoryPath(directoryOpt.last());
-
-        if (KURL::isRelativeURL(directoryPath)) {
-            QString currentDirectory = KCmdLineArgs::cwd();
-            if (!currentDirectory.endsWith("/")) {
-                currentDirectory.append("/");
-            }
-            directory = KURL(currentDirectory, directoryPath);
-        } else {
-            directory = KURL(directoryPath);
-        }
+        directory = KCmdLineArgs::makeURL(directoryOpt.last());
     } else {
         directory = KURL(UMLApp::app()->getDocument()->URL().directory());
     }