KXMLGuiClient doesn't except empty strings as xml files anymore

David Faure faure at kde.org
Fri Sep 19 23:10:47 BST 2008

On Saturday 13 September 2008, Andreas Pakulat wrote:
> Hi,
> I'm pretty sure this worked at some point, but unfortunately doesn't work
> anymore now. When calling KXMLGuiClient::setXMLFile with QString() I get a
> QASSERT from setDOMDocument because the QDomDocument is empty. When trying to
> change that by reverting r858664 I trigger the kfatal in setXML.
> The problem I have with this is that I've got a unit-test which basically
> doesn't need any GUI, but unfortunately the framework forces me to have one.
> Thus a mainwindow is created and setXMLFile is called.
> Looking through the svn logs I'm seeing this comment from Rafael:
> Let apps that are not providing their own rc file use the ui_standards.rc and do not assert
> here. It should be fine. This makes the xmlgui first tutorial to don't crash, what also is
> fine.
> Which leads me to assume that it should actually be possible to call setXMLFile
> without proper file, or is that meant to handle the case when setXMLFile is not
> called at all?

This is fixed now, isn't it? Rafael and I discussed this more and he (or I, I don't remember)
made the code more sensible (shows parsing errors, but accepts empty documents).

If not, please tell me exactly what you do and what you get  - or add a unit test to kxmlgui_unittest.cpp :)

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list