Logo Search packages:      
Sourcecode: kanagram version File versions  Download package

void Kanagram::loadSettings (  ) [private]

load user settings loads language choice, sound settings, and auto-hide hint time

Definition at line 146 of file kanagram.cpp.

References m_arrowName, and m_hintHideTime.

Referenced by Kanagram(), and reloadSettings().

{
    QString hideTime = KanagramSettings::hintHideTime();
    if (hideTime[0].isDigit())
    {
        // because the choices are 0, 3, 5, 7, 9
        m_hintHideTime = (hideTime[0].digitValue() * 2) + 1;

        // reset to 0 if it's 1 to allow for the don't hide option
        if (m_hintHideTime == 1)
        {
            m_hintHideTime = 0;
        }
    }
    else
    {
        m_hintHideTime = 0;
    }

    if (KanagramSettings::dataLanguage().isEmpty())
    {
        QStringList userLanguagesCode = KGlobal::locale()->languageList();

        int i = 0;
        bool foundLanguage = false;
        while (i < userLanguagesCode.size() && !foundLanguage)
        {
            if (SharedKvtmlFiles::languages().contains(userLanguagesCode[i]))
            {
                foundLanguage = true;
            }
            else
            {
                ++i;
            }
        }
        // at this point either foundLanguage == true, or i > userLanguagesCode.size()

        KanagramSettings::setDataLanguage(foundLanguage ? userLanguagesCode[i] : "en");
    }

    m_useSounds = KanagramSettings::useSounds();
    m_arrowName = "basicarrow";
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index