Warning, file /utilities/okteta/kasten/controllers/libconfigentries/directionconfigentry.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 This file is part of the Okteta Kasten module, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2023 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 #ifndef KASTEN_DIRECTIONCONFIGENTRY_HPP 0010 #define KASTEN_DIRECTIONCONFIGENTRY_HPP 0011 0012 // KF 0013 #include <KConfigGroup> 0014 0015 namespace Kasten { 0016 0017 enum Direction 0018 { 0019 Forward = 0, 0020 Backward = 1 0021 }; 0022 0023 } 0024 0025 template <> 0026 inline Kasten::Direction KConfigGroup::readEntry(const char *key, const Kasten::Direction &defaultValue) const 0027 { 0028 const QString entry = readEntry(key, QString()); 0029 const Kasten::Direction direction = 0030 (entry == QLatin1String("Forward")) ? Kasten::Forward : 0031 (entry == QLatin1String("Backward")) ? Kasten::Backward : 0032 /* else */ defaultValue; 0033 return direction; 0034 } 0035 0036 template <> 0037 inline void KConfigGroup::writeEntry(const char *key, const Kasten::Direction &value, 0038 KConfigBase::WriteConfigFlags flags) 0039 { 0040 const QString valueString = 0041 (value == Kasten::Forward) ? QLatin1String("Forward") : QLatin1String("Backward"); 0042 writeEntry(key, valueString, flags); 0043 } 0044 0045 #endif