[Uml-devel] [Bug 130600] command line switches: graphics export to directory does not work with relative paths
Carsten Pfeiffer
pfeiffer at kde.org
Wed Jul 12 13:48:09 UTC 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=130600
------- Additional Comments From pfeiffer kde org 2006-07-12 15:48 -------
On Wednesday 12 July 2006 15:29, Daniel Calviño Sánchez wrote:
There is an easier way to do this:
KCmdLineArgs.makeURL(const char*)
Unfortunately, its API doc don't say anything about that :-(
> Added support for relative paths when exporting images from command line
> BUG: 130600
>
> M +11 -1 main.cpp
[...]
> - 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);
> + }
Cheers
Carsten
More information about the umbrello-devel
mailing list