Commit 2bffe6fa authored by Volker Krause's avatar Volker Krause

Select a proper default for the home country

parent ab237af4
......@@ -95,6 +95,7 @@ private slots:
clearReservations(&resMgr);
TimelineModel model;
model.setHomeCountryIsoCode(QStringLiteral("DE"));
model.setReservationManager(&resMgr);
QSignalSpy insertSpy(&model, &TimelineModel::rowsInserted);
......@@ -146,6 +147,7 @@ private slots:
clearReservations(&resMgr);
TimelineModel model;
model.setHomeCountryIsoCode(QStringLiteral("DE"));
model.setReservationManager(&resMgr);
QCOMPARE(model.rowCount(), 1);
......
......@@ -17,6 +17,10 @@
#include "settings.h"
#include <KContacts/Address>
#include <QDebug>
#include <QLocale>
#include <QSettings>
Settings::Settings(QObject *parent)
......@@ -25,8 +29,9 @@ Settings::Settings(QObject *parent)
QSettings s;
s.beginGroup(QLatin1String("Settings"));
m_weatherEnabled = s.value(QLatin1String("WeatherForecastEnabled"), false).toBool();
// TODO configurable home country
m_homeCountry = s.value(QLatin1String("HomeCountry"), QStringLiteral("DE")).toString();
const auto currentCountry = KContacts::Address::countryToISO(QLocale::countryToString(QLocale().country())).toUpper();
m_homeCountry = s.value(QLatin1String("HomeCountry"), currentCountry).toString();
}
Settings::~Settings() = default;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment