[Uml-devel] [Bug 58809] Image export via command line

Daniel Calviño Sánchez danxuliu at gmail.com
Thu Mar 30 21:36:14 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=58809         




------- Additional Comments From danxuliu gmail com  2006-03-31 04:56 -------
Created an attachment (id=15388)
 --> (http://bugs.kde.org/attachment.cgi?id=15388&action=view)
"Export all views" can keep view folders when exporting

Export all views can preserve view folders when exporting

First of all, the patch right now DOESN'T work because a bug. I've uploaded it
even when it doesn't work hoping that someone can spot the problem.

In the export all option now two more options can be set: the directory where
the images will be exported, and keep the tree structure used to store the
views in the document in the target directory, so if you have your diagrams in
folders created by you in the document, those folders are created when
exporting (Logical view, use case view and so on aren't created). The target
directory can be local or remote, thanks to KIO infrastructure. I think these
options don't overlap with http://bugs.kde.org/87252

I've also refactored a bit the code. All the exporting bulk code was extracted
to "UMLViewImageExporterModel" class. It can export an specific view, or all
the views in the current document. The methods in this class aren't interactive
(apart from asking passwords done by KIO classes). And they don't throw
exceptions, as requested ;) (however, "God kills a kitten everytime a return
value is used as an exception. Please, think of the kittens" :P Only a joke,
don't begin a flame with exceptions :) )

So, to get the parameters for the export (name of the images and extension, for
example), the classes "UMLViewImageExporter" and "UMLViewImageExporterAll" must
be used. The first, to export an specific view. The second, to export all the
views in the document.
A new dialog was added to get the "export all" parameters from the user. The
base interface is in exportallviewsdialogbase.ui, and its extended with the
class ExportAllViewsDialog, which adds a KFileFilterCombo to the dialog (it
wasn't added in the .ui file because QT Designer doesn't support it).

The "export all" can also be made from command line, but this way the export
isn't interactive.

I removed the ExportViewAction because after extracting and merging its code
with UMLView, the main method in the Action was only one line, and I thought it
would be better putting it as a slot in UMLApp.


I changed 'mimetype' strings to 'mimeType' in all the images related code,
because I think it's more consistent with the naming used. I added the GPL
license headers in new files, and updated the years in modified files. The
copyright and authors were also moved into the license section, as Oliver
Kellogg did in uml.cpp in the last commit.


BUG: when the "export all" is used from command line:
-if no directories need to be created, it works (for example, the target
directory exists and there are no views in folders, or the use-folders option
isn't used).
-if a direct child directory of another directory needs to be created, it's
created but the views can't be exported because they're empty.
-if a directory not direct child of an existing one needs to be created, the
directory is created and then the app crashes.

When exporting from GUI it works without problems. I don't know why this
happens, maybe an initialization problem, but I have no idea :( If instead of
using KIO::NetAccess, the QT classes such as QDir are used (as it was before,
if you look the previous code of UMLView), the problem doesn't happen (although
only with local files, remote ones still depend in KIO::NetAccess).


Answering to Alan Ezust, empirically I have found that if you make a change in
the .ui file, you must:
1-Install the application (well, at least, the .ui file) and not only build it.

2-If you've installed it, you must remove any old .ui file which can be lurking
somewhere. For example, if you install the app to /usr/local and you have a
previously installed version in /usr, KDE may get the old .ui file (the one at
/usr/share/apps/umbrello) instead of the newer one.




More information about the umbrello-devel mailing list