本文整理汇总了C++中KConfig::readNumEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readNumEntry方法的具体用法?C++ KConfig::readNumEntry怎么用?C++ KConfig::readNumEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readNumEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: load
void FontDialog::load()
{
KConfig *cfg = kapp->config();
{
KConfigGroupSaver groupSaver(cfg, "HTML Settings");
m_minFontSize->setValue(cfg->readNumEntry("MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE));
m_medFontSize->setValue(cfg->readNumEntry("MediumFontSize", 10));
QStringList fonts = cfg->readListEntry("Fonts");
if(fonts.isEmpty())
fonts << KGlobalSettings::generalFont().family() << KGlobalSettings::fixedFont().family() << HTML_DEFAULT_VIEW_SERIF_FONT
<< HTML_DEFAULT_VIEW_SANSSERIF_FONT << HTML_DEFAULT_VIEW_CURSIVE_FONT << HTML_DEFAULT_VIEW_FANTASY_FONT;
m_standardFontCombo->setCurrentFont(fonts[0]);
m_fixedFontCombo->setCurrentFont(fonts[1]);
m_serifFontCombo->setCurrentFont(fonts[2]);
m_sansSerifFontCombo->setCurrentFont(fonts[3]);
m_italicFontCombo->setCurrentFont(fonts[4]);
m_fantasyFontCombo->setCurrentFont(fonts[5]);
m_defaultEncoding->setCurrentItem(cfg->readEntry("DefaultEncoding"));
m_fontSizeAdjustement->setValue(fonts[6].toInt());
}
}
示例3: WaWidget
GuiSpectrumAnalyser::GuiSpectrumAnalyser()
: WaWidget(_WA_MAPPING_ANALYSER)
{
connect(WaSkinModel::instance(), SIGNAL(skinChanged()), this, SLOT(pixmapChange()));
contextMenu = new QPopupMenu(this);
visualizationMenu = new QPopupMenu();
analyserMenu = new QPopupMenu();
contextMenu->insertItem(i18n("Visualization Mode"), visualizationMenu);
contextMenu->insertItem(i18n("Analyzer Mode"), analyserMenu);
visualizationMenu->insertItem(i18n("Analyzer"), (int)MODE_ANALYSER);
visualizationMenu->insertItem(i18n("Disabled"), (int)MODE_DISABLED);
visualizationMenu->setCheckable(true);
connect(visualizationMenu, SIGNAL(activated(int)), this, SLOT(setVisualizationMode(int)));
analyserMenu->insertItem(i18n("Normal"), (int)MODE_NORMAL);
analyserMenu->insertItem(i18n("Fire"), (int)MODE_FIRE);
analyserMenu->insertItem(i18n("Vertical Lines"), (int)MODE_VERTICAL_LINES);
analyserMenu->setCheckable(true);
connect(analyserMenu, SIGNAL(activated(int)), this, SLOT(setAnalyserMode(int)));
analyserCache = NULL;
winSkinVis = NULL;
KConfig *config = KGlobal::config();
config->setGroup("Winskin");
setVisualizationMode(config->readNumEntry("visualizationMode", MODE_ANALYSER));
setAnalyserMode(config->readNumEntry("analyserMode", MODE_NORMAL));
}
示例4: getColorString
button::button(blinkenGame::color c) : m_selected(false), m_color(c)
{
KConfig *kc = kapp->config();
kc->setGroup("General");
QString cs = getColorString();
QString pixmap = QString("images/%1h.png").arg(cs);
switch (c)
{
case blinkenGame::blue:
m_key = kc->readNumEntry(cs, Qt::Key_3);
break;
case blinkenGame::yellow:
m_key = kc->readNumEntry(cs, Qt::Key_1);
break;
case blinkenGame::red:
m_key = kc->readNumEntry(cs, Qt::Key_2);
break;
case blinkenGame::green:
m_key = kc->readNumEntry(cs, Qt::Key_4);
break;
default:
// never happens
break;
}
m_highlighted = new QPixmap(locate("appdata", pixmap));
}
示例5: 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 );
}
}
示例6: saveGroup
void
KASearchSettings::readConfig()
{
int tmp;
KConfig *config = KApplication::getKApplication()->getConfig();
KConfigGroupSaver saveGroup( config, "SearchConfig" );
maxhits->setValue(config->readNumEntry("hits", 95));
switch (SearchMode::toMode( ((const char *)config->readEntry("Search", "="))[0] )) {
case SearchMode::exactregexp: tmp=6 ; break;
case SearchMode::exactsubcase: tmp=5 ; break;
case SearchMode::exactsubstr: tmp=4 ; break;
case SearchMode::regexp: tmp=3 ; break;
case SearchMode::subcase: tmp=2 ; break;
case SearchMode::substr: tmp=1 ; break;
case SearchMode::exact: // fall through
default: tmp=0 ; break;
}
searchmode->setCurrentItem(tmp);
switch(NiceLevel::toLevel(config->readNumEntry("Nice", 0))) {
case NiceLevel::nice : tmp=1 ; break;
case NiceLevel::nicer : // fall through
case NiceLevel::verynice : tmp=2 ; break;
case NiceLevel::extremlynice : tmp=3 ; break;
case NiceLevel::nicest : tmp=4 ; break;
case NiceLevel::norm : // fall through
default: tmp=0 ; break;
}
nicelevel->setCurrentItem(tmp);
}
示例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: readSettings
void KScienceSaver::readSettings()
{
KConfig *config = KGlobal::config();
QString sMode;
config->setGroup( "Settings" );
mode = config->readNumEntry( "ModeNr", SCI_DEFAULT_MODE );
for(int i=0; i < MAX_MODES; i++)
{
sMode.setNum( i );
config->setGroup( "Mode" + sMode );
moveX[i] = config->readNumEntry( "MoveX", SCI_DEFAULT_MOVEX);
moveY[i] = config->readNumEntry( "MoveY", SCI_DEFAULT_MOVEY);
size[i] = config->readNumEntry( "Size", SCI_DEFAULT_SIZE);
speed[i] = config->readNumEntry( "Speed", SCI_DEFAULT_SPEED);
intensity[i] = config->readNumEntry( "Intensity", SCI_DEFAULT_INTENSITY);
inverse[i] = config->readBoolEntry( "Inverse", SCI_DEFAULT_INVERSE);
gravity[i] = config->readBoolEntry( "Gravity", SCI_DEFAULT_GRAVITY);
hideBG[i] = config->readBoolEntry( "HideBG", SCI_DEFAULT_HIDE);
}
vx = copysign( moveX[mode], vx );
vy = copysign( moveY[mode], vy );
}
示例9: 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();
}
示例10: clearSchema
ColorSchema::ColorSchema(KConfig& c)
:m_fileRead(false)
,fRelPath(QString::null)
,lastRead(0L)
{
clearSchema();
c.setGroup("SchemaGeneral");
m_title = c.readEntry("Title",i18n("[no title]"));
m_imagePath = c.readEntry("ImagePath");
m_alignment = c.readNumEntry("ImageAlignment",1);
m_useTransparency = c.readBoolEntry("UseTransparency",false);
m_tr_r = c.readNumEntry("TransparentR",0);
m_tr_g = c.readNumEntry("TransparentG",0);
m_tr_b = c.readNumEntry("TransparentB",0);
m_tr_x = c.readDoubleNumEntry("TransparentX",0.0);
for (int i=0; i < TABLE_COLORS; i++)
{
readConfigColor(c,colorName(i),m_table[i]);
}
m_numb = serial++;
}
示例11: readSettings
void kSwarmSaver::readSettings()
{
KConfig *config = klock_config();
config->setGroup( "Settings" );
speed = MAXSPEED - config->readNumEntry( "Speed", MAXSPEED - DEFSPEED );
maxLevels = config->readNumEntry( "MaxLevels", DEFBATCH );
delete config;
}
示例12: updateConfiguration
void KJotsMain::updateConfiguration()
{
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup("kjots");
exec_http = config->readEntry("execHttp");
exec_ftp = config->readEntry("execFtp");
QFont font( config->readEntry("EFontFamily"), config->readNumEntry("EFontSize"),
config->readNumEntry("EFontWeight"), config->readNumEntry("EFontItalic"),
(QFont::CharSet) config->readNumEntry("EFontCharset") );
me_text->setFont(font);
}
示例13: DCOPObject
KPagerMainWindow::KPagerMainWindow(QWidget *parent, const char *name)
: DCOPObject("KPagerIface"), KMainWindow(parent, name)
{
m_reallyClose=false;
m_pPager = new KPager(this, 0);
setCentralWidget(m_pPager);
KConfig *cfg = kapp->config();
cfg->setGroup("KPager");
// Update the last used geometry
int w = cfg->readNumEntry(m_pPager->lWidth(),-1);
int h = cfg->readNumEntry(m_pPager->lHeight(),-1);
if (w > 0 && h > 0)
resize(w,h);
else
resize(m_pPager->sizeHint());
// resize(cfg->readNumEntry(lWidth(),200),cfg->readNumEntry(lHeight(),90));
int xpos=cfg->readNumEntry("xPos",-1);
int ypos=cfg->readNumEntry("yPos",-1);
if (xpos > 0 && ypos > 0)
move(xpos,ypos);
else
{
// NETRootInfo ri( qt_xdisplay(), NET::WorkArea );
// NETRect rect=ri.workArea(1);
// move(rect.pos.x+rect.size.width-m_pPager->width(),
// rect.pos.y+rect.size.height-m_pPager->height());
// antonio:The above lines don't work. I should look at them when I have
// more time
move(kapp->desktop()->width()-m_pPager->sizeHint().width()-5,kapp->desktop()->height()-m_pPager->sizeHint().height()-25);
}
// Set the wm flags to this window
KWin::setState( winId(), NET::StaysOnTop | NET::SkipTaskbar | NET::Sticky | NET::SkipPager );
KWin::setOnAllDesktops( winId(), true);
if ( KWin::windowInfo( winId(), NET::WMWindowType, 0 ).windowType(NET::Normal) == NET::Normal )
{
KWin::setType( winId(), NET::Utility );
}
XWMHints *hints = XGetWMHints(x11Display(), winId());
if( hints == NULL )
hints = XAllocWMHints();
hints->input = false;
hints->flags |= InputHint;
XSetWMHints(x11Display(), winId(), hints);
XFree(reinterpret_cast<char *>(hints));
timeout=new QTimer(this,"timeoutToQuit");
connect(timeout,SIGNAL(timeout()),this, SLOT(reallyClose()));
}
示例14: readConfig
//-----------------------------------------------------------------------------
void KMAcctPop::readConfig(KConfig& config)
{
KMAcctPopInherited::readConfig(config);
mLogin = config.readEntry("login", "");
mStorePasswd = config.readNumEntry("store-passwd", TRUE);
if (mStorePasswd) mPasswd = config.readEntry("passwd");
else mPasswd = "";
mHost = config.readEntry("host");
mPort = config.readNumEntry("port");
mProtocol = config.readNumEntry("protocol");
mLeaveOnServer = config.readNumEntry("leave-on-server", FALSE);
mRetrieveAll = config.readNumEntry("retrieve-all", FALSE);
}
示例15: 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);
}