Qt XML Patterns File System Example: Do not bind to a null node index
authorTopi Reiniƶ <topi.reinio@nokia.com>
Wed, 4 Jul 2012 11:38:58 +0000 (13:38 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 11 Jul 2012 21:40:13 +0000 (23:40 +0200)
commitb2b97badcf0f4082c03b64873871e885daeb4f5c
treef8be2c077e08ce66ac283e838865faeec51ad0f8
parent0c1be7119f169d0a147cecc2d251ba172832dc77
Qt XML Patterns File System Example: Do not bind to a null node index

Adds a check for validity of the file node index before running an
XQuery.

In evaluateResult(), QXmlQuery binds to a QXmlNodeModelIndex variable
without checking if it's valid. This causes an assert to trigger if
the default directory that the example tries to open does not exist.
In this case, m_fileNode has the default (null) value when
evaluateResult() is invoked on QComboBox::currentIndexChanged()
signal.

Task-number: QTBUG-26081
Change-Id: I03c39939b57fcf658527ce3110fdc30d204de520
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
examples/xmlpatterns/filetree/mainwindow.cpp