当前位置: 首页>>代码示例>>C++>>正文


C++ KSharedConfigPtr类代码示例

本文整理汇总了C++中KSharedConfigPtr的典型用法代码示例。如果您正苦于以下问题:C++ KSharedConfigPtr类的具体用法?C++ KSharedConfigPtr怎么用?C++ KSharedConfigPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了KSharedConfigPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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);
    }
}
开发者ID:KDE,项目名称:krename,代码行数:30,代码来源:krenamewindow.cpp

示例2: readSettings

void KonqHistorySettings::readSettings(bool reparse)
{
    KSharedConfigPtr config;

    if (KGlobal::mainComponent().componentName() == QLatin1String("konqueror"))
      config = KGlobal::config();
    else
      config = KSharedConfig::openConfig("konquerorrc");

    if (reparse) {
        config->reparseConfiguration();
    }

    const KConfigGroup cg( config, "HistorySettings");
    m_valueYoungerThan = cg.readEntry("Value youngerThan", 1 );
    m_valueOlderThan = cg.readEntry("Value olderThan", 2 );

    const QString days = QString::fromLatin1("days");
    const QString metricY = cg.readEntry("Metric youngerThan", days );
    m_metricYoungerThan = (metricY == days) ? DAYS : MINUTES;
    const QString metricO = cg.readEntry("Metric olderThan", days );
    m_metricOlderThan = (metricO == days) ? DAYS : MINUTES;

    m_fontYoungerThan = cg.readEntry( "Font youngerThan", m_fontYoungerThan );
    m_fontOlderThan   = cg.readEntry( "Font olderThan", m_fontOlderThan );

    m_detailedTips = cg.readEntry("Detailed Tooltips", true);
    m_sortsByName = cg.readEntry( "SortHistory", "byDate" ) == "byName";
}
开发者ID:blue-shell,项目名称:folderview,代码行数:29,代码来源:konqhistorysettings.cpp

示例3: setUnit

void KWApplicationConfig::setUnit(const KoUnit &unit)
{
    KSharedConfigPtr config = KGlobal::config();
    KConfigGroup misc = config->group("Misc");
    misc.writeEntry("Units", unit.symbol());
    misc.sync();
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:7,代码来源:KWApplicationConfig.cpp

示例4: 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();
}
开发者ID:KDE,项目名称:kmymoney,代码行数:7,代码来源:kchooseimportexportdlg.cpp

示例5: 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));
}
开发者ID:KDE,项目名称:calligra,代码行数:7,代码来源:Doc.cpp

示例6: applicationLanguageList

QStringList KSwitchLanguageDialogPrivate::applicationLanguageList()
{
    KSharedConfigPtr config = KGlobal::config();
    QStringList languagesList;

    if (config->hasGroup("Locale"))
    {
        KConfigGroup group(config, "Locale");
        if (group.hasKey("Language"))
        {
            languagesList = group.readEntry("Language", QString()).split(':');
        }
    }
    if (languagesList.isEmpty())
    {
      languagesList = KGlobal::locale()->languageList();
    }

    KLocale *locale = KGlobal::locale();
    for (int i = 0; i < languagesList.count();)
    {
      if (!locale->isApplicationTranslatedInto(languagesList[i]))
        languagesList.removeAt(i);
      else
        ++i;
    }

    return languagesList;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:29,代码来源:kswitchlanguagedialog_p.cpp

示例7: MyMoneyQifProfileEditor

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);
  }
}
开发者ID:KDE,项目名称:kmymoney,代码行数:32,代码来源:kimportdlg.cpp

示例8: 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"));
}
开发者ID:KDE,项目名称:kmymoney,代码行数:7,代码来源:kbackupdlg.cpp

示例9: readConfig

void KImportDlg::readConfig()
{
  KSharedConfigPtr kconfig = KSharedConfig::openConfig();
  KConfigGroup kgrp = kconfig->group("Last Use Settings");
  m_qlineeditFile->setText(kgrp.readEntry("KImportDlg_LastFile"));

}
开发者ID:KDE,项目名称:kmymoney,代码行数:7,代码来源:kimportdlg.cpp

示例10: 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);
    }
开发者ID:KDE,项目名称:kdepim,代码行数:26,代码来源:sieveeditorutil.cpp

示例11: 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();
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:26,代码来源:KWApplicationConfig.cpp

示例12: writeConfig

void KImportDlg::writeConfig()
{
  KSharedConfigPtr kconfig = KSharedConfig::openConfig();
  KConfigGroup grp = kconfig->group("Last Use Settings");
  grp.writeEntry("KImportDlg_LastFile", m_qlineeditFile->text());
  grp.writeEntry("KImportDlg_LastProfile", m_profileComboBox->currentText());
  kconfig->sync();
}
开发者ID:KDE,项目名称:kmymoney,代码行数:8,代码来源:kimportdlg.cpp

示例13: saveConfig

void MainWindow::saveConfig()
{
    KSharedConfigPtr config = KGlobal::config();

    config->group("mainwindow").writeEntry("geometry", saveGeometry());
    config->group("mainwindow").writeEntry("state", saveState());
    config->sync();
}
开发者ID:nasash,项目名称:KResearch,代码行数:8,代码来源:MainWindow.cpp

示例14: writeConfig

void KBackupDlg::writeConfig()
{
  KSharedConfigPtr config = KSharedConfig::openConfig();
  KConfigGroup grp = config->group("Last Use Settings");
  grp.writeEntry("KBackupDlg_mountDevice", mountCheckBox->isChecked());
  grp.writeEntry("KBackupDlg_BackupMountPoint", txtMountPoint->text());
  config->sync();
}
开发者ID:KDE,项目名称:kmymoney,代码行数:8,代码来源:kbackupdlg.cpp

示例15: saveKPrConfig

void KPrDocument::saveKPrConfig()
{
    KSharedConfigPtr config = KGlobal::mainComponent().config();
    KConfigGroup configGroup = config->group( "SlideShow" );

    configGroup.writeEntry( "PresentationMonitor", m_presentationMonitor );
    configGroup.writeEntry( "PresenterViewEnabled", m_presenterViewEnabled );
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:8,代码来源:KPrDocument.cpp


注:本文中的KSharedConfigPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。