You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
3.5 KiB
88 lines
3.5 KiB
// This file is generated by kconfig_compiler_kf5 from test_signal.kcfg. |
|
// All changes you do to this file will be lost. |
|
|
|
#include "test_signal.h" |
|
|
|
#include <qglobal.h> |
|
#include <QFile> |
|
|
|
class TestSignalHelper |
|
{ |
|
public: |
|
TestSignalHelper() : q(nullptr) {} |
|
~TestSignalHelper() { delete q; } |
|
TestSignalHelper(const TestSignalHelper&) = delete; |
|
TestSignalHelper& operator=(const TestSignalHelper&) = delete; |
|
TestSignal *q; |
|
}; |
|
Q_GLOBAL_STATIC(TestSignalHelper, s_globalTestSignal) |
|
TestSignal *TestSignal::self() |
|
{ |
|
if (!s_globalTestSignal()->q) { |
|
new TestSignal; |
|
s_globalTestSignal()->q->read(); |
|
} |
|
|
|
return s_globalTestSignal()->q; |
|
} |
|
|
|
TestSignal::TestSignal( ) |
|
: KConfigSkeleton( QStringLiteral( "kconfig_compiler_kf5_test_rc" ) ) |
|
, mSettingsChanged(0) |
|
{ |
|
Q_ASSERT(!s_globalTestSignal()->q); |
|
s_globalTestSignal()->q = this; |
|
KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&TestSignal::itemChanged); |
|
|
|
setCurrentGroup( QStringLiteral( "Appearance" ) ); |
|
|
|
KConfigCompilerSignallingItem *itemEmoticonTheme; |
|
KConfigSkeleton::ItemString *innerItemEmoticonTheme; |
|
innerItemEmoticonTheme = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "emoticonTheme" ), mEmoticonTheme, QStringLiteral( "Default" ) ); |
|
itemEmoticonTheme = new KConfigCompilerSignallingItem(innerItemEmoticonTheme, this, notifyFunction, signalEmoticonSettingsChanged); |
|
addItem( itemEmoticonTheme, QStringLiteral( "emoticonTheme" ) ); |
|
KConfigCompilerSignallingItem *itemUseEmoticon; |
|
KConfigSkeleton::ItemBool *innerItemUseEmoticon; |
|
innerItemUseEmoticon = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "useEmoticon" ), mUseEmoticon, true ); |
|
itemUseEmoticon = new KConfigCompilerSignallingItem(innerItemUseEmoticon, this, notifyFunction, signalEmoticonSettingsChanged); |
|
addItem( itemUseEmoticon, QStringLiteral( "useEmoticon" ) ); |
|
KConfigCompilerSignallingItem *itemEmoticonRequireSpace; |
|
KConfigSkeleton::ItemBool *innerItemEmoticonRequireSpace; |
|
innerItemEmoticonRequireSpace = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "emoticonRequireSpace" ), mEmoticonRequireSpace, true ); |
|
itemEmoticonRequireSpace = new KConfigCompilerSignallingItem(innerItemEmoticonRequireSpace, this, notifyFunction, signalEmoticonSettingsChanged); |
|
addItem( itemEmoticonRequireSpace, QStringLiteral( "emoticonRequireSpace" ) ); |
|
KConfigCompilerSignallingItem *itemStylePath; |
|
KConfigSkeleton::ItemString *innerItemStylePath; |
|
innerItemStylePath = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "stylePath" ), mStylePath ); |
|
itemStylePath = new KConfigCompilerSignallingItem(innerItemStylePath, this, notifyFunction, signalStyleChanged); |
|
addItem( itemStylePath, QStringLiteral( "stylePath" ) ); |
|
KConfigSkeleton::ItemString *itemStyleCSSVariant; |
|
itemStyleCSSVariant = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "styleVariant" ), mStyleCSSVariant ); |
|
addItem( itemStyleCSSVariant, QStringLiteral( "StyleCSSVariant" ) ); |
|
} |
|
|
|
TestSignal::~TestSignal() |
|
{ |
|
s_globalTestSignal()->q = nullptr; |
|
} |
|
|
|
bool TestSignal::usrSave() |
|
{ |
|
const bool res = KConfigSkeleton::usrSave(); |
|
if (!res) return false; |
|
|
|
if ( mSettingsChanged & signalEmoticonSettingsChanged ) |
|
Q_EMIT emoticonSettingsChanged(); |
|
if ( mSettingsChanged & signalStyleChanged ) |
|
Q_EMIT styleChanged(mStylePath, mStyleCSSVariant); |
|
mSettingsChanged = 0; |
|
return true; |
|
} |
|
|
|
void TestSignal::itemChanged(quint64 flags) { |
|
mSettingsChanged |= flags; |
|
|
|
} |
|
|
|
#include "test_signal.moc" |
|
|
|
|