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

0001 // This file is generated by kconfig_compiler_kf5 from test8c.kcfg.
0002 // All changes you do to this file will be lost.
0003 
0004 #include "test8c.h"
0005 
0006 #include <qglobal.h>
0007 #include <QFile>
0008 
0009 #include <QDebug>
0010 
0011 class Test8cHelper
0012 {
0013   public:
0014     Test8cHelper() : q(nullptr) {}
0015     ~Test8cHelper() { delete q; q = nullptr; }
0016     Test8cHelper(const Test8cHelper&) = delete;
0017     Test8cHelper& operator=(const Test8cHelper&) = delete;
0018     Test8c *q;
0019 };
0020 Q_GLOBAL_STATIC(Test8cHelper, s_globalTest8c)
0021 Test8c *Test8c::self()
0022 {
0023   if (!s_globalTest8c()->q)
0024      qFatal("you need to call Test8c::instance before using");
0025   return s_globalTest8c()->q;
0026 }
0027 
0028 void Test8c::instance(const QString& cfgfilename)
0029 {
0030   if (s_globalTest8c()->q) {
0031      qDebug() << "Test8c::instance called after the first use - ignoring";
0032      return;
0033   }
0034   new Test8c(KSharedConfig::openConfig(cfgfilename));
0035   s_globalTest8c()->q->read();
0036 }
0037 
0038 void Test8c::instance(KSharedConfig::Ptr config)
0039 {
0040   if (s_globalTest8c()->q) {
0041      qDebug() << "Test8c::instance called after the first use - ignoring";
0042      return;
0043   }
0044   new Test8c(std::move(config));
0045   s_globalTest8c()->q->read();
0046 }
0047 
0048 Test8c::Test8c( KSharedConfig::Ptr config, QObject *parent )
0049   : KConfigSkeleton( std::move( config ) )
0050 {
0051   setParent(parent);
0052   Q_ASSERT(!s_globalTest8c()->q);
0053   s_globalTest8c()->q = this;
0054   setCurrentGroup( QStringLiteral( "Group" ) );
0055 
0056   KConfigSkeleton::ItemFont  *itemFont;
0057   itemFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "Font" ), mFont, QFont() );
0058   addItem( itemFont, QStringLiteral( "Font" ) );
0059   KConfigSkeleton::ItemFont  *itemTitleFont;
0060   itemTitleFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "TitleFont" ), mTitleFont, QFont() );
0061   addItem( itemTitleFont, QStringLiteral( "TitleFont" ) );
0062 }
0063 
0064 Test8c::~Test8c()
0065 {
0066   if (s_globalTest8c.exists() && !s_globalTest8c.isDestroyed()) {
0067     s_globalTest8c()->q = nullptr;
0068   }
0069 }
0070