Hi.
I am developing a class that handles xml configuration files.
Now i have a function that gets an existing node and edits it, however i can't find the correct solution to get it working.
Here is my code:
{
QDomElement command
= game.
firstChildElement("command");
QDomElement launch
= command.
firstChildElement("launch");
qDebug() << launch.text();
launch.setNodeValue("somevalue");
qDebug() << launch.text();
}
void XfireGamesList::updateConfiguredGame(QString pName, QString pLaunchExe, QString pDetectExe)
{
QDomElement game = getConfiguredGame(pName);
QDomElement command = game.firstChildElement("command");
QDomElement launch = command.firstChildElement("launch");
qDebug() << launch.text();
launch.setNodeValue("somevalue");
qDebug() << launch.text();
}
To copy to clipboard, switch view to plain text mode
getConfiguredGame() returns a QDomElement representing this node for example:
<game name="The name of a certain game">
<command>
<launch>SOME_PATH</launch>
<detect>SOME_PATH</detect>
</command>
</game>
<game name="The name of a certain game">
<command>
<launch>SOME_PATH</launch>
<detect>SOME_PATH</detect>
</command>
</game>
To copy to clipboard, switch view to plain text mode
The function isn't able to edit the node values, and the debugging calls outputs "SOME_PATH" twice, so the node should be correct since it returns the correct values, but editing fails.
Does someone know why?
Thanks in advance.
Bookmarks