chore: implement fixes suggested by static analysis

These are potentially blocking the basic QR parsing and versioning features from landing.

See-Also: https://invent.kde.org/utilities/keysmith/-/merge_requests/57
See-Also: https://invent.kde.org/utilities/keysmith/-/merge_requests/58
master
Johan Ouwerkerk 2020-10-26 18:02:17 +01:00
parent dadd9d3973
commit 98f73c57a5
1 changed files with 12 additions and 6 deletions

View File

@ -35,17 +35,23 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QApplication app(argc, argv);
KLocalizedString::setApplicationDomain("keysmith");
QCoreApplication::setOrganizationName("KDE");
QCoreApplication::setOrganizationDomain("kde.org");
QCoreApplication::setApplicationName("Keysmith");
QCoreApplication::setOrganizationName(QStringLiteral("KDE"));
QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org"));
QCoreApplication::setApplicationName(QStringLiteral("Keysmith"));
QGuiApplication::setApplicationDisplayName(i18nc("@title", "Keysmith"));
QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
qmlRegisterUncreatableType<model::SimpleAccountListModel>("Keysmith.Models", 1, 0, "AccountListModel", "Use the Keysmith singleton to obtain an AccountListModel");
qmlRegisterUncreatableType<model::PasswordRequest>("Keysmith.Models", 1, 0, "PasswordRequestModel", "Use the Keysmith singleton to obtain an PasswordRequestModel");
qmlRegisterUncreatableType<model::AccountView>("Keysmith.Models", 1, 0, "Account", "Use an AccountListModel from the Keysmith singleton to obtain an Account");
qmlRegisterUncreatableType<model::SimpleAccountListModel>("Keysmith.Models", 1, 0, "AccountListModel",
QStringLiteral("Use the Keysmith singleton to obtain an AccountListModel")
);
qmlRegisterUncreatableType<model::PasswordRequest>("Keysmith.Models", 1, 0, "PasswordRequestModel",
QStringLiteral("Use the Keysmith singleton to obtain an PasswordRequestModel")
);
qmlRegisterUncreatableType<model::AccountView>("Keysmith.Models", 1, 0, "Account",
QStringLiteral("Use an AccountListModel from the Keysmith singleton to obtain an Account")
);
qmlRegisterType<model::AccountInput>("Keysmith.Models", 1, 0, "ValidatedAccountInput");
qmlRegisterType<model::SortedAccountsListModel>("Keysmith.Models", 1, 0, "SortedAccountListModel");
qmlRegisterType<model::AccountNameValidator>("Keysmith.Validators", 1, 0, "AccountNameValidator");