mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-04 18:39:18 +02:00
repair usage of INI file for QSettings
This commit is contained in:
parent
0b4021ea43
commit
5f130872af
5 changed files with 23 additions and 19 deletions
|
@ -1,4 +1,4 @@
|
||||||
[INFO]
|
[INFO]
|
||||||
name=Interface
|
name=Interface
|
||||||
organizationName=High Fidelity
|
organizationName=High Fidelity
|
||||||
organizationDomain=highfidelity.io
|
organizationDomain=highfidelity.io
|
|
@ -158,11 +158,27 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
||||||
_pasteMode(false),
|
_pasteMode(false),
|
||||||
_logger(new FileLogger(this))
|
_logger(new FileLogger(this))
|
||||||
{
|
{
|
||||||
|
switchToResourcesParentIfRequired();
|
||||||
|
|
||||||
|
// read the ApplicationInfo.ini file for Name/Version/Domain information
|
||||||
|
QSettings applicationInfo("resources/info/ApplicationInfo.ini", QSettings::IniFormat);
|
||||||
|
|
||||||
|
// set the associated application properties
|
||||||
|
applicationInfo.beginGroup("INFO");
|
||||||
|
|
||||||
|
qDebug() << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
|
||||||
|
|
||||||
|
setApplicationName(applicationInfo.value("name").toString());
|
||||||
|
setApplicationVersion(BUILD_VERSION);
|
||||||
|
setOrganizationName(applicationInfo.value("organizationName").toString());
|
||||||
|
setOrganizationDomain(applicationInfo.value("organizationDomain").toString());
|
||||||
|
|
||||||
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||||
|
|
||||||
_myAvatar = _avatarManager.getMyAvatar();
|
_myAvatar = _avatarManager.getMyAvatar();
|
||||||
|
|
||||||
_applicationStartupTime = startup_time;
|
_applicationStartupTime = startup_time;
|
||||||
|
|
||||||
switchToResourcesParentIfRequired();
|
|
||||||
QFontDatabase::addApplicationFont("resources/styles/Inconsolata.otf");
|
QFontDatabase::addApplicationFont("resources/styles/Inconsolata.otf");
|
||||||
_window->setWindowTitle("Interface");
|
_window->setWindowTitle("Interface");
|
||||||
|
|
||||||
|
@ -212,21 +228,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
||||||
|
|
||||||
connect(&AccountManager::getInstance(), SIGNAL(authenticationRequired()),
|
connect(&AccountManager::getInstance(), SIGNAL(authenticationRequired()),
|
||||||
Menu::getInstance(), SLOT(loginForCurrentDomain()));
|
Menu::getInstance(), SLOT(loginForCurrentDomain()));
|
||||||
|
|
||||||
// read the ApplicationInfo.ini file for Name/Version/Domain information
|
|
||||||
QSettings applicationInfo("resources/info/ApplicationInfo.ini", QSettings::IniFormat);
|
|
||||||
|
|
||||||
// set the associated application properties
|
|
||||||
applicationInfo.beginGroup("INFO");
|
|
||||||
|
|
||||||
setApplicationName(applicationInfo.value("name").toString());
|
|
||||||
setApplicationVersion(BUILD_VERSION);
|
|
||||||
setOrganizationName(applicationInfo.value("organizationName").toString());
|
|
||||||
setOrganizationDomain(applicationInfo.value("organizationDomain").toString());
|
|
||||||
|
|
||||||
qDebug() << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
|
|
||||||
|
|
||||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
|
||||||
_settings = new QSettings(this);
|
_settings = new QSettings(this);
|
||||||
|
|
||||||
// Check to see if the user passed in a command line option for loading a local
|
// Check to see if the user passed in a command line option for loading a local
|
||||||
|
|
|
@ -745,6 +745,7 @@ void Menu::loginForCurrentDomain() {
|
||||||
|
|
||||||
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
||||||
loginDialog.setLayout(layout);
|
loginDialog.setLayout(layout);
|
||||||
|
loginDialog.setWindowFlags(Qt::Sheet);
|
||||||
|
|
||||||
QFormLayout* form = new QFormLayout();
|
QFormLayout* form = new QFormLayout();
|
||||||
layout->addLayout(form, 1);
|
layout->addLayout(form, 1);
|
||||||
|
|
|
@ -38,6 +38,7 @@ int main(int argc, const char * argv[]) {
|
||||||
|
|
||||||
int exitCode;
|
int exitCode;
|
||||||
{
|
{
|
||||||
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||||
Application app(argc, const_cast<char**>(argv), startup_time);
|
Application app(argc, const_cast<char**>(argv), startup_time);
|
||||||
|
|
||||||
qDebug( "Created QT Application.");
|
qDebug( "Created QT Application.");
|
||||||
|
|
|
@ -20,12 +20,12 @@ public:
|
||||||
OAuthAccessToken(const QJsonObject& jsonObject);
|
OAuthAccessToken(const QJsonObject& jsonObject);
|
||||||
OAuthAccessToken(const OAuthAccessToken& otherToken);
|
OAuthAccessToken(const OAuthAccessToken& otherToken);
|
||||||
OAuthAccessToken& operator=(const OAuthAccessToken& otherToken);
|
OAuthAccessToken& operator=(const OAuthAccessToken& otherToken);
|
||||||
|
|
||||||
bool isExpired() { return expiryTimestamp <= QDateTime::currentMSecsSinceEpoch(); }
|
bool isExpired() { return expiryTimestamp <= QDateTime::currentMSecsSinceEpoch(); }
|
||||||
|
|
||||||
QString token;
|
QString token;
|
||||||
QString refreshToken;
|
QString refreshToken;
|
||||||
quint64 expiryTimestamp;
|
qlonglong expiryTimestamp;
|
||||||
QString tokenType;
|
QString tokenType;
|
||||||
|
|
||||||
friend QDataStream& operator<<(QDataStream &out, const OAuthAccessToken& token);
|
friend QDataStream& operator<<(QDataStream &out, const OAuthAccessToken& token);
|
||||||
|
|
Loading…
Reference in a new issue