cf12defd28
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
71 lines
1.9 KiB
Plaintext
71 lines
1.9 KiB
Plaintext
// This file is generated by kconfig_compiler_kf6 from test8c.kcfg.
|
|
// All changes you do to this file will be lost.
|
|
|
|
#include "test8c.h"
|
|
|
|
#include <qglobal.h>
|
|
#include <QFile>
|
|
|
|
#include <QDebug>
|
|
|
|
class Test8cHelper
|
|
{
|
|
public:
|
|
Test8cHelper() : q(nullptr) {}
|
|
~Test8cHelper() { delete q; q = nullptr; }
|
|
Test8cHelper(const Test8cHelper&) = delete;
|
|
Test8cHelper& operator=(const Test8cHelper&) = delete;
|
|
Test8c *q;
|
|
};
|
|
Q_GLOBAL_STATIC(Test8cHelper, s_globalTest8c)
|
|
Test8c *Test8c::self()
|
|
{
|
|
if (!s_globalTest8c()->q)
|
|
qFatal("you need to call Test8c::instance before using");
|
|
return s_globalTest8c()->q;
|
|
}
|
|
|
|
void Test8c::instance(const QString& cfgfilename)
|
|
{
|
|
if (s_globalTest8c()->q) {
|
|
qDebug() << "Test8c::instance called after the first use - ignoring";
|
|
return;
|
|
}
|
|
new Test8c(KSharedConfig::openConfig(cfgfilename));
|
|
s_globalTest8c()->q->read();
|
|
}
|
|
|
|
void Test8c::instance(KSharedConfig::Ptr config)
|
|
{
|
|
if (s_globalTest8c()->q) {
|
|
qDebug() << "Test8c::instance called after the first use - ignoring";
|
|
return;
|
|
}
|
|
new Test8c(std::move(config));
|
|
s_globalTest8c()->q->read();
|
|
}
|
|
|
|
Test8c::Test8c( KSharedConfig::Ptr config, QObject *parent )
|
|
: KConfigSkeleton( std::move( config ) )
|
|
{
|
|
setParent(parent);
|
|
Q_ASSERT(!s_globalTest8c()->q);
|
|
s_globalTest8c()->q = this;
|
|
setCurrentGroup( QStringLiteral( "Group" ) );
|
|
|
|
KConfigSkeleton::ItemFont *itemFont;
|
|
itemFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "Font" ), mFont, QFont() );
|
|
addItem( itemFont, QStringLiteral( "Font" ) );
|
|
KConfigSkeleton::ItemFont *itemTitleFont;
|
|
itemTitleFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "TitleFont" ), mTitleFont, QFont() );
|
|
addItem( itemTitleFont, QStringLiteral( "TitleFont" ) );
|
|
}
|
|
|
|
Test8c::~Test8c()
|
|
{
|
|
if (s_globalTest8c.exists() && !s_globalTest8c.isDestroyed()) {
|
|
s_globalTest8c()->q = nullptr;
|
|
}
|
|
}
|
|
|