本文整理汇总了C++中KConfig::readBoolEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readBoolEntry方法的具体用法?C++ KConfig::readBoolEntry怎么用?C++ KConfig::readBoolEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readBoolEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadSettings
void DMainWindow::loadSettings()
{
KConfig *config = kapp->config();
config->setGroup("UI");
m_openTabAfterCurrent = config->readBoolEntry("OpenNewTabAfterCurrent", true);
m_showIconsOnTabs = config->readBoolEntry("ShowTabIcons", false);
}
示例2: readSettings
void KatapultSettings::readSettings()
{
KConfig *config = kapp->config();
_hideSessionNotification = config->readNumEntry("HideSessionNotification", 1);
_hideUserNotification = config->readNumEntry("HideUserNotification", 0);
_notificationTimeout = config->readNumEntry("NotificationTimeout", 5000);
_hideDelay = config->readUnsignedNumEntry("HideDelay", 1000);
_noResultsDelay = config->readUnsignedNumEntry("NoResultsDelay", 2500);
_noResultsAction = (NRAction) config->readUnsignedNumEntry("NoResultsAction", NR_ClearQuery);
_systrayIcon = config->readBoolEntry("SystrayIcon", TRUE);
_autoExec = config->readBoolEntry("AutoExec", FALSE);
_displayName = config->readEntry("Display", "Pure Display");
if (_displayName == "Name=Glass Display")
{
_displayName = "Glass Display";
}
QStringList defCatalogs;
defCatalogs << "Program Catalog" << "Bookmark Catalog" << "Document Catalog" << "Calculator Catalog" << "Amarok Catalog" << "Spell Catalog" << "Google Catalog" << "Execution Catalog";
_activeCatalogNames = config->readListEntry("Catalogs", defCatalogs);
// Force a config write if notification is to be shown once.
// (in writeSettings(), _hideSessionNotification or _hideUserNotification
// is changed before writing [if necessary]).
_forceWrite = ((kapp->isSessionRestored() && _hideSessionNotification == 1) ||
(!kapp->isSessionRestored() && _hideUserNotification == 1));
}
示例3: 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);
}
示例4: readColorEntry
void
KTreemapView::readConfig()
{
KConfig * config = kapp->config();
config->setGroup( "Treemaps" );
_ambientLight = config->readNumEntry( "AmbientLight" , DefaultAmbientLight );
_heightScaleFactor = config->readDoubleNumEntry( "HeightScaleFactor" , DefaultHeightScaleFactor );
_autoResize = config->readBoolEntry( "AutoResize" , true );
_squarify = config->readBoolEntry( "Squarify" , true );
_doCushionShading = config->readBoolEntry( "CushionShading" , true );
_ensureContrast = config->readBoolEntry( "EnsureContrast" , true );
_forceCushionGrid = config->readBoolEntry( "ForceCushionGrid" , false );
_minTileSize = config->readNumEntry ( "MinTileSize" , DefaultMinTileSize );
_highlightColor = readColorEntry( config, "HighlightColor" , red );
_cushionGridColor = readColorEntry( config, "CushionGridColor" , QColor( 0x80, 0x80, 0x80 ) );
_outlineColor = readColorEntry( config, "OutlineColor" , black );
_fileFillColor = readColorEntry( config, "FileFillColor" , QColor( 0xde, 0x8d, 0x53 ) );
_dirFillColor = readColorEntry( config, "DirFillColor" , QColor( 0x10, 0x7d, 0xb4 ) );
if ( _autoResize )
{
setHScrollBarMode( AlwaysOff );
setVScrollBarMode( AlwaysOff );
}
else
{
setHScrollBarMode( QScrollView::Auto );
setVScrollBarMode( QScrollView::Auto );
}
}
示例5: readColorEntry
void
KTreemapPage::setup()
{
KConfig * config = kapp->config();
config->setGroup( "Treemaps" );
_squarify->setChecked ( config->readBoolEntry( "Squarify" , true ) );
_doCushionShading->setChecked ( config->readBoolEntry( "CushionShading" , true ) );
_ambientLight->setValue ( config->readNumEntry( "AmbientLight" , DefaultAmbientLight ) );
_heightScalePercent->setValue( (int) ( 100 * config->readDoubleNumEntry ( "HeightScaleFactor", DefaultHeightScaleFactor ) ) );
_ensureContrast->setChecked ( config->readBoolEntry( "EnsureContrast" , true ) );
_forceCushionGrid->setChecked ( config->readBoolEntry( "ForceCushionGrid" , false ) );
_minTileSize->setValue ( config->readNumEntry ( "MinTileSize" , DefaultMinTileSize ) );
_autoResize->setChecked ( config->readBoolEntry( "AutoResize" , true ) );
_cushionGridColor->setColor ( readColorEntry( config, "CushionGridColor" , QColor( 0x80, 0x80, 0x80 ) ) );
_outlineColor->setColor ( readColorEntry( config, "OutlineColor" , black ) );
_fileFillColor->setColor ( readColorEntry( config, "FileFillColor" , QColor( 0xde, 0x8d, 0x53 ) ) );
_dirFillColor->setColor ( readColorEntry( config, "DirFillColor" , QColor( 0x10, 0x7d, 0xb4 ) ) );
_highlightColor->setColor ( readColorEntry( config, "HighlightColor" , red ) );
_ambientLightSB->setValue( _ambientLight->value() );
_heightScalePercentSB->setValue( _heightScalePercent->value() );
checkEnabledState();
}
示例6: KScreenSaver
KPartSaver::KPartSaver( WId id )
: KScreenSaver( id ), m_timer(), m_part(0), m_current(-1), m_back(0)
{
// install signal handlers to make sure that nspluginviewer is shutdown correctly
// move this into the nspluginviewer kpart code
if( !g_inited ) {
g_inited = true;
g_savers.setAutoDelete( true );
srand( time(0) );
// install signal handler
signal( SIGINT, exitHandler ); // Ctrl-C will cause a clean exit...
signal( SIGTERM, exitHandler ); // "kill"...
signal( SIGHUP, exitHandler ); // "kill -HUP" (hangup)...
signal( SIGKILL, exitHandler ); // "kill -KILL"
//atexit( ( void (*)(void) ) exitHandler );
}
g_savers.append( this );
closeURL();
// load config
KConfig *cfg = kapp->config();
cfg->setGroup( "Misc" );
m_single = cfg->readBoolEntry( "Single", true );
m_delay = cfg->readNumEntry( "Delay", 60 );
m_random = cfg->readBoolEntry( "Random", false );
m_files = cfg->readListEntry( "Files" );
if( m_files.count()==0 ) {
// create background widget
m_back = new TQLabel( i18n("The screen saver is not configured yet."), this );
m_back->tqsetAlignment( AlignCenter );
embed( m_back );
m_back->show();
} else {
// queue files
for( unsigned int n=0; n<m_files.count(); n++ )
queue( KURL::fromPathOrURL( m_files[n] ) );
// play files
if( m_single )
next( m_random );
else {
next( m_random );
m_timer = new TQTimer( this );
m_timer->start( m_delay*1000, true );
connect( m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()) );
}
}
}
示例7:
void Kopete::Away::load()
{
KConfig *config = KGlobal::config();
config->setGroup("AutoAway");
d->awayTimeout=config->readNumEntry("Timeout", 600);
d->goAvailable=config->readBoolEntry("GoAvailable", true);
d->useAutoAway=config->readBoolEntry("UseAutoAway", true);
d->useAutoAwayMessage=config->readBoolEntry("UseAutoAwayMessage", false);
}
示例8: KListViewItem
void K3bCddbOptionTab::readSettings()
{
KConfig* c = kapp->config();
c->setGroup( "Cddb" );
// old config <= 0.7.3
QStringList cddbpServer = c->readListEntry( "cddbp server" );
QStringList httpServer = c->readListEntry( "http server" );
// new config
QStringList cddbServer = c->readListEntry( "cddb server" );
QStringList localCddbDirs = c->readPathListEntry( "local cddb dirs" );
m_checkRemoteCddb->setChecked( c->readBoolEntry( "use remote cddb", true ) );
m_checkUseLocalCddb->setChecked( c->readBoolEntry( "use local cddb query", true ) );
m_checkSaveLocalEntries->setChecked( c->readBoolEntry( "save cddb entries locally", true ) );
m_checkManualCgiPath->setChecked( c->readBoolEntry( "use manual cgi path", false ) );
m_editManualCgiPath->setText( c->readEntry( "cgi path", "/~cddb/cddb.cgi" ) );
if( localCddbDirs.isEmpty() )
localCddbDirs.append( "~/.cddb/" );
for( QStringList::const_iterator it = localCddbDirs.begin(); it != localCddbDirs.end(); ++it )
(void)new KListViewItem( m_viewLocalDir, m_viewLocalDir->lastItem(), *it );
// old config <= 0.7.3
if( !httpServer.isEmpty() ) {
for( QStringList::iterator it = httpServer.begin(); it != httpServer.end(); ++it ) {
cddbServer.append( "Http " + *it );
}
}
if( !cddbpServer.isEmpty() ) {
for( QStringList::iterator it = cddbpServer.begin(); it != cddbpServer.end(); ++it ) {
cddbServer.append( "Cddbp " + *it );
}
}
if( cddbServer.isEmpty() )
cddbServer.append( "Http freedb2.org:80" );
for( QStringList::const_iterator it = cddbServer.begin(); it != cddbServer.end(); ++it ) {
const QString& s = *it;
QStringList buf = QStringList::split( ":", s.mid( s.find(" ")+1 ) );
QString server = buf[0];
int port = buf[1].toInt();
if( s.startsWith("Http") )
(void)new KListViewItem( m_viewCddbServer, m_viewCddbServer->lastItem(), "Http", server, QString::number(port) );
else
(void)new KListViewItem( m_viewCddbServer, m_viewCddbServer->lastItem(), "Cddbp", server, QString::number(port) );
}
enDisableButtons();
}
示例9: configRead
/** Read settings */
void KEducaPrefs::configRead()
{
KConfig *config = KGlobal::config();
config->setGroup("Options");
QSize defaultSize(500,400);
resize( config->readSizeEntry("Geometry", &defaultSize ) );
config->readBoolEntry("ResultFinish", true ) ? _resultAfterFinish->setChecked(true) : _resultAfterNext->setChecked(true);
config->readBoolEntry("RandomQuestions", false ) ? _randomQuestions->setChecked(true) : _randomQuestions->setChecked(false);
config->readBoolEntry("RandomAnswers", false ) ? _randomAnswers->setChecked(true) : _randomAnswers->setChecked(false);
}
示例10: readConfigColor
void ColorSchema::readConfigColor(KConfig& c,
const QString& name,
ColorEntry& e)
{
KConfigGroupSaver(&c,name);
c.setGroup(name);
e.color = c.readColorEntry("Color");
e.transparent = c.readBoolEntry("Transparent",false);
e.bold = c.readBoolEntry("Bold",false);
}
示例11: PrintStyle
DetailledPrintStyle::DetailledPrintStyle( PrintingWizard *parent, const char *name )
: PrintStyle( parent, name ),
mPageAppearance( new AppearancePage( parent, "AppearancePage" ) ),
mPainter( 0 ),
mPrintProgress( 0 )
{
KConfig *config;
QFont font;
bool kdeFonts;
QFont standard = KGlobalSettings::generalFont();
QFont fixed = KGlobalSettings::fixedFont();
setPreview( "detailed-style.png" );
addPage( mPageAppearance, i18n( "Detailed Print Style - Appearance" ) );
config = kapp->config();
config->setGroup( ConfigSectionName );
kdeFonts = config->readBoolEntry( UseKDEFonts, true );
mPageAppearance->cbStandardFonts->setChecked( kdeFonts );
font = config->readFontEntry( HeaderFont, &standard );
mPageAppearance->kfcHeaderFont->setCurrentFont( font.family() );
mPageAppearance->kisbHeaderFontSize->setValue( font.pointSize() );
font = config->readFontEntry( HeadlinesFont, &standard );
mPageAppearance->kfcHeadlineFont->setCurrentFont( font.family() );
mPageAppearance->kisbHeadlineFontSize->setValue( font.pointSize() );
font = config->readFontEntry( BodyFont, &standard );
mPageAppearance->kfcBodyFont->setCurrentFont( font.family() );
mPageAppearance->kisbBodyFontSize->setValue( font.pointSize() );
font = config->readFontEntry( DetailsFont, &standard );
mPageAppearance->kfcDetailsFont->setCurrentFont( font.family() );
mPageAppearance->kisbDetailsFontSize->setValue( font.pointSize() );
font = config->readFontEntry( FixedFont, &fixed );
mPageAppearance->kfcFixedFont->setCurrentFont( font.family() );
mPageAppearance->kisbFixedFontSize->setValue( font.pointSize() );
mPageAppearance->cbBackgroundColor->setChecked(
config->readBoolEntry( ColoredContactHeaders, true ) );
mPageAppearance->kcbHeaderBGColor->setColor(
config->readColorEntry( ContactHeaderBGColor, &Qt::black ) );
mPageAppearance->kcbHeaderTextColor->setColor(
config->readColorEntry( ContactHeaderForeColor, &Qt::white ) );
mPageAppearance->layout()->setMargin( KDialog::marginHint() );
mPageAppearance->layout()->setSpacing( KDialog::spacingHint() );
}
示例12: load
void UIChooserWidget::load()
{
KConfig *config = kapp->config();
config->setGroup("UI");
int mdistyle = config->readNumEntry( "MDIStyle", 1 );
switch( mdistyle )
{
case 0:
IconsOnly->setChecked( true );
break;
case 1:
TextOnly->setChecked( true );
break;
case 3:
TextAndIcons->setChecked( true );
break;
default:
TextOnly->setChecked( true );
}
int tabVisibility = config->readNumEntry( "TabWidgetVisibility", _AlwaysShowTabs );
switch( tabVisibility )
{
case _AlwaysShowTabs:
AlwaysShowTabs->setChecked( true );
break;
case _NeverShowTabs:
NeverShowTabs->setChecked( true );
break;
}
bool CloseOnHover = config->readBoolEntry( "CloseOnHover", false );
if ( CloseOnHover )
{
DoCloseOnHover->setChecked( true );
}
else
{
DoNotCloseOnHover->setChecked( true );
}
OpenNewTabAfterCurrent->setChecked(config->readBoolEntry( "OpenNewTabAfterCurrent", false ));
ShowTabIcons->setChecked(config->readBoolEntry( "ShowTabIcons", true ));
ShowCloseTabsButton->setChecked(config->readBoolEntry( "ShowCloseTabsButton", true ));
maybeEnableCloseOnHover(false);
}
示例13: init_keyboard
void KeyboardConfig::init_keyboard()
{
KConfig *config = new KConfig("kcminputrc", true); // Read-only, no globals
config->setGroup("Keyboard");
XKeyboardState kbd;
XKeyboardControl kbdc;
XGetKeyboardControl(kapp->getDisplay(), &kbd);
bool key = config->readBoolEntry("KeyboardRepeating", true);
kbdc.key_click_percent = config->readNumEntry("ClickVolume", kbd.key_click_percent);
kbdc.auto_repeat_mode = (key ? AutoRepeatModeOn : AutoRepeatModeOff);
XChangeKeyboardControl(kapp->getDisplay(),
KBKeyClickPercent | KBAutoRepeatMode,
&kbdc);
if( key ) {
int delay_ = config->readNumEntry("RepeatDelay", 250);
double rate_ = config->readDoubleNumEntry("RepeatRate", 30);
set_repeatrate(delay_, rate_);
}
int numlockState = config->readNumEntry( "NumLock", 2 );
if( numlockState != 2 )
numlockx_change_numlock_state( numlockState == 0 );
delete config;
}
示例14: 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);
}
示例15: kForceLocker
void kForceLocker()
{
if( sendSignal() != 0 )
{
KConfig *kdisplayConfig = new KConfig( kapp->kde_configdir() + "/kdisplayrc",
kapp->localconfigdir() + "/kdisplayrc" );
kdisplayConfig->setGroup("ScreenSaver");
bool allowRoot = kdisplayConfig->readBoolEntry( "allowRoot", false );
delete kdisplayConfig;
char *root = "-allow-root";
if( !allowRoot )
root = 0;
// either no saver is running or an old pidFile was not removed
QString buffer = QString(KApplication::kde_bindir().data());
buffer.append("/kblankscrn.kss");
if ( fork() == 0 )
{
execlp( buffer, buffer, "-install", "-delay", "0", "-lock", root, 0 );
// if we make it here then try again using default path
execlp("kblankscrn.kss","kblankscrn.kss", "-install", "-delay", "0", "-lock", root, 0);
// uh oh - failed
fprintf( stderr, "Could not invoke kblankscrn.kss in $PATH or"
" %s/bin\n" , KApplication::kde_bindir().data());
exit (1);
}
}
}