QTfrontend/game.cpp
branchflibqtfrontend
changeset 8306 50fe80adbfcb
parent 8304 620560c89284
child 8363 0b4ac686fc44
equal deleted inserted replaced
8304:620560c89284 8306:50fe80adbfcb
   407 }
   407 }
   408 
   408 
   409 void HWGame::sendCampaignVar(const QByteArray &varToSend)
   409 void HWGame::sendCampaignVar(const QByteArray &varToSend)
   410 {
   410 {
   411     QString varToFind(varToSend);
   411     QString varToFind(varToSend);
   412     QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + campaignTeam + ".hwt", QSettings::IniFormat, 0);
   412     QSettings teamfile("/Teams/" + campaignTeam + ".hwt", QSettings::IniFormat, 0);
   413     teamfile.setIniCodec("UTF-8");
   413     teamfile.setIniCodec("UTF-8");
   414     QString varValue = teamfile.value("Campaign " + campaign + "/" + varToFind, "").toString();
   414     QString varValue = teamfile.value("Campaign " + campaign + "/" + varToFind, "").toString();
   415     QByteArray command;
   415     QByteArray command;
   416     HWProto::addStringToBuffer(command, "V." + varValue);
   416     HWProto::addStringToBuffer(command, "V." + varValue);
   417     //RawSendIPC(command);
   417     //RawSendIPC(command);
   424         return;
   424         return;
   425 
   425 
   426     QString varToWrite = QString::fromUtf8(varVal.left(i));
   426     QString varToWrite = QString::fromUtf8(varVal.left(i));
   427     QString varValue = QString::fromUtf8(varVal.mid(i + 1));
   427     QString varValue = QString::fromUtf8(varVal.mid(i + 1));
   428 
   428 
   429     QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + campaignTeam + ".hwt", QSettings::IniFormat, 0);
   429     QSettings teamfile("/Teams/" + campaignTeam + ".hwt", QSettings::IniFormat, 0);
   430     teamfile.setIniCodec("UTF-8");
   430     teamfile.setIniCodec("UTF-8");
   431     teamfile.setValue("Campaign " + campaign + "/" + varToWrite, varValue);
   431     teamfile.setValue("Campaign " + campaign + "/" + varToWrite, varValue);
   432 }
   432 }
   433 
   433 
   434 
   434