本文整理汇总了C++中KConfig::group方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::group方法的具体用法?C++ KConfig::group怎么用?C++ KConfig::group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::group方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isPathIndexed
bool DolphinSearchInformation::isPathIndexed(const KUrl& url) const
{
#ifdef HAVE_NEPOMUK
const KConfig strigiConfig("nepomukstrigirc");
const QStringList indexedFolders = strigiConfig.group("General").readPathEntry("folders", QStringList());
// Check whether the path is part of an indexed folder
bool isIndexed = false;
foreach (const QString& indexedFolder, indexedFolders) {
const KUrl indexedPath(indexedFolder);
if (indexedPath.isParentOf(url)) {
isIndexed = true;
break;
}
}
if (isIndexed) {
// The path is part of an indexed folder. Check whether no
// excluded folder is part of the path.
const QStringList excludedFolders = strigiConfig.group("General").readPathEntry("exclude folders", QStringList());
foreach (const QString& excludedFolder, excludedFolders) {
const KUrl excludedPath(excludedFolder);
if (excludedPath.isParentOf(url)) {
isIndexed = false;
break;
}
}
}
return isIndexed;
#else
Q_UNUSED(url);
return false;
#endif
}
示例2: KCModule
KCMKTECollaborative::KCMKTECollaborative(QWidget* parent, const QVariantList& args)
: KCModule(KteCollaborativePluginFactory::componentData(), parent, args)
{
kDebug() << "creating kte_collaborative kcmodule";
// Set up config groups
KConfig* config = new KConfig("ktecollaborative");
m_colorsGroup = config->group("colors");
m_notifyGroup = config->group("notifications");
m_applicationsGroup = config->group("applications");
// Create notifications group box
QGroupBox* notificationsGroupBox = new QGroupBox();
notificationsGroupBox->setTitle(i18n("Highlights and Notifications"));
QVBoxLayout* notificationsLayout = new QVBoxLayout();
notificationsGroupBox->setLayout(notificationsLayout);
m_highlightBackground = new QCheckBox(i18n("Display popup widgets"));
m_displayWidgets = new QCheckBox(i18n("Colorize text background"));
m_displayTextHints = new QCheckBox(i18n("Display text tooltips"));
notificationsLayout->addWidget(m_displayWidgets);
notificationsLayout->addWidget(m_highlightBackground);
notificationsLayout->addWidget(m_displayTextHints);
// Create colors group box
QGroupBox* colorsGroupBox = new QGroupBox();
colorsGroupBox->setTitle(i18n("Colors"));
QFormLayout* colorsLayout = new QFormLayout();
colorsGroupBox->setLayout(colorsLayout);
m_saturationSilder = new QSlider(Qt::Horizontal);
m_saturationSilder->setRange(30, 255);
colorsLayout->addRow(i18n("Highlight saturation"), m_saturationSilder);
// Create default application group box
QGroupBox* defaultApplicationBox = new QGroupBox();
defaultApplicationBox->setTitle(i18n("Default application"));
defaultApplicationBox->setLayout(new QHBoxLayout);
m_selectEditorWidget = new SelectEditorWidget(m_applicationsGroup.readEntry("editor"));
defaultApplicationBox->layout()->addWidget(m_selectEditorWidget);
// Assemble the UI
setLayout(new QVBoxLayout());
KMessageWidget* message = new KMessageWidget(i18n("Some changes might only be applied for newly opened documents."));
message->setMessageType(KMessageWidget::Information);
message->setCloseButtonVisible(false);
layout()->addWidget(message);
layout()->addWidget(notificationsGroupBox);
layout()->addWidget(colorsGroupBox);
layout()->addWidget(defaultApplicationBox);
// Add a spacer to top-align the widgets
layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding));
// Set up connections for changed signals
connect(m_saturationSilder, SIGNAL(sliderMoved(int)), SLOT(changed()));
connect(m_highlightBackground, SIGNAL(toggled(bool)), SLOT(changed()));
connect(m_displayWidgets, SIGNAL(toggled(bool)), SLOT(changed()));
connect(m_displayTextHints, SIGNAL(toggled(bool)), SLOT(changed()));
connect(m_selectEditorWidget, SIGNAL(selectionChanged()), SLOT(changed()));
}
示例3: saveLists
void KSSH::saveLists()
{
KConfig config;
KConfigGroup host_list = config.group("Host List");
host_list.writeEntry("Host", compHost->items());
KConfigGroup group_host_list = config.group(hostCB->currentText() % QString("-User List"));
group_host_list.writeEntry("User", compUser->items());
config.sync();
}
示例4: init
void TextLabel::init() {
Q_D(TextLabel);
KConfig config;
KConfigGroup group;
if (m_type == AxisTitle)
group = config.group("AxisTitle");
else if (m_type == PlotTitle)
group = config.group("PlotTitle");
else if (m_type == PlotLegendTitle)
group = config.group("PlotLegendTitle");
else
group = config.group("TextLabel");
//properties common to all types
d->textWrapper.teXUsed = group.readEntry("TeXUsed", false);
d->teXFontSize = group.readEntry("TeXFontSize", 12);
d->teXFontColor = group.readEntry("TeXFontColor", QColor(Qt::black));
d->rotationAngle = group.readEntry("Rotation", 0.0);
d->staticText.setTextFormat(Qt::RichText);
// explicitly set no wrap mode for text label to avoid unnecessary line breaks
QTextOption textOption;
textOption.setWrapMode(QTextOption::NoWrap);
d->staticText.setTextOption(textOption);
//position and alignment relevant properties, dependent on the actual type
if (m_type == PlotTitle || m_type == PlotLegendTitle) {
d->position.horizontalPosition = (HorizontalPosition) group.readEntry("PositionX", (int)TextLabel::hPositionCenter);
d->position.verticalPosition = (VerticalPosition) group.readEntry("PositionY", (int) TextLabel::vPositionTop);
d->position.point.setX( group.readEntry("PositionXValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
d->position.point.setY( group.readEntry("PositionYValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
d->horizontalAlignment= (TextLabel::HorizontalAlignment) group.readEntry("HorizontalAlignment", (int)TextLabel::hAlignCenter);
d->verticalAlignment= (TextLabel::VerticalAlignment) group.readEntry("VerticalAlignment", (int)TextLabel::vAlignBottom);
} else {
d->position.horizontalPosition = (HorizontalPosition) group.readEntry("PositionX", (int)TextLabel::hPositionCustom);
d->position.verticalPosition = (VerticalPosition) group.readEntry("PositionY", (int) TextLabel::vPositionCustom);
d->position.point.setX( group.readEntry("PositionXValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
d->position.point.setY( group.readEntry("PositionYValue", Worksheet::convertToSceneUnits(1, Worksheet::Centimeter)) );
d->horizontalAlignment= (TextLabel::HorizontalAlignment) group.readEntry("HorizontalAlignment", (int)TextLabel::hAlignCenter);
d->verticalAlignment= (TextLabel::VerticalAlignment) group.readEntry("VerticalAlignment", (int)TextLabel::vAlignCenter);
}
//scaling:
//we need to scale from the font size specified in points to scene units.
//furhermore, we create the tex-image in a higher resolution then usual desktop resolution
// -> take this into account
d->scaleFactor = Worksheet::convertToSceneUnits(1, Worksheet::Point);
d->teXImageResolution = QApplication::desktop()->physicalDpiX();
d->teXImageScaleFactor = Worksheet::convertToSceneUnits(2.54/QApplication::desktop()->physicalDpiX(), Worksheet::Centimeter);
connect(&d->teXImageFutureWatcher, SIGNAL(finished()), this, SLOT(updateTeXImage()));
this->initActions();
}
示例5: saveSettings
void ExpoBlendingDlg::saveSettings()
{
KConfig config;
KConfigGroup group = config.group("ExpoBlending Settings");
d->enfuseSettingsBox->writeSettings(group);
d->saveSettingsBox->writeSettings(group);
group.writeEntry("Template File Name", d->templateFileName->text());
KConfigGroup group2 = config.group("ExpoBlending Dialog");
KWindowConfig::saveWindowSize(windowHandle(), group2);
config.sync();
}
示例6: readSettings
void ExpoBlendingDlg::readSettings()
{
KConfig config;
KConfigGroup group = config.group("ExpoBlending Settings");
d->enfuseSettingsBox->readSettings(group);
d->saveSettingsBox->readSettings(group);
d->templateFileName->setText(group.readEntry("Template File Name", QString::fromLatin1("enfuse")));
winId();
KConfigGroup group2 = config.group("ExpoBlending Dialog");
KWindowConfig::restoreWindowSize(windowHandle(), group2);
resize(windowHandle()->size());
}
示例7: setProxyFor
void KSaveIOConfig::setProxyFor( const QString& protocol,
const QString& _proxy )
{
KConfig* cfg = config();
cfg->group("Proxy Settings").writeEntry( protocol.toLower() + "Proxy", _proxy );
cfg->sync();
}
示例8: setCacheControl
void KSaveIOConfig::setCacheControl(KIO::CacheControl policy)
{
KConfig* cfg = http_config();
QString tmp = KIO::getCacheControlString(policy);
cfg->group("").writeEntry("cache", tmp);
cfg->sync();
}
示例9: createEditor
KTextEditor::Editor *EditorChooser::createEditor(QWidget *parentWidget, QObject *parent, const char *widgetName, const char *name,
const QString &postfix, bool fallBackToKatePart)
{
KTextEditor::Editor *tmpEd = 0;
KConfig *cfg = kapp->config();
QString previousGroup = cfg->group();
cfg->setGroup("KTEXTEDITOR:" + postfix);
QString editor = cfg->readPathEntry("editor");
cfg->setGroup(previousGroup);
if(editor.isEmpty())
{
KConfig *config = new KConfig("default_components");
config->setGroup("KTextEditor");
editor = config->readPathEntry("embeddedEditor", "katepart");
delete config;
}
KService::Ptr serv = KService::serviceByDesktopName(editor);
if(serv)
{
tmpEd = KTextEditor::createEditor(serv->library().latin1(), parentWidget, widgetName, parent, name);
if(tmpEd)
return tmpEd;
}
if(fallBackToKatePart)
return KTextEditor::createEditor("libkatepart", parentWidget, widgetName, parent, name);
return 0;
}
示例10: init
void DatapickerImage::init() {
KConfig config;
KConfigGroup group = config.group( "DatapickerImage" );
d->fileName = group.readEntry("FileName", QString());
d->rotationAngle = group.readEntry("RotationAngle", 0.0);
d->minSegmentLength = group.readEntry("MinSegmentLength", 30);
d->pointSeparation = group.readEntry("PointSeparation", 30);
d->axisPoints.type = (DatapickerImage::GraphType) group.readEntry("GraphType", (int) DatapickerImage::Cartesian);
d->axisPoints.ternaryScale = group.readEntry("TernaryScale", 1);
d->settings.foregroundThresholdHigh = group.readEntry("ForegroundThresholdHigh", 90);
d->settings.foregroundThresholdLow = group.readEntry("ForegroundThresholdLow", 30);
d->settings.hueThresholdHigh = group.readEntry("HueThresholdHigh", 360);
d->settings.hueThresholdLow = group.readEntry("HueThresholdLow", 0);
d->settings.intensityThresholdHigh = group.readEntry("IntensityThresholdHigh", 100);
d->settings.intensityThresholdLow = group.readEntry("IntensityThresholdLow", 20);
d->settings.saturationThresholdHigh = group.readEntry("SaturationThresholdHigh", 100);
d->settings.saturationThresholdLow = group.readEntry("SaturationThresholdLow", 30);
d->settings.valueThresholdHigh = group.readEntry("ValueThresholdHigh", 90);
d->settings.valueThresholdLow = group.readEntry("ValueThresholdLow", 30);
d->plotPointsType = (DatapickerImage::PointsType) group.readEntry("PlotPointsType", (int) DatapickerImage::AxisPoints);
d->plotImageType = DatapickerImage::OriginalImage;
// point properties
d->pointStyle = (Symbol::Style)group.readEntry("PointStyle", (int)Symbol::Cross);
d->pointSize = group.readEntry("Size", Worksheet::convertToSceneUnits(7, Worksheet::Point));
d->pointRotationAngle = group.readEntry("Rotation", 0.0);
d->pointOpacity = group.readEntry("Opacity", 1.0);
d->pointBrush.setStyle( (Qt::BrushStyle)group.readEntry("FillingStyle", (int)Qt::NoBrush) );
d->pointBrush.setColor( group.readEntry("FillingColor", QColor(Qt::black)) );
d->pointPen.setStyle( (Qt::PenStyle)group.readEntry("BorderStyle", (int)Qt::SolidLine) );
d->pointPen.setColor( group.readEntry("BorderColor", QColor(Qt::red)) );
d->pointPen.setWidthF( group.readEntry("BorderWidth", Worksheet::convertToSceneUnits(1, Worksheet::Point)) );
d->pointVisibility = group.readEntry("PointVisibility", true);
}
示例11: saveDialogSize
void DPluginDialog::saveDialogSize()
{
KConfig config;
KConfigGroup group = config.group(objectName());
DXmlGuiWindow::saveWindowSize(windowHandle(), group);
config.sync();
}
示例12: init
void Worksheet::init() {
KConfig config;
KConfigGroup group = config.group( "Worksheet" );
//size
d->scaleContent = group.readEntry("ScaleContent", false);
d->useViewSize = group.readEntry("UseViewSize", false);
d->pageRect.setX(0);
d->pageRect.setY(0);
d->pageRect.setWidth(group.readEntry("Width", 1500));
d->pageRect.setHeight(group.readEntry("Height",1500));
//background
d->backgroundType = (PlotArea::BackgroundType) group.readEntry("BackgroundType", (int) PlotArea::Color);
d->backgroundColorStyle = (PlotArea::BackgroundColorStyle) group.readEntry("BackgroundColorStyle", (int) PlotArea::SingleColor);
d->backgroundImageStyle = (PlotArea::BackgroundImageStyle) group.readEntry("BackgroundImageStyle", (int) PlotArea::Scaled);
d->backgroundBrushStyle = (Qt::BrushStyle) group.readEntry("BackgroundBrushStyle", (int) Qt::SolidPattern);
d->backgroundFileName = group.readEntry("BackgroundFileName", QString());
d->backgroundFirstColor = group.readEntry("BackgroundFirstColor", QColor(Qt::white));
d->backgroundSecondColor = group.readEntry("BackgroundSecondColor", QColor(Qt::black));
d->backgroundOpacity = group.readEntry("BackgroundOpacity", 1.0);
//layout
d->layout = (Worksheet::Layout) group.readEntry("Layout", (int) Worksheet::VerticalLayout);
d->layoutTopMargin = group.readEntry("LayoutTopMargin", convertToSceneUnits(1, Centimeter));
d->layoutBottomMargin = group.readEntry("LayoutBottomMargin", convertToSceneUnits(1, Centimeter));
d->layoutLeftMargin = group.readEntry("LayoutLeftMargin", convertToSceneUnits(1, Centimeter));
d->layoutRightMargin = group.readEntry("LayoutRightMargin", convertToSceneUnits(1, Centimeter));
d->layoutVerticalSpacing = group.readEntry("LayoutVerticalSpacing", convertToSceneUnits(1, Centimeter));
d->layoutHorizontalSpacing = group.readEntry("LayoutHorizontalSpacing", convertToSceneUnits(1, Centimeter));
d->layoutRowCount = group.readEntry("LayoutRowCount", 2);
d->layoutColumnCount = group.readEntry("LayoutColumnCount", 2);
}
示例13: saveConfigAsTemplate
void NoteDock::saveConfigAsTemplate(KConfig& config) {
KConfigGroup group = config.group("Notes");
group.writeEntry("BackgroundColor", ui.kcbBgColor->color());
group.writeEntry("TextColor", ui.kcbTextColor->color());
group.writeEntry("TextFont", ui.kfrTextFont->font());
}
示例14: saveConfigAsTemplate
/*!
saves spreadsheet properties to \c config.
*/
void SpreadsheetDock::saveConfigAsTemplate(KConfig& config) {
KConfigGroup group = config.group( "Spreadsheet" );
group.writeEntry("ColumnCount", ui.sbColumnCount->value());
group.writeEntry("RowCount", ui.sbRowCount->value());
group.writeEntry("ShowComments",ui.cbShowComments->isChecked());
config.sync();
}
示例15: readSettings
void KSpriteSaver::readSettings()
{
QString str;
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup group( config, QStringLiteral("Settings") );
mSpeed = group.readEntry(QStringLiteral("Speed"), 50);
QString path = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("sprites/"), QStandardPaths::LocateDirectory);
SpritePixmapManager::manager()->setPixmapDir(path);
path += QStringLiteral( "spriterc" );
KConfig *pConfig = new KConfig(path);
KConfigGroup mConfig(pConfig, QStringLiteral("Config"));
QStringList list;
list = mConfig.readEntry(QStringLiteral("Groups"),list);
mTimerIds.resize(list.count());
for (int i = 0; i < list.count(); i++)
{
qDebug() << QStringLiteral("Group: ") << list.at(i);
KConfigGroup grp = pConfig->group(list.at(i));
SpriteGroup *obj = new SpriteGroup(mScene, grp);
mTimerIds[i] = startTimer(obj->refreshTime());
mGroups.append(obj);
}
delete pConfig;
}