Changeset View
Changeset View
Standalone View
Standalone View
smsapp/main.cpp
Show All 12 Lines | |||||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * Lesser General Public License for more details. | 14 | * Lesser General Public License for more details. | ||
15 | * | 15 | * | ||
16 | * You should have received a copy of the GNU Lesser General Public | 16 | * You should have received a copy of the GNU Lesser General Public | ||
17 | * License along with this library; if not, write to the Free Software | 17 | * License along with this library; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "conversationmodel.h" | ||||
22 | #include "conversationlistmodel.h" | ||||
23 | #include "kdeconnect-version.h" | ||||
24 | | ||||
21 | #include <QApplication> | 25 | #include <QApplication> | ||
22 | #include <QQmlApplicationEngine> | 26 | #include <QQmlApplicationEngine> | ||
23 | #include <QCommandLineParser> | 27 | #include <QCommandLineParser> | ||
24 | #include <QQmlContext> | 28 | #include <QQmlContext> | ||
25 | #include <KAboutData> | 29 | #include <KAboutData> | ||
26 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
27 | #include <KLocalizedContext> | 31 | #include <KLocalizedContext> | ||
28 | #include <KDBusService> | 32 | #include <KDBusService> | ||
29 | #include "conversationmodel.h" | | |||
30 | #include "kdeconnect-version.h" | | |||
31 | #include <QtQml> | 33 | #include <QtQml> | ||
32 | 34 | | |||
33 | int main(int argc, char *argv[]) | 35 | int main(int argc, char *argv[]) | ||
34 | { | 36 | { | ||
35 | QApplication app(argc, argv); | 37 | QApplication app(argc, argv); | ||
36 | KAboutData aboutData("org.kde.kdeconnect.sms", i18n("SMS Instant Messaging"), QStringLiteral(KDECONNECT_VERSION_STRING), i18n("KDE Connect SMS"), KAboutLicense::GPL, i18n("(c) 2018, Aleix Pol Gonzalez")); | 38 | KAboutData aboutData("org.kde.kdeconnect.sms", i18n("SMS Instant Messaging"), QStringLiteral(KDECONNECT_VERSION_STRING), i18n("KDE Connect SMS"), KAboutLicense::GPL, i18n("(c) 2018, Aleix Pol Gonzalez")); | ||
37 | aboutData.addAuthor(i18n("Aleix Pol Gonzalez"), {}, "aleixpol@kde.org"); | 39 | aboutData.addAuthor(i18n("Aleix Pol Gonzalez"), {}, "aleixpol@kde.org"); | ||
38 | KAboutData::setApplicationData(aboutData); | 40 | KAboutData::setApplicationData(aboutData); | ||
39 | 41 | | |||
40 | { | 42 | { | ||
41 | QCommandLineParser parser; | 43 | QCommandLineParser parser; | ||
42 | aboutData.setupCommandLine(&parser); | 44 | aboutData.setupCommandLine(&parser); | ||
43 | parser.addVersionOption(); | 45 | parser.addVersionOption(); | ||
44 | parser.addHelpOption(); | 46 | parser.addHelpOption(); | ||
45 | parser.process(app); | 47 | parser.process(app); | ||
46 | aboutData.processCommandLine(&parser); | 48 | aboutData.processCommandLine(&parser); | ||
47 | } | 49 | } | ||
48 | 50 | | |||
49 | KDBusService service(KDBusService::Unique); | 51 | KDBusService service(KDBusService::Unique); | ||
50 | 52 | | |||
53 | qmlRegisterType<OurSortFilterProxyModel>("org.kde.kdeconnect.sms", 1, 0, "QSortFilterProxyModel"); | ||||
51 | qmlRegisterType<ConversationModel>("org.kde.kdeconnect.sms", 1, 0, "ConversationModel"); | 54 | qmlRegisterType<ConversationModel>("org.kde.kdeconnect.sms", 1, 0, "ConversationModel"); | ||
55 | qmlRegisterType<ConversationListModel>("org.kde.kdeconnect.sms", 1, 0, "ConversationListModel"); | ||||
52 | 56 | | |||
53 | QQmlApplicationEngine engine; | 57 | QQmlApplicationEngine engine; | ||
54 | engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); | 58 | engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); | ||
55 | engine.load(QUrl("qrc:/qml/main.qml")); | 59 | engine.load(QUrl("qrc:/qml/main.qml")); | ||
56 | 60 | | |||
57 | return app.exec(); | 61 | return app.exec(); | ||
58 | } | 62 | } |