File indexing completed on 2024-12-08 06:40:33

0001 /*
0002     SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 #include "kpropertiesdialogplugin.h"
0006 
0007 #include "kio_widgets_debug.h"
0008 #include "kpropertiesdialog.h"
0009 
0010 class KPropertiesDialogPluginPrivate
0011 {
0012 public:
0013     KPropertiesDialogPluginPrivate()
0014     {
0015     }
0016     ~KPropertiesDialogPluginPrivate()
0017     {
0018     }
0019 
0020     bool m_bDirty;
0021     int fontHeight;
0022 };
0023 
0024 KPropertiesDialogPlugin::KPropertiesDialogPlugin(QObject *_props)
0025     : QObject(_props)
0026     , properties(qobject_cast<KPropertiesDialog *>(_props))
0027     , d(new KPropertiesDialogPluginPrivate)
0028 {
0029     Q_ASSERT(properties);
0030     d->fontHeight = 2 * properties->fontMetrics().height();
0031     d->m_bDirty = false;
0032 }
0033 
0034 KPropertiesDialogPlugin::~KPropertiesDialogPlugin() = default;
0035 
0036 void KPropertiesDialogPlugin::setDirty(bool b)
0037 {
0038     d->m_bDirty = b;
0039 }
0040 
0041 bool KPropertiesDialogPlugin::isDirty() const
0042 {
0043     return d->m_bDirty;
0044 }
0045 
0046 void KPropertiesDialogPlugin::applyChanges()
0047 {
0048     qCWarning(KIO_WIDGETS) << "applyChanges() not implemented in page !";
0049 }
0050 
0051 int KPropertiesDialogPlugin::fontHeight() const
0052 {
0053     return d->fontHeight;
0054 }
0055 
0056 #include "moc_kpropertiesdialogplugin.cpp"