File indexing completed on 2024-05-12 05:53:57
0001 0002 /* 0003 * Copyright (c) 2018 Sune Vuorela <sune@vuorela.dk> 0004 * 0005 * Permission is hereby granted, free of charge, to any person 0006 * obtaining a copy of this software and associated documentation 0007 * files (the "Software"), to deal in the Software without 0008 * restriction, including without limitation the rights to use, 0009 * copy, modify, merge, publish, distribute, sublicense, and/or sell 0010 * copies of the Software, and to permit persons to whom the 0011 * Software is furnished to do so, subject to the following 0012 * conditions: 0013 * 0014 * The above copyright notice and this permission notice shall be 0015 * included in all copies or substantial portions of the Software. 0016 * 0017 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 0018 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 0019 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 0020 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 0021 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 0022 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 0023 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 0024 * OTHER DEALINGS IN THE SOFTWARE. 0025 */ 0026 0027 #include <QGuiApplication> 0028 #include <QQmlApplicationEngine> 0029 #include <QIcon> 0030 #include "scanneradapter.h" 0031 #include "documentloader.h" 0032 #include "utils/standardpaths.h" 0033 #include "utils/dirmodel.h" 0034 0035 0036 0037 0038 int main(int argc, char *argv[]) 0039 { 0040 qputenv("QT_QUICK_CONTROLS_STYLE","Material"); 0041 QGuiApplication app(argc, argv); 0042 app.setWindowIcon(QIcon(":/appicon.svg")); 0043 app.setApplicationDisplayName("KookbookTouch"); 0044 app.setOrganizationName("kde.org"); 0045 app.setOrganizationDomain("kde.org"); 0046 app.setApplicationName("KookbookTouch"); 0047 qmlRegisterType<ScannerAdapter>("Kookbook",1,0,"Scanner"); 0048 qmlRegisterType<DocumentLoader>("Kookbook",1,0,"DocumentLoader"); 0049 0050 qmlRegisterType<DirModel>("Utils",1,0,"DirModel"); 0051 qmlRegisterSingletonType("Utils",1,0,"StandardPaths", StandardPaths::create); 0052 QQmlApplicationEngine engine(QUrl(QStringLiteral("qrc:/qml/main.qml"))); 0053 return app.exec(); 0054 0055 }