on xenial help sign in
Use qml singeltonType for changelog
245e178Marius Gripsgard
plugins/Wizard/Changelog.cpp+1−1
@@ -48,11 +48,11 @@ void Changelog::readChangelog()
48 if (!f.open(QFile::ReadOnly | QFile::Text)) return;
48 if (!f.open(QFile::ReadOnly | QFile::Text)) return;
49 QTextStream in(&f);
49 QTextStream in(&f);
50 m_text = in.readAll();
50 m_text = in.readAll();
51+ Q_EMIT textChanged();
51}
52}
52
53
53void Changelog::watcherFileChanged()
54void Changelog::watcherFileChanged()
54{
55{
55 readChangelog();
56 readChangelog();
56− Q_EMIT textChanged();
57 m_fsWatcher.removePath(changelogPath());
57 m_fsWatcher.removePath(changelogPath());
58}
58}
plugins/Wizard/plugin.cpp+1−1
@@ -31,8 +31,8 @@ void WizardPlugin::registerTypes(const char *uri)
31 qmlRegisterType<PageList>(uri, 0, 1, "PageList");
31 qmlRegisterType<PageList>(uri, 0, 1, "PageList");
32 qmlRegisterSingletonType<System>(uri, 0, 1, "System", [](QQmlEngine*, QJSEngine*) -> QObject* { return new System; });
32 qmlRegisterSingletonType<System>(uri, 0, 1, "System", [](QQmlEngine*, QJSEngine*) -> QObject* { return new System; });
33 qmlRegisterSingletonType<Status>(uri, 0, 1, "Status", [](QQmlEngine*, QJSEngine*) -> QObject* { return new Status; });
33 qmlRegisterSingletonType<Status>(uri, 0, 1, "Status", [](QQmlEngine*, QJSEngine*) -> QObject* { return new Status; });
34+ qmlRegisterSingletonType<Changelog>(uri, 0, 1, "Changelog", [](QQmlEngine*, QJSEngine*) -> QObject* { return new Changelog; });
34 qmlRegisterType<TimeZoneLocationModel>(uri, 0, 1, "TimeZoneModel");
35 qmlRegisterType<TimeZoneLocationModel>(uri, 0, 1, "TimeZoneModel");
35 qmlRegisterType<KeyboardLayoutsModel>(uri, 0, 1, "KeyboardLayoutsModel");
36 qmlRegisterType<KeyboardLayoutsModel>(uri, 0, 1, "KeyboardLayoutsModel");
36 qmlRegisterType<LocalePlugin>(uri, 0, 1, "LocalePlugin");
37 qmlRegisterType<LocalePlugin>(uri, 0, 1, "LocalePlugin");
37− qmlRegisterType<Changelog>(uri, 0, 1, "Changelog");
38}
38}