Warning, /frameworks/kconfig/autotests/kconfig_compiler/test5.cpp.ref is written in an unsupported language. File is not indexed.

0001 // This file is generated by kconfig_compiler_kf5 from test5.kcfg.
0002 // All changes you do to this file will be lost.
0003 
0004 #include "test5.h"
0005 
0006 #include <qglobal.h>
0007 #include <QFile>
0008 
0009 class Test5Helper
0010 {
0011   public:
0012     Test5Helper() : q(nullptr) {}
0013     ~Test5Helper() { delete q; q = nullptr; }
0014     Test5Helper(const Test5Helper&) = delete;
0015     Test5Helper& operator=(const Test5Helper&) = delete;
0016     Test5 *q;
0017 };
0018 Q_GLOBAL_STATIC(Test5Helper, s_globalTest5)
0019 Test5 *Test5::self()
0020 {
0021   if (!s_globalTest5()->q) {
0022     new Test5;
0023     s_globalTest5()->q->read();
0024   }
0025 
0026   return s_globalTest5()->q;
0027 }
0028 
0029 const char* const Test5::EnumButtonToString[] = { "right", "mid", "left" };
0030 
0031 Test5::Test5( QObject *parent )
0032   : KConfigSkeleton( QStringLiteral( "test4rc" ) )
0033 {
0034   setParent(parent);
0035   Q_ASSERT(!s_globalTest5()->q);
0036   s_globalTest5()->q = this;
0037   setCurrentGroup( QStringLiteral( "Foo" ) );
0038 
0039 QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black };
0040   KConfigSkeleton::ItemColor  *itemColor[4];
0041   itemColor[0] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #0" ), mColor[0], defaultColor[0] );
0042   addItem( itemColor[0], QStringLiteral( "Color0" ) );
0043   itemColor[1] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #1" ), mColor[1], defaultColor[1] );
0044   addItem( itemColor[1], QStringLiteral( "Color1" ) );
0045   itemColor[2] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #2" ), mColor[2], defaultColor[2] );
0046   addItem( itemColor[2], QStringLiteral( "Color2" ) );
0047   itemColor[3] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #3" ), mColor[3], defaultColor[3] );
0048   addItem( itemColor[3], QStringLiteral( "Color3" ) );
0049   QList<KConfigSkeleton::ItemEnum::Choice> valuesMouseAction;
0050   {
0051     KConfigSkeleton::ItemEnum::Choice choice;
0052     choice.name = QStringLiteral("Encrypt");
0053     valuesMouseAction.append( choice );
0054   }
0055   {
0056     KConfigSkeleton::ItemEnum::Choice choice;
0057     choice.name = QStringLiteral("Decrypt");
0058     valuesMouseAction.append( choice );
0059   }
0060   {
0061     KConfigSkeleton::ItemEnum::Choice choice;
0062     choice.name = QStringLiteral("CrashNBurn");
0063     valuesMouseAction.append( choice );
0064   }
0065   {
0066     KConfigSkeleton::ItemEnum::Choice choice;
0067     choice.name = QStringLiteral("PumpNDump");
0068     valuesMouseAction.append( choice );
0069   }
0070   KConfigSkeleton::ItemEnum  *itemMouseAction[3];
0071   itemMouseAction[0] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "right_mouse_action" ), mMouseAction[0], valuesMouseAction, Decrypt );
0072   itemMouseAction[0]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash'n Burn" ));
0073   addItem( itemMouseAction[0], QStringLiteral( "MouseActionright" ) );
0074   itemMouseAction[1] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "mid_mouse_action" ), mMouseAction[1], valuesMouseAction, Encrypt );
0075   itemMouseAction[1]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash'n Burn" ));
0076   addItem( itemMouseAction[1], QStringLiteral( "MouseActionmid" ) );
0077   itemMouseAction[2] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "left_mouse_action" ), mMouseAction[2], valuesMouseAction, PumpNDump );
0078   itemMouseAction[2]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash'n Burn" ));
0079   addItem( itemMouseAction[2], QStringLiteral( "MouseActionleft" ) );
0080   KConfigSkeleton::ItemString  *itemFooBar;
0081   itemFooBar = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "foo bar" ), mFooBar );
0082   addItem( itemFooBar, QStringLiteral( "FooBar" ) );
0083   KConfigSkeleton::ItemInt  *itemAge;
0084   itemAge = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Age" ), mAge, 35 );
0085   itemAge->setMinValue(8);
0086   itemAge->setMaxValue(88);
0087   addItem( itemAge, QStringLiteral( "Age" ) );
0088 }
0089 
0090 Test5::~Test5()
0091 {
0092   if (s_globalTest5.exists() && !s_globalTest5.isDestroyed()) {
0093     s_globalTest5()->q = nullptr;
0094   }
0095 }
0096