[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Carsten Pfeiffer pfeiffer at kde.org
Wed Jul 12 13:44:31 UTC 2006


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