本文整理汇总了C++中KConfig::readEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readEntry方法的具体用法?C++ KConfig::readEntry怎么用?C++ KConfig::readEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSettings
void kSwarmSaver::readSettings()
{
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup( "Settings" );
QString str;
str = config->readEntry( "Speed" );
if ( !str.isNull() )
speed = MAXSPEED - atoi( str );
else
speed = DEFSPEED;
str = config->readEntry( "MaxLevels" );
if ( !str.isNull() )
maxLevels = atoi( str );
else
maxLevels = DEFBATCH;
}
示例2: loadConfig
void KMixApplet::loadConfig()
{
kdDebug(67100) << "KMixApplet::loadConfig()" << endl;
KConfig *cfg = this->config();
cfg->setGroup(0);
_mixerId = cfg->readEntry( "Mixer", "undef" );
_mixerName = cfg->readEntry( "MixerName", QString::null );
_customColors = cfg->readBoolEntry( "ColorCustom", false );
_colors.high = cfg->readColorEntry("ColorHigh", &highColor);
_colors.low = cfg->readColorEntry("ColorLow", &lowColor);
_colors.back = cfg->readColorEntry("ColorBack", &backColor);
_colors.mutedHigh = cfg->readColorEntry("ColorMutedHigh", &mutedHighColor);
_colors.mutedLow = cfg->readColorEntry("ColorMutedLow", &mutedLowColor);
_colors.mutedBack = cfg->readColorEntry("ColorMutedBack", &mutedBackColor);
loadConfig( cfg, "Widget");
}
示例3: loadGlobal
void AStylePart::loadGlobal()
{
// kdDebug(9009) << "Load global"<<endl;
KConfig *config = kapp->config();
config->setGroup("AStyle");
QString options = config->readEntry("Options","BlockBreak=0,BlockBreakAll=0,BlockIfElse=0,Brackets=Break,BracketsCloseHeaders=0,FStyle=UserDefined,Fill=Tabs,FillCount=4,FillEmptyLines=0,FillForce=0,IndentBlocks=0,IndentBrackets=0,IndentCases=0,IndentClasses=1,IndentLabels=1,IndentNamespaces=1,IndentPreprocessors=0,IndentSwitches=1,KeepBlocks=1,KeepStatements=1,MaxStatement=40,MinConditional=-1,PadOperators=0,PadParenthesesIn=1,PadParenthesesOut=1,PadParenthesesUn=1,");
m_globalExtensions=QStringList::split(",",config->readEntry("Extensions",defaultFormatExtensions));
QStringList pairs = QStringList::split( ",", options);
QStringList::Iterator it;
for ( it = pairs.begin(); it != pairs.end(); ++it ) {
QStringList bits = QStringList::split( "=", (*it) );
m_global[bits[0]] = bits[1];
}
// for (QMap<QString, QVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++)
// {
// kdDebug(9009) << "load: " <<iter.key() << "="<< iter.data() << endl;
// }
}
示例4: loadFromConfig
void Modes::loadFromConfig(KConfig &theConfig)
{
clear();
int numModes = theConfig.readNumEntry("Modes");
for(int i = 0; i < numModes; i++)
{
add(Mode().loadFromConfig(theConfig, i));
}
for(iterator i = begin(); i != end(); ++i)
theDefaults[i.key()] = theConfig.readEntry("Default" + i.key());
}
示例5: readConfig
//-----------------------------------------------------------------------------
void KMIdentity::readConfig(void)
{
KConfig* config = kapp->getConfig();
struct passwd* pw;
char str[80];
int i;
config->setGroup("Identity");
mFullName = config->readEntry("Name");
if (mFullName.isEmpty())
{
pw = getpwuid(getuid());
if (pw)
{
mFullName = pw->pw_gecos;
mFullName.detach();
i = mFullName.find(',');
if (i>0) mFullName.truncate(i);
}
}
mEmailAddr = config->readEntry("Email Address");
if (mEmailAddr.isEmpty())
{
pw = getpwuid(getuid());
if (pw)
{
gethostname(str, 79);
mEmailAddr = QString(pw->pw_name) + "@" + str;
mEmailAddr.detach();
}
}
mOrganization = config->readEntry("Organization");
mReplyToAddr = config->readEntry("Reply-To Address");
mSignatureFile = config->readEntry("Signature File");
}
示例6: proxyFor
QString KProtocolManager::proxyFor(const QString &protocol)
{
QString scheme = protocol.lower();
if(scheme == "webdav")
scheme = "http";
else if(scheme == "webdavs")
scheme = "https";
KConfig *cfg = config();
cfg->setGroup("Proxy Settings");
return cfg->readEntry(scheme + "Proxy");
}
示例7: loadSettings
void WStreamAdd::loadSettings()
{
KConfig * conf = new KSimpleConfig(configName());
conf->setGroup("main");
comboBox1->setCurrentItem(conf->readUnsignedNumEntry("type", 1));
kIntNumInput1->setValue(conf->readUnsignedNumEntry("port", 5000));
kLineEdit1->setText(conf->readEntry("host", ""));
slider1->setValue(conf->readUnsignedNumEntry("package", 1));
kIntNumInput2->setValue(conf->readUnsignedNumEntry("length", 40));
checkBox1->setChecked(conf->readBoolEntry("len_rnd", false));
kIntNumInput3->setValue(conf->readUnsignedNumEntry("cov", 8));
checkBox2->setChecked(conf->readBoolEntry("cov_rnd", false));
kLineEdit2->setText(conf->readEntry("filename", ""));
checkBox3->setChecked(conf->readBoolEntry("reloop", false));
delete conf;
typeChanged();
}
示例8: readSettings
void kRockSetup::readSettings()
{
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup( "Settings" );
QString str;
str = config->readEntry( "Speed" );
if ( !str.isNull() )
speed = atoi( str );
if ( speed > 100 )
speed = 100;
else if ( speed < 50 )
speed = 50;
str = config->readEntry( "Number" );
if ( !str.isNull() )
number = atoi( str );
if ( number > 260 )
number = 260;
else if ( speed < 50 )
number = 50;
str = config->readEntry( "Move" );
if ( !str.isNull() && str.find( "yes" ) == 0 )
move = TRUE;
else
move = FALSE;
str = config->readEntry( "Rotate" );
if ( !str.isNull() && str.find( "yes" ) == 0 )
rotate = TRUE;
else
rotate = FALSE;
}
示例9: setAutoDelete
Trigger_list::Trigger_list(KConfig &cfg_P, Action_data *data_P) : QPtrList< Trigger >()
{
setAutoDelete(true);
_comment = cfg_P.readEntry("Comment");
QString save_cfg_group = cfg_P.group();
int cnt = cfg_P.readNumEntry("TriggersCount", 0);
for(int i = 0; i < cnt; ++i)
{
cfg_P.setGroup(save_cfg_group + QString::number(i));
Trigger *trigger = Trigger::create_cfg_read(cfg_P, data_P);
if(trigger)
append(trigger);
}
cfg_P.setGroup(save_cfg_group);
}
示例10: _readSettings
void ThemeStandard::_readSettings()
{
if ( !mTheme )
return;
KConfig *cfg = mTheme->themeConfig();
if ( !cfg )
return;
//if ( !cfg->hasGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) ) )
// return;
cfg->setGroup( QString("KSplash Theme: %1").arg(mTheme->theme()) );
QString sbpos = cfg->readEntry( "Statusbar Position", "Bottom" ).upper();
mSbAtTop = ( sbpos == "TOP" );
mSbVisible = cfg->readBoolEntry( "Statusbar Visible", true);
mSbPbVisible = cfg->readBoolEntry( "Progress Visible", true);
mSbFontName = cfg->readEntry( "Statusbar Font", "Sans Serif" );
mSbFontSz = cfg->readNumEntry( "Statusbar Font Size", 16 );
mSbFontBold = cfg->readBoolEntry( "Statusbar Font Bold", true );
mSbFontItalic = cfg->readBoolEntry( "Statusbar Font Italic", false );
mSbFont = QFont( mSbFontName, mSbFontSz, ( mSbFontBold? QFont::Bold : QFont::Normal ) );
if( mSbFontItalic )
mSbFont.setItalic( true );
mSbFg = cfg->readColorEntry( "Statusbar Foreground", &Qt::white );
mSbBg = cfg->readColorEntry( "Statusbar Background", &Qt::black );
mSbIcon = cfg->readEntry( "Statusbar Icon", "run" );
mIconsVisible = cfg->readBoolEntry( "Icons Visible", true);
mIconsJumping = cfg->readBoolEntry( "Icons Jumping", true);
mIconPos = (WndIcon::Position)cfg->readNumEntry( "Icon Position", 0 );
mSplashScreen = cfg->readEntry( "Splash Screen", "(Default)");
// cfg->readBoolEntry( "Allow Configuration", true );
}
示例11: readSettings
void kSpaceSaver::readSettings()
{
KConfig *config = klock_config();
config->setGroup( "Settings" );
TQString str;
str = config->readEntry( "Speed" );
if ( !str.isNull() )
speed = MAXSPEED - str.toInt();
else
speed = DEFSPEED;
warpinterval = config->readNumEntry( "WarpInterval", 15 );
delete config;
}
示例12: slotTerminal
void KfmView::slotTerminal()
{
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup( "KFM Misc Defaults" );
QString term = config->readEntry( "Terminal", DEFAULT_TERMINAL );
QString dir ( QDir::homeDirPath() );
KURL u( manager->getURL() );
if ( strcmp( u.protocol(), "file" ) == 0 && !u.hasSubProtocol() )
dir = u.path();
QString cmd;
cmd << "cd \"" << dir << "\" ; " << term << "&";
system( cmd.data() );
}
示例13: startArts
static bool startArts()
{
KConfig *config = new KConfig("kcmartsrc", true, false);
config->setGroup("Arts");
bool startServer = config->readBoolEntry("StartServer",true);
bool startRealtime = config->readBoolEntry("StartRealtime",true);
QString args = config->readEntry("Arguments","-F 10 -S 4096 -s 60 -m artsmessage -c drkonqi -l 3 -f");
delete config;
if (startServer)
kapp->kdeinitExec(startRealtime?"artswrapper":"artsd",
QStringList::split(" ",args));
return startServer;
}
示例14: file
SigGenerator::SigGenerator()
{
QString dir = KGlobal::dirs()->saveLocation("appdata");
QFile file(dir + "sigs.sigml");
if(file.open(IO_ReadOnly) && doc.setContent(&file)) {
signatures = doc.elementsByTagName("signature");
file.close();
}
KConfig *config = KGlobal::config();
{
KConfigGroupSaver saver(config, "Settings");
header = config->readEntry("Header");
footer = config->readEntry("Footer");
}
}
示例15: buildPixmap
QString buildPixmap(const QString &name, KConfig &input, const QString &iconPath)
{
input.setGroup(name);
QString cleanName = name.lower().replace(":", "_");
QString iconName = input.readEntry("IconSet", cleanName + ".png");
QFileInfo fi(iconPath + "/" + iconName);
QImage pix(fi.absFilePath());
QCString xpm;
QBuffer buff(xpm);
buff.open(IO_WriteOnly);
QImageIO io(&buff, "XPM");
io.setFileName(cleanName + "_xpm");
io.setImage(pix);
io.write();
buff.close();
return xpm;
}