File indexing completed on 2025-01-19 04:51:18

0001 /*******************************************************************
0002  KNotes -- Notes for the KDE project
0003 
0004  SPDX-FileCopyrightText: 1997-2013 The KNotes Developers
0005 
0006  SPDX-License-Identifier: GPL-2.0-or-later
0007 *******************************************************************/
0008 
0009 #include "application.h"
0010 #include "apps/knotesapp.h"
0011 
0012 #include <QCommandLineParser>
0013 
0014 Application::Application(int &argc, char **argv[])
0015     : KontactInterface::PimUniqueApplication(argc, argv)
0016 {
0017 }
0018 
0019 Application::~Application()
0020 {
0021     delete mMainWindow;
0022 }
0023 
0024 int Application::activate(const QStringList &args, const QString &workingDir)
0025 {
0026     Q_UNUSED(workingDir)
0027 
0028     QCommandLineParser *parser = cmdArgs();
0029     parser->process(args);
0030 
0031     if (!mMainWindow) {
0032         mMainWindow = new KNotesApp();
0033     } else {
0034         if (!parser->isSet(QStringLiteral("skip-note"))) {
0035             mMainWindow->newNote();
0036         }
0037     }
0038 
0039     return 0;
0040 }
0041 
0042 #include "moc_application.cpp"