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.
79 lines
3.0 KiB
79 lines
3.0 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 <QtCore/QFile> |
|
|
|
class TestSignalHelper |
|
{ |
|
public: |
|
TestSignalHelper() : q(0) {} |
|
~TestSignalHelper() { delete q; } |
|
TestSignal *q; |
|
}; |
|
Q_GLOBAL_STATIC(TestSignalHelper, s_globalTestSignal) |
|
TestSignal *TestSignal::self() |
|
{ |
|
if (!s_globalTestSignal()->q) { |
|
new TestSignal; |
|
s_globalTestSignal()->q->readConfig(); |
|
} |
|
|
|
return s_globalTestSignal()->q; |
|
} |
|
|
|
TestSignal::TestSignal( ) |
|
: KConfigSkeleton( QLatin1String( "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( QLatin1String( "Appearance" ) ); |
|
|
|
KConfigCompilerSignallingItem *itemEmoticonTheme; |
|
itemEmoticonTheme = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "emoticonTheme" ), mEmoticonTheme, QLatin1String( "Default" ) ), this, notifyFunction, signalEmoticonSettingsChanged); |
|
addItem( itemEmoticonTheme, QLatin1String( "emoticonTheme" ) ); |
|
KConfigCompilerSignallingItem *itemUseEmoticon; |
|
itemUseEmoticon = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "useEmoticon" ), mUseEmoticon, true ), this, notifyFunction, signalEmoticonSettingsChanged); |
|
addItem( itemUseEmoticon, QLatin1String( "useEmoticon" ) ); |
|
KConfigCompilerSignallingItem *itemEmoticonRequireSpace; |
|
itemEmoticonRequireSpace = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "emoticonRequireSpace" ), mEmoticonRequireSpace, true ), this, notifyFunction, signalEmoticonSettingsChanged); |
|
addItem( itemEmoticonRequireSpace, QLatin1String( "emoticonRequireSpace" ) ); |
|
KConfigCompilerSignallingItem *itemStylePath; |
|
itemStylePath = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "stylePath" ), mStylePath ), this, notifyFunction, signalStyleChanged); |
|
addItem( itemStylePath, QLatin1String( "stylePath" ) ); |
|
KConfigSkeleton::ItemString *itemStyleCSSVariant; |
|
itemStyleCSSVariant = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "styleVariant" ), mStyleCSSVariant ); |
|
addItem( itemStyleCSSVariant, QLatin1String( "StyleCSSVariant" ) ); |
|
} |
|
|
|
TestSignal::~TestSignal() |
|
{ |
|
s_globalTestSignal()->q = 0; |
|
} |
|
|
|
bool TestSignal::usrWriteConfig() |
|
{ |
|
const bool res = KConfigSkeleton::usrWriteConfig(); |
|
if (!res) return false; |
|
|
|
if ( mSettingsChanged & signalEmoticonSettingsChanged ) |
|
emit emoticonSettingsChanged(); |
|
|
|
if ( mSettingsChanged & signalStyleChanged ) |
|
emit styleChanged(mStylePath, mStyleCSSVariant); |
|
|
|
mSettingsChanged = 0; |
|
return true; |
|
} |
|
|
|
void TestSignal::itemChanged(quint64 flags) { |
|
mSettingsChanged |= flags; |
|
} |
|
|
|
#include "test_signal.moc" |
|
|
|
|