Warning, /frameworks/kconfig/autotests/kconfig_compiler/test_signal.cpp.ref is written in an unsupported language. File is not indexed.
0001 // This file is generated by kconfig_compiler_kf6 from test_signal.kcfg.
0002 // All changes you do to this file will be lost.
0003
0004 #include "test_signal.h"
0005
0006 #include <qglobal.h>
0007 #include <QFile>
0008
0009 class TestSignalHelper
0010 {
0011 public:
0012 TestSignalHelper() : q(nullptr) {}
0013 ~TestSignalHelper() { delete q; q = nullptr; }
0014 TestSignalHelper(const TestSignalHelper&) = delete;
0015 TestSignalHelper& operator=(const TestSignalHelper&) = delete;
0016 TestSignal *q;
0017 };
0018 Q_GLOBAL_STATIC(TestSignalHelper, s_globalTestSignal)
0019 TestSignal *TestSignal::self()
0020 {
0021 if (!s_globalTestSignal()->q) {
0022 new TestSignal;
0023 s_globalTestSignal()->q->read();
0024 }
0025
0026 return s_globalTestSignal()->q;
0027 }
0028
0029 TestSignal::TestSignal( )
0030 : KConfigSkeleton( QStringLiteral( "kconfig_compiler_kf6_test_rc" ) )
0031 {
0032 Q_ASSERT(!s_globalTestSignal()->q);
0033 s_globalTestSignal()->q = this;
0034 KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&TestSignal::itemChanged);
0035
0036 setCurrentGroup( QStringLiteral( "Appearance" ) );
0037
0038 KConfigCompilerSignallingItem *itemEmoticonTheme;
0039 KConfigSkeleton::ItemString *innerItemEmoticonTheme;
0040 innerItemEmoticonTheme = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "emoticonTheme" ), mEmoticonTheme, QStringLiteral( "Default" ) );
0041 itemEmoticonTheme = new KConfigCompilerSignallingItem(innerItemEmoticonTheme, this, notifyFunction, signalEmoticonSettingsChanged);
0042 addItem( itemEmoticonTheme, QStringLiteral( "emoticonTheme" ) );
0043 KConfigCompilerSignallingItem *itemUseEmoticon;
0044 KConfigSkeleton::ItemBool *innerItemUseEmoticon;
0045 innerItemUseEmoticon = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useEmoticon" ), mUseEmoticon, true );
0046 itemUseEmoticon = new KConfigCompilerSignallingItem(innerItemUseEmoticon, this, notifyFunction, signalEmoticonSettingsChanged);
0047 addItem( itemUseEmoticon, QStringLiteral( "useEmoticon" ) );
0048 KConfigCompilerSignallingItem *itemEmoticonRequireSpace;
0049 KConfigSkeleton::ItemBool *innerItemEmoticonRequireSpace;
0050 innerItemEmoticonRequireSpace = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "emoticonRequireSpace" ), mEmoticonRequireSpace, true );
0051 itemEmoticonRequireSpace = new KConfigCompilerSignallingItem(innerItemEmoticonRequireSpace, this, notifyFunction, signalEmoticonSettingsChanged);
0052 addItem( itemEmoticonRequireSpace, QStringLiteral( "emoticonRequireSpace" ) );
0053 KConfigCompilerSignallingItem *itemStylePath;
0054 KConfigSkeleton::ItemString *innerItemStylePath;
0055 innerItemStylePath = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "stylePath" ), mStylePath );
0056 itemStylePath = new KConfigCompilerSignallingItem(innerItemStylePath, this, notifyFunction, signalStyleChanged);
0057 addItem( itemStylePath, QStringLiteral( "stylePath" ) );
0058 KConfigSkeleton::ItemString *itemStyleCSSVariant;
0059 itemStyleCSSVariant = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "styleVariant" ), mStyleCSSVariant );
0060 addItem( itemStyleCSSVariant, QStringLiteral( "StyleCSSVariant" ) );
0061 }
0062
0063 TestSignal::~TestSignal()
0064 {
0065 if (s_globalTestSignal.exists() && !s_globalTestSignal.isDestroyed()) {
0066 s_globalTestSignal()->q = nullptr;
0067 }
0068 }
0069
0070 bool TestSignal::usrSave()
0071 {
0072 const bool res = KConfigSkeleton::usrSave();
0073 if (!res) return false;
0074
0075 if (mSettingsChanged.contains(signalEmoticonSettingsChanged))
0076 Q_EMIT emoticonSettingsChanged();
0077 if (mSettingsChanged.contains(signalStyleChanged))
0078 Q_EMIT styleChanged(mStylePath, mStyleCSSVariant);
0079 mSettingsChanged.clear();
0080 return true;
0081 }
0082
0083 void TestSignal::itemChanged(quint64 signalFlag) {
0084 mSettingsChanged.insert(signalFlag);
0085
0086 }
0087
0088 #include "test_signal.moc"
0089