File indexing completed on 2024-05-19 05:19:22
0001 /* 0002 This file is part of KJots. 0003 0004 SPDX-FileCopyrightText: 1997 Christoph Neerfeld <Christoph.Neerfeld@home.ivm.de> 0005 2002, 2003 Aaron J. Seigo <aseigo@kde.org> 0006 2003 Stanislav Kljuhhin <crz@hot.ee> 0007 2005-2006 Jaison Lee <lee.jaison@gmail.com> 0008 0009 SPDX-License-Identifier: GPL-2.0-or-later 0010 */ 0011 0012 #include "KJotsMain.h" 0013 #include "aboutdata.h" 0014 0015 #include <KontactInterface/PimUniqueApplication> 0016 0017 #include <QCommandLineParser> 0018 #include <QDebug> 0019 0020 #include <KLocalizedString> 0021 #include <KSharedConfig> 0022 0023 0024 int main(int argc, char **argv) 0025 { 0026 KontactInterface::PimUniqueApplication app(argc, &argv); 0027 KLocalizedString::setApplicationDomain("kjots"); 0028 AboutData aboutData; 0029 app.setAboutData(aboutData); 0030 0031 QCommandLineParser *cmdArgs = app.cmdArgs(); 0032 const QStringList args = QApplication::arguments(); 0033 cmdArgs->process(args); 0034 aboutData.processCommandLine(cmdArgs); 0035 0036 if (!KontactInterface::PimUniqueApplication::start(args)) { 0037 qWarning() << "kjots is already running!"; 0038 exit(0); 0039 } 0040 0041 QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kjots"))); 0042 0043 auto jots = new KJotsMain; 0044 if (app.isSessionRestored()) { 0045 if (KJotsMain::canBeRestored(1)) { 0046 jots->restore(1); 0047 } 0048 } 0049 0050 jots->show(); 0051 jots->resize(jots->size()); 0052 return app.exec(); 0053 } 0054 0055 /* ex: set tabstop=4 softtabstop=4 shiftwidth=4 expandtab: */