2 #include <QHostAddress>
3 #include <QNetworkInterface>
14 #include "libmythbase/mythversion.h"
15 #include "libmythbase/version.h"
30 qRegisterMetaType<V2ConnectionInfo*>(
"V2ConnectionInfo");
31 qRegisterMetaType<V2CountryList*>(
"V2CountryList");
32 qRegisterMetaType<V2Country*>(
"V2Country");
33 qRegisterMetaType<V2LanguageList*>(
"V2LanguageList");
34 qRegisterMetaType<V2Language*>(
"V2Language");
35 qRegisterMetaType<V2DatabaseStatus*>(
"V2DatabaseStatus");
36 qRegisterMetaType<V2SystemEvent*>(
"V2SystemEvent");
37 qRegisterMetaType<V2SystemEventList*>(
"V2SystemEventList");
53 QString db(
"mythconverg");
63 throw( QString(
"Database test failed. Not saving database connection information." ));
104 pInfo->setConnected(connected);
109 bool haveSchema =
GetMythDB()->HaveSchema();
110 pInfo->setHaveDatabase(haveSchema);
115 pInfo->setSchemaVersion(QString(MYTH_DATABASE_VERSION).toInt());
118 pInfo->setSchemaVersion(0);
122 pInfo->setHaveDatabase(
false);
123 pInfo->setSchemaVersion(0);
136 QStringList locales = localesMap.values();
141 for (
const auto& country : qAsConst(locales))
143 const QString code = localesMap.key(country);
146 V2Country *pCountry = pList->AddNewCountry();
147 pCountry->setCode(code);
148 pCountry->setCountry(country);
149 pCountry->setNativeCountry(nativeCountry);
150 pCountry->setImage(QString(
"%1.png").arg(code.toLower()));
162 QStringList langs = langMap.values();
167 for (
const auto& nativeLang : qAsConst(langs))
169 const QString code = langMap.key(nativeLang);
172 V2Language *pLanguage = pList->AddNewLanguage();
173 pLanguage->setCode(code);
174 pLanguage->setLanguage(language);
175 pLanguage->setNativeLanguage(nativeLang);
176 pLanguage->setImage(QString(
"%1.png").arg(code));
188 QString protocol = Protocol;
190 if (protocol !=
"IPv4" && protocol !=
"IPv6")
195 QList<QHostAddress> list = QNetworkInterface::allAddresses();
196 QList<QHostAddress>::iterator it;
198 for (it = list.begin(); it != list.end(); ++it)
200 if (((*it).protocol() == QAbstractSocket::IPv4Protocol && protocol ==
"IPv4") ||
201 ((*it).protocol() == QAbstractSocket::IPv6Protocol && protocol ==
"IPv6") || protocol ==
"All")
203 it->setScopeId(QString());
204 oList.append((*it).toString());
219 QMap <QString, QString> settings;
221 QMap<QString, QString>::const_iterator it;
222 for (it = settings.constBegin(); it != settings.constEnd(); ++it)
225 event->setKey(it.key());
226 event->setLocalizedName(it.value());