本文整理汇总了C++中KSharedConfigPtr::groupList方法的典型用法代码示例。如果您正苦于以下问题:C++ KSharedConfigPtr::groupList方法的具体用法?C++ KSharedConfigPtr::groupList怎么用?C++ KSharedConfigPtr::groupList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSharedConfigPtr
的用法示例。
在下文中一共展示了KSharedConfigPtr::groupList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: re
QVector<SieveEditorUtil::SieveServerConfig> SieveEditorUtil::readServerSieveConfig()
{
QVector<SieveServerConfig> lstConfig;
KSharedConfigPtr cfg = KSharedConfig::openConfig();
QRegularExpression re(QStringLiteral("^ServerSieve (.+)$"));
const QStringList groups = cfg->groupList().filter(re);
KWallet::Wallet *wallet = SieveServerSettings::self()->wallet();
if (wallet && !wallet->setFolder(QStringLiteral("sieveeditor"))) {
wallet->createFolder(QStringLiteral("sieveeditor"));
wallet->setFolder(QStringLiteral("sieveeditor"));
}
Q_FOREACH (const QString &conf, groups) {
SieveServerConfig sieve;
KConfigGroup group = cfg->group(conf);
sieve.port = group.readEntry(QStringLiteral("Port"), 0);
sieve.serverName = group.readEntry(QStringLiteral("ServerName"));
sieve.userName = group.readEntry(QStringLiteral("UserName"));
sieve.enabled = group.readEntry(QStringLiteral("Enabled"), true);
const QString walletEntry = sieve.userName + QLatin1Char('@') + sieve.serverName;
if (wallet && wallet->hasEntry(walletEntry)) {
wallet->readPassword(walletEntry, sieve.password);
}
sieve.authenticationType = static_cast<MailTransport::Transport::EnumAuthenticationType::type>(group.readEntry(QStringLiteral("Authentication"), static_cast<int>(MailTransport::Transport::EnumAuthenticationType::PLAIN)));
lstConfig.append(sieve);
}
示例2: applyColorScheme
void applyColorScheme(const QString &colorScheme, KConfig *other)
{
QString src = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "color-schemes/" + colorScheme + ".colors");
KSharedConfigPtr config = KSharedConfig::openConfig(src);
foreach (const QString &grp, config->groupList()) {
KConfigGroup cg(config, grp);
KConfigGroup cg2(other, grp);
cg.copyTo(&cg2);
}
}
示例3: setColors
void KCMLookandFeel::setColors(const QString &scheme, const QString &colorFile)
{
if (scheme.isEmpty() && colorFile.isEmpty()) {
return;
}
KConfigGroup configGroup(&m_config, "General");
configGroup.writeEntry("ColorScheme", scheme);
configGroup.sync();
KSharedConfigPtr conf = KSharedConfig::openConfig(colorFile);
foreach (const QString &grp, conf->groupList()) {
KConfigGroup cg(conf, grp);
KConfigGroup cg2(&m_config, grp);
cg.copyTo(&cg2);
}
}
示例4: ad
// static
std::vector< std::shared_ptr<ArchiveDefinition> > ArchiveDefinition::getArchiveDefinitions(QStringList &errors)
{
std::vector< std::shared_ptr<ArchiveDefinition> > result;
KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("libkleopatrarc"));
const QStringList groups = config->groupList().filter(QRegularExpression(QStringLiteral("^Archive Definition #")));
result.reserve(groups.size());
for (const QString &group : groups)
try {
const std::shared_ptr<ArchiveDefinition> ad(new KConfigBasedArchiveDefinition(KConfigGroup(config, group)));
result.push_back(ad);
} catch (const std::exception &e) {
qCDebug(KLEOPATRA_LOG) << e.what();
errors.push_back(QString::fromLocal8Bit(e.what()));
} catch (...) {
errors.push_back(i18n("Caught unknown exception in group %1", group));
}
return result;
}