File indexing completed on 2024-12-22 04:52:48

0001 /*
0002    SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "abstractcalendar.h"
0008 #include "abstractdisplayinfo.h"
0009 #include <KConfigGroup>
0010 #include <KSharedConfig>
0011 using namespace LibImportWizard;
0012 
0013 AbstractCalendar::AbstractCalendar() = default;
0014 
0015 AbstractCalendar::~AbstractCalendar() = default;
0016 
0017 void AbstractCalendar::addImportInfo(const QString &log)
0018 {
0019     Q_ASSERT_X(mAbstractDisplayInfo, __FUNCTION__, "mAbstractDisplayInfo is not setting");
0020     if (mAbstractDisplayInfo) {
0021         mAbstractDisplayInfo->calendarImportInfo(log);
0022     }
0023 }
0024 
0025 void AbstractCalendar::addImportError(const QString &log)
0026 {
0027     Q_ASSERT_X(mAbstractDisplayInfo, __FUNCTION__, "mAbstractDisplayInfo is not setting");
0028     if (mAbstractDisplayInfo) {
0029         mAbstractDisplayInfo->calendarImportError(log);
0030     }
0031 }
0032 
0033 // eventviewsrc for calendar color for example
0034 void AbstractCalendar::addEvenViewConfig(const QString &groupName, const QString &key, const QString &value)
0035 {
0036     KSharedConfigPtr eventViewConfig = KSharedConfig::openConfig(QStringLiteral("eventviewsrc"));
0037     KConfigGroup group = eventViewConfig->group(groupName);
0038     group.writeEntry(key, value);
0039     group.sync();
0040 }
0041 
0042 #include "moc_abstractcalendar.cpp"