本文整理汇总了C++中KSharedConfigPtr::group方法的典型用法代码示例。如果您正苦于以下问题:C++ KSharedConfigPtr::group方法的具体用法?C++ KSharedConfigPtr::group怎么用?C++ KSharedConfigPtr::group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSharedConfigPtr
的用法示例。
在下文中一共展示了KSharedConfigPtr::group方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadProfiles
void KImportDlg::loadProfiles(const bool selectLast)
{
// Creating an editor object here makes sure that
// we have at least the default profile available
MyMoneyQifProfileEditor* edit = new MyMoneyQifProfileEditor(true, 0);
edit->slotOk();
delete edit;
QString current = m_profileComboBox->currentText();
m_profileComboBox->clear();
QStringList list;
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup grp = config->group("Profiles");
list = grp.readEntry("profiles", QStringList());
list.sort();
m_profileComboBox->addItems(list);
if (selectLast == true) {
config->group("Last Use Settings");
current = grp.readEntry("KImportDlg_LastProfile");
}
int index = m_profileComboBox->findText(current, Qt::MatchExactly);
if (index > -1) {
m_profileComboBox->setCurrentIndex(index);
} else {
m_profileComboBox->setCurrentIndex(0);
}
}
示例2: saveConfig
void MainWindow::saveConfig()
{
KSharedConfigPtr config = KGlobal::config();
config->group("mainwindow").writeEntry("geometry", saveGeometry());
config->group("mainwindow").writeEntry("state", saveState());
config->sync();
}
示例3: loadConfig
void MainWindow::loadConfig()
{
KSharedConfigPtr config = KGlobal::config();
QByteArray geometry = config->group("mainwindow").readEntry("geometry", QByteArray());
QByteArray state = config->group("mainwindow").readEntry("state", QByteArray());
restoreGeometry(geometry);
restoreState(state);
}
示例4: 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);
}
示例5: loadConfig
void KRenameWindow::loadConfig()
{
// ExtHistoryCombo needs an object name
m_pageFilename->filenameTemplate->setObjectName("FILENAME_TEMPLATE");
m_pageFilename->extensionTemplate->setObjectName("EXTENSION_TEMPLATE");
m_pageFilename->comboFilenameCustom->setObjectName("FILENAME_CUSTOM_TEMPLATE");
m_pageFilename->comboExtensionCustom->setObjectName("EXTENSION_CUSTOM_TEMPLATE");
m_pageFilename->comboPrefixCustom->setObjectName("PREVIX_CUSTOM_TEMPLATE");
m_pageFilename->comboSuffixCustom->setObjectName("SUFFIX_CUSTOM_TEMPLATE");
m_pageFilename->filenameTemplate->loadConfig();
m_pageFilename->extensionTemplate->loadConfig();
m_pageFilename->comboFilenameCustom->loadConfig();
m_pageFilename->comboExtensionCustom->loadConfig();
m_pageFilename->comboPrefixCustom->loadConfig();
m_pageFilename->comboSuffixCustom->loadConfig();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup groupGui = config->group(QString("GUISettings"));
int width = groupGui.readEntry("Column0", QVariant(this->previewColumnWidth(0))).toInt();
if (width > 0) {
this->setPreviewColumnWidth(0, width);
}
width = groupGui.readEntry("Column1", QVariant(this->previewColumnWidth(1))).toInt();
if (width > 0) {
this->setPreviewColumnWidth(1, width);
}
}
示例6: saveState
void PlayListWidget::saveState(KSharedConfigPtr cfg)
{
KConfigGroup g = cfg->group("PlayListWidget");
QHeaderView* v = view->header();
g.writeEntry("play_list_state",v->saveState());
g.writeEntry("random_mode",random_mode->isChecked());
}
示例7: readConfig
void KImportDlg::readConfig()
{
KSharedConfigPtr kconfig = KSharedConfig::openConfig();
KConfigGroup kgrp = kconfig->group("Last Use Settings");
m_qlineeditFile->setText(kgrp.readEntry("KImportDlg_LastFile"));
}
示例8: loadState
void MediaView::loadState(KSharedConfigPtr cfg)
{
KConfigGroup g = cfg->group("MediaView");
show_incomplete->setChecked(g.readEntry("show_incomplete", false));
search_box->setText(g.readEntry("search_text", QString()));
}
示例9: initConfig
void Doc::initConfig()
{
KSharedConfigPtr config = Factory::global().config();
const int page = config->group("Tables Page Layout").readEntry("Default unit page", 0);
setUnit(KoUnit::fromListForUi(page, KoUnit::HidePixel));
}
示例10: readConfig
void KBackupDlg::readConfig()
{
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup grp = config->group("Last Use Settings");
mountCheckBox->setChecked(grp.readEntry("KBackupDlg_mountDevice", false));
txtMountPoint->setText(grp.readEntry("KBackupDlg_BackupMountPoint", "/mnt/floppy"));
}
示例11: loadState
void TorrentActivity::loadState(KSharedConfigPtr cfg)
{
KConfigGroup g = cfg->group("TorrentActivitySplitters");
if (vsplit)
{
QByteArray data;
data = QByteArray::fromBase64(g.readEntry("vsplit", data));
vsplit->restoreState(data);
}
if (hsplit)
{
QByteArray data;
data = QByteArray::fromBase64(g.readEntry("hsplit", data));
hsplit->restoreState(data);
}
search_bar->loadState(cfg);
group_view->loadState(cfg);
qm->loadState(cfg);
tool_views->loadState(cfg, "TorrentActivityBottomTabBar");
notifyViewListeners(view->getCurrentTorrent());
magnet_view->loadState(cfg);
group_switcher->loadState(cfg);
show_group_view_action->setChecked(!group_view->isHidden());
}
示例12: loadState
void WebSeedsTab::loadState(KSharedConfigPtr cfg)
{
KConfigGroup g = cfg->group("WebSeedsTab");
QByteArray s = QByteArray::fromBase64(g.readEntry("state",QByteArray()));
if (!s.isNull())
m_webseed_list->header()->restoreState(s);
}
示例13: writeConfig
void KChooseImportExportDlg::writeConfig()
{
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup grp = config->group("Last Use Settings");
grp.writeEntry("KChooseImportExportDlg_LastType", d->ui.typeCombo->currentText());
config->sync();
}
示例14: setUnit
void KWApplicationConfig::setUnit(const KoUnit &unit)
{
KSharedConfigPtr config = KGlobal::config();
KConfigGroup misc = config->group("Misc");
misc.writeEntry("Units", unit.symbol());
misc.sync();
}
示例15: save
void KWApplicationConfig::save()
{
KSharedConfigPtr config = KGlobal::config();
KConfigGroup interface = config->group("Interface");
interface.writeEntry("ViewFormattingChars", m_showFormattingChars);
interface.writeEntry("ViewFieldShadings", m_showInlineObjectVisualization);
interface.writeEntry("ViewTableBorders", m_showTableBorders);
interface.writeEntry("ViewFrameBorders", m_viewFrameBorders);
interface.writeEntry("Zoom", m_zoom);
interface.writeEntry("ZoomMode", (int)m_zoomMode);
// interface.writeEntry("showDocStruct", m_bShowDocStruct);
interface.writeEntry("Rulers", m_viewRulers);
// interface.writeEntry("viewmode", m_viewModeType) ;
// interface.writeEntry("AllowAutoFormat", m_bAllowAutoFormat);
// interface.writeEntry("ShowGrid" , m_bShowGrid);
// interface.writeEntry("SnapToGrid" , m_bSnapToGrid);
interface.writeEntry("StatusBarShowPage", m_statusBarShowPage);
interface.writeEntry("StatusBarShowPageStyle", m_statusBarShowPageStyle);
interface.writeEntry("StatusBarShowPageSize", m_statusBarShowPageSize);
interface.writeEntry("StatusBarShowLineNumber", m_statusBarShowLineNumber);
interface.writeEntry("StatusBarShowModified", m_statusBarShowModified);
interface.writeEntry("StatusBarShowMouse", m_statusBarShowMouse);
interface.writeEntry("StatusBarShowZoom", m_statusBarShowZoom);
interface.writeEntry("StatusBarShowWordCount", m_statusBarShowWordCount);
interface.sync();
}