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

0001 /*
0002     This file is part of the Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 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 "versionviewtool.hpp"
0010 
0011 // Kasten core
0012 #include <Kasten/Versionable>
0013 #include <Kasten/AbstractDocument>
0014 // KF
0015 #include <KLocalizedString>
0016 
0017 namespace Kasten {
0018 
0019 VersionViewTool::VersionViewTool()
0020 {
0021     setObjectName(QStringLiteral("Versions"));
0022 }
0023 
0024 VersionViewTool::~VersionViewTool() = default;
0025 
0026 QString VersionViewTool::title() const { return i18nc("@title:window", "Versions"); }
0027 
0028 void VersionViewTool::setTargetModel(AbstractModel* model)
0029 {
0030     mModel = model ? model->findBaseModelWithInterface<If::Versionable*>() : nullptr;
0031     Q_EMIT modelChanged(mModel);
0032 }
0033 
0034 }
0035 
0036 #include "moc_versionviewtool.cpp"