File indexing completed on 2024-04-28 05:11:35
0001 /* 0002 SPDX-FileCopyrightText: 2010 Bertjan Broeksema <broeksema@kde.org> 0003 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #include "incidenceeditor-ng.h" 0009 0010 #include "incidenceeditor_debug.h" 0011 0012 using namespace IncidenceEditorNG; 0013 0014 IncidenceEditor::IncidenceEditor(QObject *parent) 0015 : QObject(parent) 0016 { 0017 } 0018 0019 IncidenceEditor::~IncidenceEditor() = default; 0020 0021 void IncidenceEditor::checkDirtyStatus() 0022 { 0023 if (!mLoadedIncidence) { 0024 qCDebug(INCIDENCEEDITOR_LOG) << "checkDirtyStatus called on an invalid incidence"; 0025 return; 0026 } 0027 0028 if (mLoadingIncidence) { 0029 // Still loading the incidence, ignore changes to widgets. 0030 return; 0031 } 0032 const bool dirty = isDirty(); 0033 if (mWasDirty != dirty) { 0034 mWasDirty = dirty; 0035 Q_EMIT dirtyStatusChanged(dirty); 0036 } 0037 } 0038 0039 bool IncidenceEditor::isValid() const 0040 { 0041 mLastErrorString.clear(); 0042 return true; 0043 } 0044 0045 QString IncidenceEditor::lastErrorString() const 0046 { 0047 return mLastErrorString; 0048 } 0049 0050 void IncidenceEditor::focusInvalidField() 0051 { 0052 } 0053 0054 KCalendarCore::IncidenceBase::IncidenceType IncidenceEditor::type() const 0055 { 0056 if (mLoadedIncidence) { 0057 return mLoadedIncidence->type(); 0058 } else { 0059 return KCalendarCore::IncidenceBase::TypeUnknown; 0060 } 0061 } 0062 0063 void IncidenceEditor::printDebugInfo() const 0064 { 0065 // implement this in derived classes. 0066 } 0067 0068 void IncidenceEditor::load(const Akonadi::Item &item) 0069 { 0070 Q_UNUSED(item) 0071 } 0072 0073 void IncidenceEditor::save(Akonadi::Item &item) 0074 { 0075 Q_UNUSED(item) 0076 } 0077 0078 #include "moc_incidenceeditor-ng.cpp"