本文整理汇总了C++中KConfig::readPathEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readPathEntry方法的具体用法?C++ KConfig::readPathEntry怎么用?C++ KConfig::readPathEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readPathEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void KHTMLSearchConfig::load()
{
KConfig *config = new KConfig("khelpcenterrc", true);
config->setGroup("htdig");
htdigBin->lineEdit()->setText(config->readPathEntry("htdig", kapp->dirs()->findExe("htdig")));
htsearchBin->lineEdit()->setText(config->readPathEntry("htsearch", kapp->dirs()->findExe("htsearch")));
htmergeBin->lineEdit()->setText(config->readPathEntry("htmerge", kapp->dirs()->findExe("htmerge")));
config->setGroup("Scope");
indexKDE->setChecked(config->readBoolEntry("KDE", true));
indexMan->setChecked(config->readBoolEntry("Man", false));
indexInfo->setChecked(config->readBoolEntry("Info", false));
QStringList l = config->readPathListEntry("Paths");
searchPaths->clear();
QStringList::Iterator it;
for (it=l.begin(); it != l.end(); ++it)
searchPaths->insertItem(*it);
config->setGroup("Locale");
QString lang = config->readEntry("Search Language", KGlobal::locale()->language());
language->setCurrentItem(lang);
emit changed(false);
}
示例2: loadSettings
void KPrinter::loadSettings()
{
d->m_options = d->m_impl->loadOptions();
// load the last printer used in the current process (if any)
// and remove the corresponding entry in the option map, as it
// is not needed anymore
setSearchName(option("kde-searchname"));
d->m_options.remove("kde-searchname");
KConfig *conf = KGlobal::config(), *pconf = KMFactory::self()->printConfig();
conf->setGroup("KPrinter Settings");
pconf->setGroup("General");
// load latest used printer from config file, if required in the options
if (searchName().isEmpty() && pconf->readBoolEntry("UseLast", true))
setSearchName(conf->readEntry("Printer"));
// latest used print command
setOption("kde-printcommand",conf->readPathEntry("PrintCommand"));
// latest used document directory
setDocDirectory( conf->readPathEntry( "DocDirectory" ) );
setDocFileName( "print" );
}
示例3: loadContainerConfig
void DockBarExtension::loadContainerConfig()
{
KConfig *conf = config();
conf->setGroup("General");
QStringList applets = conf->readListEntry("Applets");
QStringList fail_list;
for(QStringList::Iterator it = applets.begin(); it != applets.end(); ++it)
{
if(!conf->hasGroup(*it))
continue;
conf->setGroup(*it);
QString cmd = conf->readPathEntry("Command");
QString resName = conf->readPathEntry("resName");
QString resClass = conf->readEntry("resClass");
if(cmd.isEmpty() || resName.isEmpty() || resClass.isEmpty())
continue;
DockContainer *c = new DockContainer(cmd, this, resName, resClass);
addContainer(c);
KProcess proc;
proc << KShell::splitArgs(cmd);
if(!proc.start(KProcess::DontCare))
{
fail_list.append(cmd);
removeContainer(c);
}
}
if(!fail_list.isEmpty())
KMessageBox::queuedMessageBox(0, KMessageBox::Information,
i18n("The following dockbar applets could not be started: %1").arg(fail_list.join(", ")),
i18n("kicker: information"), 0);
saveContainerConfig();
}
示例4: 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;
}
示例5: programName
QString KMLpdManager::programName(int f)
{
KConfig *conf = KMFactory::self()->printConfig();
conf->setGroup("LPD");
switch (f)
{
case 0: return conf->readPathEntry("LpdCommand","/usr/sbin/lpc");
case 1: return conf->readPathEntry("LpdQueue","lpq");
case 2: return conf->readPathEntry("LpdRemove","lprm");
}
return QString::null;
}
示例6: loadConfig
void KNotify::loadConfig()
{
// load external player settings
KConfig *kc = KGlobal::config();
kc->setGroup("Misc");
d->useExternal = kc->readBoolEntry("Use external player", false);
d->externalPlayer = kc->readPathEntry("External player");
// try to locate a suitable player if none is configured
if(d->externalPlayer.isEmpty())
{
QStringList players;
players << "wavplay"
<< "aplay"
<< "auplay";
QStringList::Iterator it = players.begin();
while(d->externalPlayer.isEmpty() && it != players.end())
{
d->externalPlayer = KStandardDirs::findExe(*it);
++it;
}
}
// load default volume
d->volume = kc->readNumEntry("Volume", 100);
}
示例7: createGlobalSettingsPage
void KDevIDEExtension::createGlobalSettingsPage(KDialogBase *dlg)
{
KConfig* config = kapp->config();
QVBox *vbox = dlg->addVBoxPage(i18n("General"), i18n("General"), BarIcon("kdevelop", KIcon::SizeMedium) );
gsw = new SettingsWidget(vbox, "general settings widget");
gsw->projectsURL->setMode((int)KFile::Directory);
config->setGroup("General Options");
gsw->lastProjectCheckbox->setChecked(config->readBoolEntry("Read Last Project On Startup",true));
gsw->outputFont->setFont( config->readFontEntry( "OutputViewFont" ) );
config->setGroup("MakeOutputView");
gsw->lineWrappingCheckBox->setChecked(config->readBoolEntry("LineWrapping",true));
gsw->dirNavigMsgCheckBox->setChecked(config->readBoolEntry("ShowDirNavigMsg",false));
gsw->compileOutputCombo->setCurrentItem(config->readNumEntry("CompilerOutputLevel",2));
gsw->forceCLocaleRadio->setChecked( config->readBoolEntry( "ForceCLocale", true ) );
gsw->userLocaleRadio->setChecked( !config->readBoolEntry( "ForceCLocale", true ) );
config->setGroup("General Options");
gsw->projectsURL->setURL(config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/"));
gsw->designerButtonGroup->setButton( config->readNumEntry( "DesignerApp", 0 ) );
QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" );
gsw->qtDesignerRadioButton->setChecked( DesignerSetting == "ExternalDesigner" );
gsw->seperateAppRadioButton->setChecked( DesignerSetting == "ExternalKDevDesigner" );
gsw->embeddedDesignerRadioButton->setChecked( DesignerSetting == "EmbeddedKDevDesigner" );
config->setGroup("TerminalEmulator");
gsw->terminalEdit->setText( config->readEntry( "TerminalApplication", QString::fromLatin1("konsole") ) );
bool useKDESetting = config->readBoolEntry( "UseKDESetting", true );
gsw->useKDETerminal->setChecked( useKDESetting );
gsw->useOtherTerminal->setChecked( !useKDESetting );
}
示例8: slFontChanged
void KadmosDialog::slFontChanged( int id )
{
m_cbLang->clear();
KConfig *conf = KGlobal::config ();
KConfigGroupSaver gs( conf, CFG_GROUP_KADMOS );
m_customClassifierPath = conf->readPathEntry( CFG_KADMOS_CLASSIFIER_PATH );
bool enable = true;
if( id == 0 ) /* Machine Print */
{
m_cbLang->insertStringList( m_ttfClassifier );
}
else if( id == 1 ) /* Hand Writing */
{
m_cbLang->insertStringList( m_handClassifier );
}
else if( id == 2 ) /* Norm Font */
{
enable = false;
}
m_cbLang->setEnabled( enable );
}
示例9: findClassifierPath
EngineError KadmosDialog::findClassifierPath()
{
KStandardDirs stdDir;
EngineError err = ENG_OK;
KConfig *conf = KGlobal::config ();
KConfigGroupSaver gs( conf, CFG_GROUP_KADMOS );
m_customClassifierPath = conf->readPathEntry( CFG_KADMOS_CLASSIFIER_PATH );
#if 0
if( m_customClassifierPath == "NotFound" )
{
/* Wants the classifiers from the standard kde paths */
KMessageBox::error(0, i18n("The classifier files for KADMOS could not be found.\n"
"OCR with KADMOS will not be possible!\n\n"
"Change the OCR engine in the preferences dialog."),
i18n("Installation Error") );
}
else
{
m_classifierPath = customPath;
}
#endif
return err;
}
示例10: loadSettings
void WebPresencePlugin::loadSettings()
{
KConfig *kconfig = KGlobal::config();
kconfig->setGroup( "Web Presence Plugin" );
frequency = kconfig->readNumEntry("UploadFrequency", 15);
resultURL = kconfig->readPathEntry("uploadURL");
resultFormatting = WEB_UNDEFINED;
if ( kconfig->readBoolEntry( "formatHTML", false ) ) {
resultFormatting = WEB_HTML;
} else if ( kconfig->readBoolEntry( "formatXHTML", false ) ) {
resultFormatting = WEB_XHTML;
} else if ( kconfig->readBoolEntry( "formatXML", false ) ) {
resultFormatting = WEB_XML;
} else if ( kconfig->readBoolEntry( "formatStylesheet", false ) ) {
resultFormatting = WEB_CUSTOM;
userStyleSheet = kconfig->readEntry("formatStylesheetURL");
}
// Default to HTML if we dont get anything useful from config file.
if ( resultFormatting == WEB_UNDEFINED )
resultFormatting = WEB_HTML;
useImagesInHTML = kconfig->readBoolEntry( "useImagesHTML", false );
useImName = kconfig->readBoolEntry("showName", true);
userName = kconfig->readEntry("showThisName");
showAddresses = kconfig->readBoolEntry("includeIMAddress", false);
// Update file when settings are changed.
slotWriteFile();
}
示例11: configGroup
void K3bIsoImageWritingDialog::init()
{
if( !d->imageForced ) {
// when opening the dialog first the default settings are loaded and afterwards we set the
// last written image because that's what most users want
KConfig* c = k3bcore->config();
c->setGroup( configGroup() );
QString image = c->readPathEntry( "last written image" );
if( QFile::exists( image ) )
m_editImagePath->setURL( image );
}
}
示例12: readConfig
/******************************************************************************
* Read the configuration file.
* Create the client list and open all calendar files.
*/
void ADConfigData::readConfig()
{
kdDebug(5900) << "ADConfigData::readConfig()" << endl;
ClientInfo::clear();
KConfig *config = KGlobal::config();
QStringList clients = config->groupList().grep(CLIENT_GROUP_SEARCH);
for(QStringList::Iterator cl = clients.begin(); cl != clients.end(); ++cl)
{
// Read this client's configuration
config->setGroup(*cl);
QString client = *cl;
client.remove(CLIENT_GROUP_SEARCH);
QString title = config->readEntry(TITLE_KEY, client); // read app title (default = app name)
QCString dcopObject = config->readEntry(DCOP_OBJECT_KEY).local8Bit();
bool startClient = config->readBoolEntry(START_CLIENT_KEY, false);
QString calendar = config->readPathEntry(CALENDAR_KEY);
// Verify the configuration
bool ok = false;
if(client.isEmpty() || KStandardDirs::findExe(client).isNull())
kdError(5900) << "ADConfigData::readConfig(): group '" << *cl << "' deleted (client app not found)\n";
else if(calendar.isEmpty())
kdError(5900) << "ADConfigData::readConfig(): no calendar specified for '" << client << "'\n";
else if(dcopObject.isEmpty())
kdError(5900) << "ADConfigData::readConfig(): no DCOP object specified for '" << client << "'\n";
else
{
ADCalendar *cal = ADCalendar::getCalendar(calendar);
if(cal)
kdError(5900) << "ADConfigData::readConfig(): calendar registered by multiple clients: " << calendar << endl;
else
ok = true;
}
if(!ok)
{
config->deleteGroup(*cl, true);
continue;
}
// Create the client and calendar objects
new ClientInfo(client.local8Bit(), title, dcopObject, calendar, startClient);
kdDebug(5900) << "ADConfigData::readConfig(): client " << client << " : calendar " << calendar << endl;
}
// Remove obsolete CheckInterval entry (if it exists)
config->setGroup("General");
config->deleteEntry("CheckInterval");
// Save any updates
config->sync();
}
示例13: slotOpenTerminal
void PanelBrowserMenu::slotOpenTerminal()
{
KConfig * config = kapp->config();
config->setGroup("General");
QString term = config->readPathEntry("TerminalApplication", "konsole");
KProcess proc;
proc << term;
if (term == "konsole")
proc << "--workdir" << path();
else
proc.setWorkingDirectory(path());
proc.start(KProcess::DontCare);
}
示例14: readAppSetting
void EditorChooser::readAppSetting(const QString &postfix)
{
KConfig *cfg = kapp->config();
QString previousGroup = cfg->group();
cfg->setGroup("KTEXTEDITOR:" + postfix);
QString editor = cfg->readPathEntry("editor");
if(editor.isEmpty())
d->chooser->editorCombo->setCurrentItem(0);
else
{
int idx = d->elements.findIndex(editor);
idx = idx + 1;
d->chooser->editorCombo->setCurrentItem(idx);
}
cfg->setGroup(previousGroup);
}
示例15: load
void CfgTerminalEmulator::load(KConfig *)
{
KConfig *config = new KConfig("kdeglobals", true);
config->setGroup("General");
QString terminal = config->readPathEntry("TerminalApplication", "konsole");
if(terminal == "konsole")
{
terminalLE->setText("xterm");
terminalCB->setChecked(true);
}
else
{
terminalLE->setText(terminal);
otherCB->setChecked(true);
}
delete config;
emit changed(false);
}