--- a/QTfrontend/hwform.cpp Wed Feb 17 19:50:22 2010 +0000
+++ b/QTfrontend/hwform.cpp Wed Feb 17 20:03:25 2010 +0000
@@ -72,7 +72,9 @@
HWForm::HWForm(QWidget *parent)
: QMainWindow(parent), pnetserver(0), pRegisterServer(0), editedTeam(0), hwnet(0)
{
+#ifdef USE_XFIRE
xfire_init();
+#endif
gameSettings = new QSettings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat);
frontendEffects = gameSettings->value("video/frontendeffects", true).toBool();
@@ -207,15 +209,9 @@
GoBack();
}
+#ifdef USE_XFIRE
void HWForm::updateXfire(void)
{
-// xfire_setvalue(XFIRE_ROOM, "None");
-// xfire_setvalue(XFIRE_GAMEMODE, "Multiplayer");
-// xfire_setvalue(XFIRE_NICKNAME, ui.pageOptions->editNetNick->text().toAscii());
-// if(!host.compare("netserver.hedgewars.org"))
-// xfire_setvalue(XFIRE_SERVER, "Official server");
-// else
-// xfire_setvalue(XFIRE_SERVER, "Custom or local LAN server");
if(hwnet)
{
xfire_setvalue(XFIRE_SERVER, !hwnet->getHost().compare("netserver.hedgewars.org:46631") ? "Official server" : hwnet->getHost().toAscii());
@@ -253,6 +249,7 @@
}
xfire_update();
}
+#endif
void HWForm::onFrontendFullscreen(bool value)
{
@@ -408,7 +405,9 @@
void HWForm::OnPageShown(quint8 id, quint8 lastid)
{
+#ifdef USE_XFIRE
updateXfire();
+#endif
if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) {
QStringList tmNames = config->GetTeamsList();
TeamSelWidget* curTeamSelWidget;
@@ -941,7 +940,9 @@
void HWForm::closeEvent(QCloseEvent *event)
{
+#ifdef USE_XFIRE
xfire_free();
+#endif
config->SaveOptions();
event->accept();
}