本文整理汇总了C++中KConfig::writeEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::writeEntry方法的具体用法?C++ KConfig::writeEntry怎么用?C++ KConfig::writeEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::writeEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void PrintDialog::setup()
{
PrintSetup *ps = new PrintSetup( this, "print setup", printerName,
spoolerCommand, printerVariable );
if( ps->exec() ) {
printerName.sprintf( ps->leName->text() );
spoolerCommand.sprintf( ps->leSpool->text() );
printerVariable.sprintf( ps->leVar->text() );
/* Set the default options. */
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup( "Print" );
config->writeEntry ("Name", (const char *)printerName);
config->writeEntry ("Spool", (const char *)spoolerCommand);
config->writeEntry ("Variable", (const char*)printerVariable);
config->sync();
delete ps;
}
}
示例2: saveGlobal
void AStylePart::saveGlobal()
{
QString options;
for (QMap<QString, QVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++)
{
// kdDebug(9009) <<"saveGlobal" <<iter.key() << "="<< iter.data() << endl;
options += iter.key();
options += "=";
options += iter.data().toString();
options += ",";
}
// for (QMap<QString, QVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++)
// {
// kdDebug(9009) << "project before: " <<iter.key() << "="<< iter.data() << endl;
// }
KConfig *config = kapp->config();
config->setGroup("AStyle");
config->writeEntry("Options",options);
config->writeEntry("Extensions",m_globalExtensions.join(","));
config->sync();
// for (QMap<QString, QVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++)
// {
// kdDebug(9009) << "global after: " <<iter.key() << "="<< iter.data() << endl;
// }
// for (QMap<QString, QVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++)
// {
// kdDebug(9009) << "project after: " <<iter.key() << "="<< iter.data() << endl;
// }
}
示例3: acceptGlobalSettingsPage
void KDevIDEExtension::acceptGlobalSettingsPage(KDialogBase *dlg)
{
KConfig* config = kapp->config();
config->setGroup("General Options");
config->writeEntry("DesignerApp", gsw->designerButtonGroup->selectedId());
config->writeEntry("Read Last Project On Startup",gsw->lastProjectCheckbox->isChecked());
config->writePathEntry("DefaultProjectsDir", gsw->projectsURL->url());
config->writeEntry("OutputViewFont", gsw->outputFont->font());
QString DesignerSetting;
if ( gsw->qtDesignerRadioButton->isChecked() ) DesignerSetting = "ExternalDesigner";
if ( gsw->seperateAppRadioButton->isChecked() ) DesignerSetting = "ExternalKDevDesigner";
if ( gsw->embeddedDesignerRadioButton->isChecked() ) DesignerSetting = "EmbeddedKDevDesigner";
config->writeEntry( "DesignerSetting", DesignerSetting );
config->setGroup("MakeOutputView");
config->writeEntry("LineWrapping",gsw->lineWrappingCheckBox->isChecked());
config->writeEntry("ShowDirNavigMsg",gsw->dirNavigMsgCheckBox->isChecked());
config->writeEntry( "ForceCLocale", gsw->forceCLocaleRadio->isChecked() );
//current item id must be in sync with the enum!
config->writeEntry("CompilerOutputLevel",gsw->compileOutputCombo->currentItem());
config->sync();
if( KDevPlugin *makeExt = API::getInstance()->pluginController()->extension("KDevelop/MakeFrontend"))
{
static_cast<KDevMakeFrontend*>(makeExt)->updateSettingsFromConfig();
}
config->setGroup("TerminalEmulator");
config->writeEntry("UseKDESetting", gsw->useKDETerminal->isChecked() );
config->writeEntry("TerminalApplication", gsw->terminalEdit->text().stripWhiteSpace() );
}
示例4: saveContainerConfig
void DockBarExtension::saveContainerConfig()
{
QStringList applet_list;
KConfig *conf = config();
unsigned count = 0;
for(DockContainer::Vector::const_iterator it = containers.constBegin(); it != containers.constEnd(); ++it)
{
DockContainer *c = *it;
if(!c->command().isEmpty())
{
QString applet_gid = QString("Applet_%1").arg(QString::number(count));
applet_list.append(applet_gid);
conf->setGroup(applet_gid);
conf->writePathEntry("Command", c->command());
conf->writePathEntry("resName", c->resName());
conf->writeEntry("resClass", c->resClass());
++count;
}
}
conf->setGroup("General");
conf->writeEntry("Applets", applet_list);
conf->deleteEntry("Commands"); // cleanup old config
conf->sync();
}
示例5: acceptPressed
void KSimPackageFileWidget::acceptPressed()
{
if ( (m_dirList != m_directories->getFileList())
|| (m_fileList != m_files->getFileList()))
{
KConfig * config = kapp->config();
QString group(config->group());
config->setGroup("Packages");
config->writeEntry("Directories", m_directories->getFileList());
config->writeEntry("Files", m_files->getFileList());
config->setGroup(group);
config->sync();
KMessageBox::information(parentWidget() ,
i18n("KSimus packages are configured only during the application start."
"You have to restart ksimus if you want to apply the changes.\n"
"This will be changed in a future version. Sorry!"),
i18n("Restart required"),
QString::fromLatin1("Package changed - Restart Application"));
}
}
示例6: StyleDlg
Style::Style(QWidget *parent, const char* name)
: StyleDlg(parent, name)
{
// Common Pardus settings for all themes
KConfig *config = new KConfig("kdeglobals");
config->setGroup("KDE");
config->writeEntry("ShowIconsOnPushButtons", true);
config->writeEntry("EffectAnimateCombo", true);
config->sync();
delete config;
// add kaptan themes into resouce pool
KGlobal::dirs()->addResourceType("themes", KStandardDirs::kde_default("data") + "kaptan/themes/");
QStringList themes = KGlobal::dirs()->findAllResources("themes", "*.xml", true /*recursive*/);
themes.sort();
for (QStringList::const_iterator it = themes.begin(); it != themes.end(); ++it)
styleBox->insertItem(QFileInfo(*it).baseName());
connect(styleButton, SIGNAL(clicked()), this, SLOT(testStyle()));
connect(styleBox, SIGNAL(activated(int)), this, SLOT(styleSelected(int)));
connect(checkKickoff, SIGNAL(clicked()), this, SLOT(kickoffSelected()));
styleBox->setCurrentItem(0);
emit(styleSelected(0));
}
示例7: saveLinks
void LinkView::saveLinks()
{
if (!locations)
return;
KConfig *config = new KConfig(QDir::homeDirPath() + "/.qt/baghirarc");
config->setGroup("Sidebar");
config->writeEntry("Sizes", splitter->sizes());
config->writeEntry("NumLinks", (int)locations->count());
QString num;
for (uint i = 0; i < locations->count(); i++)
{
num.setNum(i);
ListBoxLink *current = (ListBoxLink*)locations->item(i);
config->writeEntry("Link_"+num+"_Title", current->text());
config->writeEntry("Link_"+num+"_Icon", current->icon());
config->writeEntry("Link_"+num+"_URL", current->URL());
}
// reduced links, remove them from settings
for (uint i = locations->count(); i < loadedLinks; i++)
{
num.setNum(i);
config->deleteEntry("Link_"+num+"_Title");
config->deleteEntry("Link_"+num+"_Icon");
config->deleteEntry("Link_"+num+"_URL");
}
delete config;
}
示例8: while
void
KGeneralSettingsPage::apply()
{
KConfig * config = kapp->config();
config->setGroup( "Directory Reading" );
config->writeEntry( "CrossFileSystems", _crossFileSystems->isChecked() );
config->writeEntry( "EnableLocalDirReader", _enableLocalDirReader->isChecked() );
config->setGroup( "Animation" );
config->writeEntry( "ToolbarPacMan", _enableToolBarAnimation->isChecked() );
config->writeEntry( "DirTreePacMan", _enableTreeViewAnimation->isChecked() );
_mainWin->initPacMan( _enableToolBarAnimation->isChecked() );
_treeView->enablePacManAnimation( _enableTreeViewAnimation->isChecked() );
config->setGroup( "Exclude" );
QStringList excludeRulesStringList;
KExcludeRules::excludeRules()->clear();
QListViewItem * item = _excludeRulesListView->firstChild();
while ( item )
{
QString ruleText = item->text(0);
excludeRulesStringList.append( ruleText );
// kdDebug() << "Adding exclude rule " << ruleText << endl;
KExcludeRules::excludeRules()->add( new KExcludeRule( QRegExp( ruleText ) ) );
item = item->nextSibling();
}
config->writeEntry( "ExcludeRules", excludeRulesStringList );
}
示例9: writeParameters
void MyFracWindow::writeParameters()
{
KConfig* config = kapp->config();
config->setGroup("Parameters");
config->writeEntry("Iterations", _sliderIterations->value());
config->writeEntry("Quality", _sliderQuality->value());
config->writeEntry("Scale", _sliderScale->value());
config->writeEntry("Offset", _sliderOffset->value());
config->writeEntry("Scroll", _sliderScroll->value());
config->writeEntry("Height", _sliderHeight->value());
config->writeEntry("Grid", _comboGrid->currentItem());
config->writeEntry("Background", _backgroundColor);
QStringList list;
list.append(_gradient.isHsv() ? "hsv" : "rgb");
list.append(_gradient.getSpline(0).toString());
list.append(_gradient.getSpline(1).toString());
list.append(_gradient.getSpline(2).toString());
config->writeEntry("Gradient", list);
config->writeEntry("ImageSize", _imageSize);
config->writeEntry("ImageMime", _imageMime);
config->writeEntry("ImagePath", _imagePath);
}
示例10: slotOk
// Ok pressed - save settings and exit
void KScienceSetup::slotOk()
{
KConfig *config = KGlobal::config();
QString sSize, sSpeed, sIntensity, sMode;
config->setGroup( "Settings" );
config->writeEntry( "ModeNr", mode );
for(int i=0; i<MAX_MODES; i++)
{
sMode.setNum( i );
config->setGroup( "Mode" + sMode );
config->writeEntry( "MoveX", moveX[i] );
config->writeEntry( "MoveY", moveY[i] );
config->writeEntry( "Size", size[i] );
config->writeEntry( "Speed", speed[i] );
config->writeEntry( "Intensity", intensity[i] );
config->writeEntry( "Inverse", inverse[i] );
config->writeEntry( "Gravity", gravity[i] );
config->writeEntry( "HideBG", hideBG[i] );
}
config->sync();
accept();
}
示例11: save
void BehaviorConfig::save()
{
// kdDebug(14000) << k_funcinfo << "called." << endl;
KopetePrefs *p = KopetePrefs::prefs();
KConfig *config = KGlobal::config();
// "General" TAB ============================================================
p->setShowTray(mPrfsGeneral->mShowTrayChk->isChecked());
p->setStartDocked(mPrfsGeneral->mStartDockedChk->isChecked());
p->setUseQueue(mPrfsGeneral->mUseQueueChk->isChecked());
p->setUseStack(mPrfsGeneral->mUseStackChk->isChecked());
p->setQueueUnreadMessages(mPrfsGeneral->mQueueUnreadMessagesChk->isChecked());
p->setAutoConnect(mPrfsGeneral->mAutoConnect->isChecked());
// "Events" TAB ============================================================
p->setQueueOnlyHighlightedMessagesInGroupChats(mPrfsEvents->mQueueOnlyHighlightedMessagesInGroupChatsChk->isChecked());
p->setQueueOnlyMessagesOnAnotherDesktop(mPrfsEvents->mQueueOnlyMessagesOnAnotherDesktopChk->isChecked());
p->setBalloonNotify(mPrfsEvents->mBalloonNotifyChk->isChecked());
p->setBalloonNotifyIgnoreClosesChatView(mPrfsEvents->mBalloonNotifyIgnoreClosesChatViewChk->isChecked());
p->setBalloonClose(mPrfsEvents->mCloseBalloonChk->isChecked());
p->setBalloonDelay(mPrfsEvents->mBalloonCloseDelay->value());
p->setTrayflashNotify(mPrfsEvents->mTrayflashNotifyChk->isChecked());
p->setTrayflashNotifyLeftClickOpensMessage(mPrfsEvents->mTrayflashNotifyLeftClickOpensMessageChk->isChecked());
p->setTrayflashNotifySetCurrentDesktopToChatView(mPrfsEvents->mTrayflashNotifySetCurrentDesktopToChatViewChk->isChecked());
p->setSoundIfAway(mPrfsEvents->mSoundIfAwayChk->isChecked());
p->setRaiseMsgWindow(mPrfsEvents->mRaiseMsgWindowChk->isChecked());
config->setGroup("General");
config->writeEntry("EventIfActive", mPrfsEvents->mEventIfActive->isChecked());
// "Away" TAB ===============================================================
p->setRememberedMessages( mAwayConfigUI->rememberedMessages->value() );
config->setGroup("AutoAway");
config->writeEntry("Timeout", mAwayConfigUI->mAutoAwayTimeout->value() * 60);
config->writeEntry("GoAvailable", mAwayConfigUI->mGoAvailable->isChecked());
config->writeEntry("UseAutoAway", mAwayConfigUI->mUseAutoAway->isChecked() );
config->writeEntry("UseAutoAwayMessage", mAwayConfigUI->mDisplayCustomAwayMessage->isChecked() );
config->sync();
// Save the auto away message, if defined
if( mAwayConfigUI->mDisplayCustomAwayMessage->isChecked() )
{
awayInstance->setAutoAwayMessage( mAwayConfigUI->mAutoAwayMessageEdit->text() );
}
// "Chat" TAB ===============================================================
p->setShowEvents(mPrfsChat->cb_ShowEventsChk->isChecked());
p->setHighlightEnabled(mPrfsChat->highlightEnabled->isChecked());
p->setSpellCheck(mPrfsChat->cb_SpellCheckChk->isChecked());
p->setInterfacePreference( viewPlugins[mPrfsChat->viewPlugin->currentItem()]->pluginName() );
p->setChatWindowPolicy(mPrfsChat->cmbChatGroupingPolicy->currentItem());
p->setChatViewBufferSize(mPrfsChat->mChatViewBufferSize->value());
p->setTruncateContactNames(mPrfsChat->truncateContactNameEnabled->isChecked());
p->setMaxContactNameLength(mPrfsChat->mMaxContactNameLength->value());
p->save();
emit changed(false);
}
示例12:
kpok::~kpok()
{
if (mOptions != 0) {
if (m_numPlayers > 1)
m_game.setBettingLimits(mOptions->getMinBet(), mOptions->getMaxBet());
drawDelay = mOptions->getDrawDelay();
// cashPerRound = mOptions->getCashPerRound(); // NOT(!) configurable
}
KConfig* conf = kapp->config();
conf->setGroup("General");
conf->writeEntry("MinBet", m_game.getMinBet());
conf->writeEntry("MaxBet", m_game.getMaxBet());
// conf->writeEntry("CashPerRound", cashPerRound);
conf->writeEntry("DrawDelay", drawDelay);
delete[] m_players;
for (unsigned int i = 0; i < m_numPlayers; i++)
delete playerBox[i];
delete[] playerBox;
delete mOptions;
}
示例13: writeConfig
void KNCollectionView::writeConfig()
{
KConfig *conf = knGlobals.config();
conf->setGroup("GroupView");
saveLayout(knGlobals.config(), "GroupView");
conf->writeEntry("UnreadColumn", unreadIndex());
conf->writeEntry("TotalColumn", totalIndex());
}
示例14: writePSeparator
void managementWidget::writePSeparator()
{
KConfig *config = kapp->config();
config->setGroup("Kpackage");
config->writeEntry("panel1Width",vPan->sizes().first());
config->writeEntry("panel2Width",vPan->sizes().last());
}
示例15:
GuiSpectrumAnalyser::~GuiSpectrumAnalyser()
{
KConfig *config = KGlobal::config();
config->setGroup("Winskin");
config->writeEntry("visualizationMode", visualization_mode);
config->writeEntry("analyserMode", analyser_mode);
delete analyserCache;
}