File indexing completed on 2024-09-22 05:16:06

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2006-2008 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "quitcontroller.hpp"
0010 
0011 // KF
0012 #include <KXmlGuiWindow>
0013 #include <KActionCollection>
0014 #include <KStandardAction>
0015 
0016 namespace Kasten {
0017 
0018 QuitController::QuitController(KXmlGuiWindow* window)
0019     : mMainWindow(window)
0020 {
0021     auto* quitAction = KStandardAction::quit(this, &QuitController::quit, this);
0022 
0023     mMainWindow->actionCollection()->addAction(quitAction->objectName(), quitAction);
0024 }
0025 
0026 void QuitController::setTargetModel(AbstractModel* model)
0027 {
0028     Q_UNUSED(model)
0029 }
0030 
0031 void QuitController::quit()
0032 {
0033     mMainWindow->close();
0034 //   Program->quit(); // TODO: think about a base program
0035 }
0036 
0037 }
0038 
0039 #include "moc_quitcontroller.cpp"