Warning, /frameworks/kconfig/autotests/kconfig_compiler/test4.cpp.ref is written in an unsupported language. File is not indexed.
0001 // This file is generated by kconfig_compiler_kf6 from test4.kcfg. 0002 // All changes you do to this file will be lost. 0003 0004 #include "test4.h" 0005 0006 #include <qglobal.h> 0007 #include <QFile> 0008 0009 class Test4Helper 0010 { 0011 public: 0012 Test4Helper() : q(nullptr) {} 0013 ~Test4Helper() { delete q; q = nullptr; } 0014 Test4Helper(const Test4Helper&) = delete; 0015 Test4Helper& operator=(const Test4Helper&) = delete; 0016 Test4 *q; 0017 }; 0018 Q_GLOBAL_STATIC(Test4Helper, s_globalTest4) 0019 Test4 *Test4::self() 0020 { 0021 if (!s_globalTest4()->q) { 0022 new Test4; 0023 s_globalTest4()->q->read(); 0024 } 0025 0026 return s_globalTest4()->q; 0027 } 0028 0029 const char* const Test4::EnumButton::enumToString[] = { "right", "mid", "left" }; 0030 0031 Test4::Test4( ) 0032 : KConfigSkeleton( QStringLiteral( "test4rc" ) ) 0033 { 0034 Q_ASSERT(!s_globalTest4()->q); 0035 s_globalTest4()->q = this; 0036 setCurrentGroup( QStringLiteral( "Foo" ) ); 0037 0038 QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; 0039 KConfigSkeleton::ItemColor *itemColor[4]; 0040 itemColor[0] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #0" ), mColor[0], defaultColor[0] ); 0041 addItem( itemColor[0], QStringLiteral( "Color0" ) ); 0042 itemColor[1] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #1" ), mColor[1], defaultColor[1] ); 0043 addItem( itemColor[1], QStringLiteral( "Color1" ) ); 0044 itemColor[2] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #2" ), mColor[2], defaultColor[2] ); 0045 addItem( itemColor[2], QStringLiteral( "Color2" ) ); 0046 itemColor[3] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #3" ), mColor[3], defaultColor[3] ); 0047 addItem( itemColor[3], QStringLiteral( "Color3" ) ); 0048 QList<KConfigSkeleton::ItemEnum::Choice> valuesMouseAction; 0049 { 0050 KConfigSkeleton::ItemEnum::Choice choice; 0051 choice.name = QStringLiteral("Encrypt"); 0052 valuesMouseAction.append( choice ); 0053 } 0054 { 0055 KConfigSkeleton::ItemEnum::Choice choice; 0056 choice.name = QStringLiteral("Decrypt"); 0057 valuesMouseAction.append( choice ); 0058 } 0059 { 0060 KConfigSkeleton::ItemEnum::Choice choice; 0061 choice.name = QStringLiteral("CrashNBurn"); 0062 valuesMouseAction.append( choice ); 0063 } 0064 { 0065 KConfigSkeleton::ItemEnum::Choice choice; 0066 choice.name = QStringLiteral("PumpNDump"); 0067 valuesMouseAction.append( choice ); 0068 } 0069 KConfigSkeleton::ItemEnum *itemMouseAction[3]; 0070 itemMouseAction[0] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "right_mouse_action" ), mMouseAction[0], valuesMouseAction, EnumMouseAction::Decrypt ); 0071 itemMouseAction[0]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash and Burn" )); 0072 addItem( itemMouseAction[0], QStringLiteral( "MouseActionright" ) ); 0073 itemMouseAction[1] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "mid_mouse_action" ), mMouseAction[1], valuesMouseAction, EnumMouseAction::Encrypt ); 0074 itemMouseAction[1]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash and Burn" )); 0075 addItem( itemMouseAction[1], QStringLiteral( "MouseActionmid" ) ); 0076 itemMouseAction[2] = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "left_mouse_action" ), mMouseAction[2], valuesMouseAction, EnumMouseAction::PumpNDump ); 0077 itemMouseAction[2]->setValueForChoice(QStringLiteral( "CrashNBurn" ), QStringLiteral( "Crash and Burn" )); 0078 addItem( itemMouseAction[2], QStringLiteral( "MouseActionleft" ) ); 0079 KConfigSkeleton::ItemColor *itemGrayColor[11]; 0080 itemGrayColor[0] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #0" ), mGrayColor[0], 0081 QColor::fromRgbF(0 / 10.0, 0 / 10.0, 0 / 10.0) 0082 ); 0083 addItem( itemGrayColor[0], QStringLiteral( "GrayColor0" ) ); 0084 itemGrayColor[1] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #1" ), mGrayColor[1], 0085 QColor::fromRgbF(1 / 10.0, 1 / 10.0, 1 / 10.0) 0086 ); 0087 addItem( itemGrayColor[1], QStringLiteral( "GrayColor1" ) ); 0088 itemGrayColor[2] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #2" ), mGrayColor[2], 0089 QColor::fromRgbF(2 / 10.0, 2 / 10.0, 2 / 10.0) 0090 ); 0091 addItem( itemGrayColor[2], QStringLiteral( "GrayColor2" ) ); 0092 itemGrayColor[3] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #3" ), mGrayColor[3], 0093 QColor::fromRgbF(3 / 10.0, 3 / 10.0, 3 / 10.0) 0094 ); 0095 addItem( itemGrayColor[3], QStringLiteral( "GrayColor3" ) ); 0096 itemGrayColor[4] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #4" ), mGrayColor[4], 0097 QColor::fromRgbF(4 / 10.0, 4 / 10.0, 4 / 10.0) 0098 ); 0099 addItem( itemGrayColor[4], QStringLiteral( "GrayColor4" ) ); 0100 itemGrayColor[5] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #5" ), mGrayColor[5], 0101 QColor::fromRgbF(5 / 10.0, 5 / 10.0, 5 / 10.0) 0102 ); 0103 addItem( itemGrayColor[5], QStringLiteral( "GrayColor5" ) ); 0104 itemGrayColor[6] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #6" ), mGrayColor[6], 0105 QColor::fromRgbF(6 / 10.0, 6 / 10.0, 6 / 10.0) 0106 ); 0107 addItem( itemGrayColor[6], QStringLiteral( "GrayColor6" ) ); 0108 itemGrayColor[7] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #7" ), mGrayColor[7], 0109 QColor::fromRgbF(7 / 10.0, 7 / 10.0, 7 / 10.0) 0110 ); 0111 addItem( itemGrayColor[7], QStringLiteral( "GrayColor7" ) ); 0112 itemGrayColor[8] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #8" ), mGrayColor[8], 0113 QColor::fromRgbF(8 / 10.0, 8 / 10.0, 8 / 10.0) 0114 ); 0115 addItem( itemGrayColor[8], QStringLiteral( "GrayColor8" ) ); 0116 itemGrayColor[9] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #9" ), mGrayColor[9], 0117 QColor::fromRgbF(9 / 10.0, 9 / 10.0, 9 / 10.0) 0118 ); 0119 addItem( itemGrayColor[9], QStringLiteral( "GrayColor9" ) ); 0120 itemGrayColor[10] = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "gray color #10" ), mGrayColor[10], 0121 QColor::fromRgbF(10 / 10.0, 10 / 10.0, 10 / 10.0) 0122 ); 0123 addItem( itemGrayColor[10], QStringLiteral( "GrayColor10" ) ); 0124 KConfigSkeleton::ItemString *itemColorString[11]; 0125 itemColorString[0] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #0" ), mColorString[0], 0126 QString::number(0) 0127 ); 0128 addItem( itemColorString[0], QStringLiteral( "ColorString0" ) ); 0129 itemColorString[1] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #1" ), mColorString[1], 0130 QString::number(1) 0131 ); 0132 addItem( itemColorString[1], QStringLiteral( "ColorString1" ) ); 0133 itemColorString[2] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #2" ), mColorString[2], 0134 QString::number(2) 0135 ); 0136 addItem( itemColorString[2], QStringLiteral( "ColorString2" ) ); 0137 itemColorString[3] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #3" ), mColorString[3], 0138 QString::number(3) 0139 ); 0140 addItem( itemColorString[3], QStringLiteral( "ColorString3" ) ); 0141 itemColorString[4] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #4" ), mColorString[4], 0142 QString::number(4) 0143 ); 0144 addItem( itemColorString[4], QStringLiteral( "ColorString4" ) ); 0145 itemColorString[5] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #5" ), mColorString[5], 0146 QString::number(5) 0147 ); 0148 addItem( itemColorString[5], QStringLiteral( "ColorString5" ) ); 0149 itemColorString[6] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #6" ), mColorString[6], 0150 QString::number(6) 0151 ); 0152 addItem( itemColorString[6], QStringLiteral( "ColorString6" ) ); 0153 itemColorString[7] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #7" ), mColorString[7], 0154 QString::number(7) 0155 ); 0156 addItem( itemColorString[7], QStringLiteral( "ColorString7" ) ); 0157 itemColorString[8] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #8" ), mColorString[8], 0158 QString::number(8) 0159 ); 0160 addItem( itemColorString[8], QStringLiteral( "ColorString8" ) ); 0161 itemColorString[9] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #9" ), mColorString[9], 0162 QString::number(9) 0163 ); 0164 addItem( itemColorString[9], QStringLiteral( "ColorString9" ) ); 0165 itemColorString[10] = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "color string #10" ), mColorString[10], 0166 QString::number(10) 0167 ); 0168 addItem( itemColorString[10], QStringLiteral( "ColorString10" ) ); 0169 KConfigSkeleton::ItemString *itemFooBar; 0170 itemFooBar = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "foo bar" ), mFooBar ); 0171 addItem( itemFooBar, QStringLiteral( "FooBar" ) ); 0172 KConfigSkeleton::ItemInt *itemAge; 0173 itemAge = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Age" ), mAge, 35 ); 0174 itemAge->setMinValue(8); 0175 itemAge->setMaxValue(88); 0176 addItem( itemAge, QStringLiteral( "Age" ) ); 0177 } 0178 0179 Test4::~Test4() 0180 { 0181 if (s_globalTest4.exists() && !s_globalTest4.isDestroyed()) { 0182 s_globalTest4()->q = nullptr; 0183 } 0184 } 0185