[atlantik-cvs] CVS: kdegames/atlantik/libatlantikclient atlantik_network.cpp, 1.95.2.5, 1.95.2.6
[email protected] Sun, 7 Dec 2003 23:37:34 +0100 (CET)
| Newsgroups | gmane.comp.kde.devel.atlantik |
|---|---|
| Message-ID | <[email protected]> |
Update of /home/kde/kdegames/atlantik/libatlantikclient
In directory office:/tmp/cvs-serv28329/libatlantikclient
Modified Files:
Tag: atlantik_3_3_branch
atlantik_network.cpp
Log Message:
network/core support for new configupdate behavior
Index: atlantik_network.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantikclient/atlantik_network.cpp,v
retrieving revision 1.95.2.5
retrieving revision 1.95.2.6
diff -u -d -r1.95.2.5 -r1.95.2.6
--- atlantik_network.cpp 23 Nov 2003 17:24:02 -0000 1.95.2.5
+++ atlantik_network.cpp 7 Dec 2003 22:37:31 -0000 1.95.2.6
@@ -26,6 +26,7 @@
#include <atlantic_core.h>
#include <auction.h>
+#include <configoption.h>
#include <estate.h>
#include <estategroup.h>
#include <game.h>
@@ -295,8 +296,25 @@
}
else if (e.tagName() == "configupdate")
{
- int gameId = -1;
+ int configId = -1;
+ a = e.attributeNode(QString("configid"));
+ if (!a.isNull())
+ {
+ configId = a.value().toInt();
+ ConfigOption *configOption;
+ if (!(configOption = m_atlanticCore->findConfigOption(configId)))
+ configOption = m_atlanticCore->newConfigOption( configId );
+
+ a = e.attributeNode(QString("name"));
+ if (configOption && !a.isNull())
+ configOption->setName(a.value());
+ a = e.attributeNode(QString("description"));
+ if (configOption && !a.isNull())
+ configOption->setDescription(a.value());
+ }
+
+ int gameId = -1;
a = e.attributeNode(QString("gameid"));
if (!a.isNull())
{
@@ -307,8 +325,8 @@
if (!eOption.isNull() && eOption.tagName() == "option")
emit gameOption(eOption.attributeNode(QString("title")).value(), eOption.attributeNode(QString("type")).value(), eOption.attributeNode(QString("value")).value(), eOption.attributeNode(QString("edit")).value(), eOption.attributeNode(QString("command")).value());
}
+ emit endConfigUpdate();
}
- emit endConfigUpdate();
}
else if (e.tagName() == "deletegame")
{