File indexing completed on 2024-04-28 15:19:31
0001 /* 0002 SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 #ifndef KCONFIG_AUTOTESTS_HELPER_H 0007 #define KCONFIG_AUTOTESTS_HELPER_H 0008 0009 #include <QLocale> 0010 0011 /** 0012 * @brief Helper to store the current default QLocale and resetting to it in the dtor. 0013 **/ 0014 class DefaultLocale 0015 { 0016 public: 0017 DefaultLocale() 0018 : m_defaultLocale() 0019 { 0020 } 0021 ~DefaultLocale() 0022 { 0023 QLocale::setDefault(m_defaultLocale); 0024 } 0025 0026 private: 0027 QLocale m_defaultLocale; 0028 }; 0029 0030 #endif