~ubuntu-branches/ubuntu/trusty/manaplus/trusty

« back to all changes in this revision

Viewing changes to src/gui/serverdialog.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-10-07 10:26:14 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20131007102614-tg2zjdz8vmtl6n7i
Tags: 1.3.9.29-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
588
588
    }
589
589
 
590
590
    const std::string lang = getLangShort();
591
 
    const std::string description2 = "description_" + lang;
 
591
    const std::string description2("description_" + lang);
592
592
 
593
593
    for_each_xml_child_node(serverNode, rootNode)
594
594
    {
629
629
            version = strprintf(_("requires v%s"), version.c_str());
630
630
        }
631
631
 
632
 
        gcn::Font *const font = gui->getFont();
 
632
        const gcn::Font *const font = gui->getFont();
633
633
 
634
634
        for_each_xml_child_node(subNode, serverNode)
635
635
        {
707
707
    for (int i = 0; i < MAX_SERVERLIST; ++i)
708
708
    {
709
709
        const std::string index = toString(i);
710
 
        const std::string nameKey = "MostUsedServerDescName" + index;
711
 
        const std::string descKey = "MostUsedServerDescription" + index;
712
 
        const std::string hostKey = "MostUsedServerName" + index;
713
 
        const std::string typeKey = "MostUsedServerType" + index;
714
 
        const std::string portKey = "MostUsedServerPort" + index;
 
710
        const std::string nameKey("MostUsedServerDescName" + index);
 
711
        const std::string descKey("MostUsedServerDescription" + index);
 
712
        const std::string hostKey("MostUsedServerName" + index);
 
713
        const std::string typeKey("MostUsedServerType" + index);
 
714
        const std::string portKey("MostUsedServerPort" + index);
715
715
        const std::string onlineListUrlKey
716
 
            = "MostUsedServerOnlineList" + index;
 
716
            ("MostUsedServerOnlineList" + index);
717
717
 
718
718
        ServerInfo server;
719
719
        server.name = config.getValue(nameKey, "");
771
771
            continue;
772
772
 
773
773
        const std::string num = toString(savedServerCount);
774
 
        const std::string nameKey = "MostUsedServerDescName" + num;
775
 
        const std::string descKey = "MostUsedServerDescription" + num;
776
 
        const std::string hostKey = "MostUsedServerName" + num;
777
 
        const std::string typeKey = "MostUsedServerType" + num;
778
 
        const std::string portKey = "MostUsedServerPort" + num;
 
774
        const std::string nameKey("MostUsedServerDescName" + num);
 
775
        const std::string descKey("MostUsedServerDescription" + num);
 
776
        const std::string hostKey("MostUsedServerName" + num);
 
777
        const std::string typeKey("MostUsedServerType" + num);
 
778
        const std::string portKey("MostUsedServerPort" + num);
779
779
        const std::string onlineListUrlKey
780
 
            = "MostUsedServerOnlineList" + num;
 
780
            ("MostUsedServerOnlineList" + num);
781
781
 
782
782
        config.setValue(nameKey, toString(server.name));
783
783
        config.setValue(descKey, toString(server.description));
826
826
        else if (progress > 1.0f)
827
827
            progress = 1.0f;
828
828
 
829
 
        MutexLocker lock(&sd->mMutex);
 
829
        MutexLocker lock1(&sd->mMutex);
830
830
        sd->mDownloadStatus = DOWNLOADING_IN_PROGRESS;
831
831
        sd->mDownloadProgress = progress;
832
832
    }
834
834
    if (finished)
835
835
    {
836
836
        sd->loadServers();
837
 
        MutexLocker lock(&sd->mMutex);
 
837
        MutexLocker lock1(&sd->mMutex);
838
838
        sd->mDownloadStatus = DOWNLOADING_COMPLETE;
839
839
    }
840
840
 
841
841
    return 0;
842
842
}
843
843
 
844
 
void ServerDialog::updateServer(ServerInfo server, const int index)
 
844
void ServerDialog::updateServer(const ServerInfo &server, const int index)
845
845
{
846
846
    saveCustomServers(server, index);
847
847
}