本文整理汇总了C++中KConfigGroup::writePathEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfigGroup::writePathEntry方法的具体用法?C++ KConfigGroup::writePathEntry怎么用?C++ KConfigGroup::writePathEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfigGroup
的用法示例。
在下文中一共展示了KConfigGroup::writePathEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeToConfig
void ICCSettingsContainer::writeToConfig(KConfigGroup& group) const
{
group.writeEntry("EnableCM", enableCM);
if (!enableCM)
{
return; // No need to write settings in this case.
}
group.writeEntry("DefaultMismatchBehavior", (int)defaultMismatchBehavior);
group.writeEntry("DefaultMissingProfileBehavior", (int)defaultMissingProfileBehavior);
group.writeEntry("DefaultUncalibratedBehavior", (int)defaultUncalibratedBehavior);
group.writeEntry("LastMismatchBehavior", (int)lastMismatchBehavior);
group.writeEntry("LastMissingProfileBehavior", (int)lastMissingProfileBehavior);
group.writeEntry("LastUncalibratedBehavior", (int)lastUncalibratedBehavior);
group.writeEntry("LastSpecifiedAssignProfile", lastSpecifiedAssignProfile);
group.writeEntry("LastSpecifiedInputProfile", lastSpecifiedInputProfile);
group.writeEntry("BPCAlgorithm", useBPC);
group.writeEntry("ManagedView", useManagedView);
group.writeEntry("ManagedPreviews", useManagedPreviews);
group.writeEntry("RenderingIntent", renderingIntent);
group.writePathEntry("WorkProfileFile", workspaceProfile);
group.writePathEntry("MonitorProfileFile", monitorProfile);
group.writePathEntry("InProfileFile", defaultInputProfile);
group.writePathEntry("ProofProfileFile", defaultProofProfile);
group.writeEntry("ProofingRenderingIntent", proofingRenderingIntent);
group.writeEntry("DoGamutCheck", doGamutCheck);
group.writeEntry("GamutCheckMaskColor", gamutCheckMaskColor);
group.writeEntry("DefaultPath", iccFolder);
}
示例2: saveEntries
void saveEntries( const KConfigGroup &grp)
{
KConfigGroup cg = grp;
if (cg.name().isEmpty()) {
cg = KConfigGroup(cg.config(),"RecentFiles");
}
cg.deleteGroup();
// write file list
for (int i = 1; i <= recentFilesIndex.size(); ++i) {
// i - 1 because we started from 1
cg.writePathEntry(QString("File%1").arg(i), recentFiles[i - 1]);
cg.writePathEntry(QString("Name%1").arg(i), recentFilesIndex[i - 1]);
}
}
示例3: engineMediaChanged
void MainWindow::engineMediaChanged(Phonon::MediaSource /*newSource*/)
{
m_audioView->update();
// update recently played list
qDebug() << " update recent files list ";
emit fileChanged( engine()->urlOrDisc() );
//TODO fetch this from the Media source
QUrl const &url = TheStream::url();
const QString url_string = url.url();
#ifndef NO_SKIP_PR0N
// ;-)
if( !(url_string.contains( QLatin1String( "porn" ), Qt::CaseInsensitive )
|| url_string.contains( QLatin1String( "pr0n" ), Qt::CaseInsensitive )) ) {
#endif
if( url.scheme() != QLatin1String( "dvd" ) && url.scheme() != QLatin1String( "vcd" ) && !url.toDisplayString().isEmpty()) {
KConfigGroup config = KConfigGroup( KSharedConfig::openConfig(), "General" );
const QString prettyUrl = url.toDisplayString();
QStringList urls = config.readPathEntry( "Recent Urls", QStringList() );
urls.removeAll( prettyUrl );
config.writePathEntry( "Recent Urls", urls << prettyUrl );
emit m_loadView->reloadRecentlyList();
}
#ifndef NO_SKIP_PR0N
}
#endif
}//engineMediaChanged
示例4: writeConfig
void ResourceNet::writeConfig( KConfigGroup &group )
{
Resource::writeConfig( group );
group.writePathEntry( "NetUrl", mUrl.url() );
group.writeEntry( "NetFormat", mFormatName );
}
示例5: setSaveLocation
void ExportManager::setSaveLocation(const QString &savePath)
{
KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("spectaclerc"));
KConfigGroup generalConfig = KConfigGroup(config, "General");
generalConfig.writePathEntry("last-saved-to", savePath);
}
示例6: setKHTMLDirectory
void TestRegressionWindow::setKHTMLDirectory()
{
m_khtmlUrl = KFileDialog::getExistingDirectory();
if(!m_khtmlUrl.isEmpty())
{
const char *subdirs[] = { "css", "dom", "xml", "html" }; // That's enough ;-)
for(int i = 0; i <= 3; i++)
{
QFileInfo sourceDir(m_khtmlUrl.path() + "/" + subdirs[i]); //krazy:exclude=duoblequote_chars DOM demands chars
if(!sourceDir.exists() || !sourceDir.isDir())
{
KMessageBox::error(0, i18n("Please choose a valid 'khtml/' build directory."));
m_khtmlUrl = KUrl();
break;
}
}
// Remember directory...
KConfig config("testregressiongui", KConfig::SimpleConfig);
KConfigGroup grp = config.group("<default>");
grp.writePathEntry("KHTMLDirectory", m_khtmlUrl.path());
if(!m_testsUrl.isEmpty() && !m_khtmlUrl.isEmpty())
m_ui.actionRun_tests->setEnabled(true);
}
}
示例7: save
void KTimerJob::save( KConfig *cfg, const QString& grp )
{
KConfigGroup groupcfg = cfg->group(grp);
groupcfg.writeEntry( "Delay", d->delay );
groupcfg.writePathEntry( "Command", d->command );
groupcfg.writeEntry( "Loop", d->loop );
groupcfg.writeEntry( "OneInstance", d->oneInstance );
groupcfg.writeEntry( "State", (int)d->state );
}
示例8: saveProperties
void KompareShell::saveProperties(KConfigGroup &config)
{
// The 'config' object points to the session managed
// config file. Anything you write here will be available
// later when this app is restored
if ( m_mode == Kompare::ComparingFiles )
{
config.writeEntry( "Mode", "ComparingFiles" );
config.writePathEntry( "SourceUrl", m_sourceURL.url() );
config.writePathEntry( "DestinationUrl", m_destinationURL.url() );
}
else if ( m_mode == Kompare::ShowingDiff )
{
config.writeEntry( "Mode", "ShowingDiff" );
config.writePathEntry( "DiffUrl", m_diffURL.url() );
}
viewPart()->saveProperties( config.config() );
}
示例9: saveProperties
void Workspace::saveProperties( KConfigGroup& cfg )
{
QStringList list;
for(int i =0; i< mSheetList.size(); i++)
if ( !mSheetList.at(i)->fileName().isEmpty() )
list.append( mSheetList.at(i)->fileName() );
cfg.writePathEntry( "SelectedSheets", list );
cfg.writeEntry( "currentSheet", currentIndex() );
}
示例10: saveProperties
void CervisiaShell::saveProperties(KConfigGroup & config)
{
// Save current working directory (if part was created)
if( m_part )
{
config.writePathEntry("Current Directory", m_part->url().path());
// write to disk
config.sync();
}
}
示例11: apply
void BasicTab::apply()
{
if (_menuEntryInfo)
{
_menuEntryInfo->setDirty();
_menuEntryInfo->setCaption(_nameEdit->text());
_menuEntryInfo->setDescription(_descriptionEdit->text());
_menuEntryInfo->setIcon(_iconButton->icon());
KDesktopFile *df = _menuEntryInfo->desktopFile();
KConfigGroup dg = df->desktopGroup();
dg.writeEntry("Comment", _commentEdit->text());
if (_systrayCB->isChecked())
dg.writeEntry("Exec", _execEdit->lineEdit()->text().prepend("ksystraycmd "));
else
dg.writeEntry("Exec", _execEdit->lineEdit()->text());
dg.writePathEntry("Path", _pathEdit->lineEdit()->text());
if (_terminalCB->isChecked())
dg.writeEntry("Terminal", 1);
else
dg.writeEntry("Terminal", 0);
dg.writeEntry("TerminalOptions", _termOptEdit->text());
dg.writeEntry("X-KDE-SubstituteUID", _uidCB->isChecked());
dg.writeEntry("X-KDE-Username", _uidEdit->text());
dg.writeEntry("StartupNotify", _launchCB->isChecked());
dg.writeEntry( "NoDisplay", _hiddenEntryCB->isChecked() );
QStringList onlyShowIn = df->desktopGroup().readXdgListEntry("OnlyShowIn");
/* the exact semantics of this checkbox are unclear if there is more than just KDE in the list...
* For example: - The list is "Gnome;", the user enables "Only show in KDE" - should we remove Gnome?
* - The list is "Gnome;KDE;", the user unchecks the box - should we keep Gnome?
*/
if ( _onlyShowInKdeCB->isChecked() && !onlyShowIn.contains("KDE"))
onlyShowIn << "KDE";
else if ( !_onlyShowInKdeCB->isChecked() && onlyShowIn.contains("KDE"))
onlyShowIn.removeAll("KDE");
if (onlyShowIn.isEmpty())
dg.deleteEntry("OnlyShowIn");
else
dg.writeXdgListEntry("OnlyShowIn", onlyShowIn);
}
else
{
_menuFolderInfo->setCaption(_nameEdit->text());
_menuFolderInfo->setGenericName(_descriptionEdit->text());
_menuFolderInfo->setComment(_commentEdit->text());
_menuFolderInfo->setIcon(_iconButton->icon());
}
}
示例12: save
// only saves the cache for the given list of items to prevent the cache
// from growing forever.
void KonqPixmapProvider::save( KConfigGroup& kc, const QString& key,
const QStringList& items )
{
QStringList list;
QStringList::const_iterator itEnd = items.end();
for (QStringList::const_iterator it = items.begin(); it != itEnd; ++it) {
QMap<KUrl,QString>::const_iterator mit = iconMap.constFind( KUrl(*it) );
if ( mit != iconMap.constEnd() ) {
list.append( mit.key().url() );
list.append( mit.value() );
}
}
kc.writePathEntry( key, list );
}
示例13: switch
void K3b::ImageWritingDialog::saveSettings( KConfigGroup c )
{
d->writingModeWidget->saveConfig( c ),
c.writeEntry( "simulate", d->checkDummy->isChecked() );
c.writeEntry( "multisession", d->checkNoFix->isChecked() );
c.writeEntry( "on_the_fly", !d->checkCacheImage->isChecked() );
d->dataModeWidget->saveConfig(c);
c.writeEntry( "verify_data", d->checkVerify->isChecked() );
d->writerSelectionWidget->saveConfig( c );
c.writePathEntry( "image path", d->imagePath() );
c.writeEntry( "copies", d->spinCopies->value() );
QString imageType;
if( d->comboImageType->currentIndex() == 0 )
imageType = "auto";
else {
switch( d->imageTypeSelectionMap[d->comboImageType->currentIndex()] ) {
case IMAGE_ISO:
imageType = "iso9660";
break;
case IMAGE_CUE_BIN:
imageType = "cue-bin";
break;
case IMAGE_AUDIO_CUE:
imageType = "audio-cue";
break;
case IMAGE_CDRECORD_CLONE:
imageType = "cdrecord-clone";
break;
case IMAGE_CDRDAO_TOC:
imageType = "cdrdao-toc";
break;
}
}
c.writeEntry( "image type", imageType );
if( d->tempDirSelectionWidget->isEnabled() )
d->tempDirSelectionWidget->saveConfig();
}
示例14: saveLocation
QString ExportManager::saveLocation() const
{
KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("spectaclerc"));
KConfigGroup generalConfig = KConfigGroup(config, "General");
QString savePath = generalConfig.readPathEntry(
"default-save-location", QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
if (savePath.isEmpty() || savePath.isNull()) {
savePath = QDir::homePath();
}
savePath = QDir::cleanPath(savePath);
QDir savePathDir(savePath);
if (!(savePathDir.exists())) {
savePathDir.mkpath(QStringLiteral("."));
generalConfig.writePathEntry("last-saved-to", savePath);
}
return savePath;
}
示例15: writeSanitizeRulesTo
/**
* This function used to write configured rules to a given \c KConfigGroup.
* It happens on `kate` start and on sanitize rules export.
*
* \param grp a group to write rules to
*
* \todo Use smth more human readable to export sanitize rules? XML?
*/
void PluginConfiguration::writeSanitizeRulesTo(KConfigGroup& grp)
{
// Transform sanitize rules into a serializable list of strings
QStringList rules;
for (auto&& rule : sanitizeRules())
{
auto r = rule.first.pattern();
if (!rule.first.isValid()) // Ignore invalid regular expressions
{
kWarning() << "Ignore invalid sanitize regex: " << r;
continue;
}
if (r.isEmpty()) // Ignore rules w/ empty find part
{
kWarning() << "Ignore invalid sanitize rule: " << rule.second;
continue;
}
if (!rule.second.isEmpty())
r += SANITIZE_RULE_SEPARATOR + rule.second;
rules << r;
}
grp.writePathEntry(SANITIZE_RULES_ITEM, rules);
}