/** * \brief Retrieves a string describing the location of the player. * * @return A string describing the locaiton of the player. */ inline QString getLocationString() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.value(getAddressSettingName()).toString() + " " + settings.value(getCitySettingName()).toString() + " " + settings.value(getStateSettingName()).toString() + ", " + settings.value(getZipCodeSettingName()).toString(); }
void DataStore::setPlayerLocation( const QString& streetAddress, const QString& city, const QString& state, const QString& zipcode ) { QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp()); settings.setValue(getAddressSettingName(), streetAddress); settings.setValue(getCitySettingName(), city); settings.setValue(getStateSettingName(), state); settings.setValue(getZipCodeSettingName(), zipcode); serverConnection->setPlayerLocation(streetAddress, city, state, zipcode); emit playerLocationSet(); }
/** * \brief Determines whether or not this player has a player id. * * \return True if the player has an id, false otherwise. */ static bool hasPlayerId(){ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return -1 != settings.value(getPlayerIdSettingName(), -1); }
/** * \brief Retrieves the state of the player. * * @return The state of the player. */ const QString getPlayerState() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.value(getPlayerStateSettingName()).toString(); }
/** * \brief Gets the set location zipcode. If no zipcode is currently set, * 0 is returned. * * \return The set location zipcode or 0 if no address is set. */ inline int getLocationZipcode() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.value(getZipCodeSettingName()).toInt(); }
/** * \brief Gets the set location state. If no location is currently set, * an empty string is returned. * * \return The set location state or an empty string if no address is set. */ inline QString getLocationState() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.value(getStateSettingName()).toString(); }
/** * \brief Determines whether or not the player has a password. * * @return True if the player has a password, false otherwise. */ inline bool hasPlayerPassword() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.value(getHasPlayerPasswordSettingName(), false).toBool(); }
/** * \brief Determines whether or not the player's location has been set. * * @return True if the player's location is set, false otherwise. */ inline bool hasLocation() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.contains(getAddressSettingName()); }
/** * \brief Gets the volume of the player. * * @return The volume of the player. */ inline qreal getPlayerVolume() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.value(getPlayerVolumeSettingName()).value<qreal>(); }
void DataStore::setPlayerState(const QString& newState){ QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp()); settings.setValue(getPlayerStateSettingName(), newState); changingPlayerState = true; serverConnection->setPlayerState(newState); }
void DataStore::setPlayerPassword(const QString& newPassword){ QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp()); settings.setValue(getHasPlayerPasswordSettingName(), true); serverConnection->setPlayerPassword(newPassword); emit playerPasswordSet(); }
void DataStore::removePlayerPassword(){ QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp()); settings.setValue(getHasPlayerPasswordSettingName(), false); serverConnection->removePlayerPassword(); emit playerPasswordRemoved(); }
/** * \brief Retreives the password for the player. * * @return The password for the player, if none is set a blank string is returned. */ inline QString getPlayerPassword() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.value(getPlayerPasswordSettingName()).toString(); }
/** * \brief Determines whether or not the player has a password. * * @return True if the player has a password, false otherwise. */ inline bool hasPlayerPassword() const{ QSettings settings( QSettings::UserScope, getSettingsOrg(), getSettingsApp()); return settings.contains(getPlayerPasswordSettingName()); }