File indexing completed on 2024-11-24 05:00:23

0001 /*
0002     This file is part of KIMToy, an input method frontend for KDE
0003     SPDX-FileCopyrightText: 2011 Ni Hui <shuizhuyuanluo@126.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 */
0007 
0008 #include "app.h"
0009 #include "panel.h"
0010 #include <QSessionManager>
0011 #include <ibus.h>
0012 #include <locale.h>
0013 #include <stdlib.h>
0014 
0015 int main(int argc, char *argv[])
0016 {
0017     ibus_init();
0018     // we don't need im in this.
0019     qputenv("QT_IM_MODULE", "compose");
0020     App app(argc, argv);
0021 
0022     auto disableSessionManagement = [](QSessionManager &sm) {
0023         sm.setRestartHint(QSessionManager::RestartNever);
0024     };
0025 
0026     QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
0027     QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
0028 
0029     return app.exec();
0030 }