本文整理汇总了C++中KConfig::readListEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::readListEntry方法的具体用法?C++ KConfig::readListEntry怎么用?C++ KConfig::readListEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::readListEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: group
KSimPackageFileWidget::KSimPackageFileWidget(QWidget *parent, const char *name )
: PropertyWidget(1, parent,name)
{
setMargin(0);
m_directories = new KSimDirectorySelector(this, "Package directories");
m_directories->setTitle(i18n("Package directories:"));
m_directories->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));
m_files = new KSimFileListSelector(this, "Package files");
m_files->setTitle(i18n("Package files:"));
m_files->setFilter(i18n("*.so|Package files (*.so)\n*|All files (*)"));
m_files->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));
// Setup data
KConfig * config = kapp->config();
QString group(config->group());
config->setGroup("Packages");
QStringList dirList;
m_dirList = config->readListEntry("Directories");
m_fileList = config->readListEntry("Files");
config->setGroup(group);
m_directories->setFileList(m_dirList);
m_files->setFileList(m_fileList);
}
示例2: 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();
}
示例3: readConfig
void PageServChan::readConfig( const KSOServChan * )
{
KConfig *conf = kapp->config();
conf->setGroup("ServerList");
QStringList recent = conf->readListEntry("RecentServers");
recent.sort();
serverLB->insertStringList(recent);
conf->setGroup("Recent");
recent = conf->readListEntry("Channels");
recent.sort();
channelLB->insertStringList(recent);
}
示例4: readParameters
void MyFracWindow::readParameters()
{
KConfig* config = kapp->config();
config->setGroup("Parameters");
_sliderIterations->setValue(config->readNumEntry("Iterations", 2));
_sliderQuality->setValue(config->readNumEntry("Quality", 5));
_sliderScale->setValue(config->readNumEntry("Scale", 15));
_sliderOffset->setValue(config->readNumEntry("Offset", 0));
_sliderScroll->setValue(config->readNumEntry("Scroll", 25));
_sliderHeight->setValue(config->readNumEntry("Height", 20));
_comboGrid->setCurrentItem(config->readNumEntry("Grid", 1));
setGridSize(_comboGrid->currentItem());
QColor black(0, 0, 0);
_colorButton->setColor(config->readColorEntry("Background", &black));
QStringList list = config->readListEntry("Gradient");
if (list.size() == 4) {
Gradient gradient(list[0] == "hsv");
gradient.getSpline(0).fromString(list[1]);
gradient.getSpline(1).fromString(list[2]);
gradient.getSpline(2).fromString(list[3]);
setGradient(gradient);
} else
setGradient(_presets.getDefault());
QSize defSize(800, 600);
_imageSize = config->readSizeEntry("ImageSize", &defSize);
_imageMime = config->readEntry("ImageMime", "image/png");
_imagePath = config->readEntry("ImagePath");
}
示例5: loadLanguageList
void KLocaleConfig::loadLanguageList(KLanguageCombo *combo)
{
KConfig *config = kapp->getConfig();
QString name;
combo->clear();
languages.clear();
tags.clear();
config->setGroup("KCM Locale");
config->readListEntry("Languages", tags);
for (const char *lang = tags.first(); lang; lang = tags.next())
{
config->setGroup(lang);
name = config->readEntry("Name");
if (!name.isEmpty())
languages.append(name);
else
languages.append(klocale->translate("without name!"));
combo->insertLanguage(QString(lang)+";"+name);
if (strcmp(lang,"C")==0)
combo->setCurrentItem(combo->count()-1);
}
}
示例6: saver
NewWindowDialog::NewWindowDialog(const KSircChannel &channelInfo, QWidget * parent, const char * name)
: KDialogBase(parent, name, true, i18n("New Window For"), Ok|Cancel, Ok, true),
m_channelInfo(channelInfo)
{
QHBox * w = makeHBoxMainWidget();
QLabel * l = new QLabel(i18n("C&hannel/Nick:"), w);
m_combo = new KHistoryCombo(w);
m_combo->setFocus();
// we don't need duplicated channel into the list
m_combo->setDuplicatesEnabled( false );
l->setBuddy(m_combo);
QLabel * l2 = new QLabel(i18n("&Key:"), w);
m_le = new KLineEdit(w);
m_le->setEnabled(false);
l2->setBuddy(m_le);
connect(
m_combo, SIGNAL(activated(const QString &)),
m_combo, SLOT(addToHistory(const QString &)));
connect( m_combo->lineEdit(), SIGNAL(textChanged ( const QString & )),
this, SLOT( slotTextChanged( const QString &)));
KConfig *kConfig = kapp->config();
KConfigGroupSaver saver(kConfig, "Recent");
m_combo->setHistoryItems(kConfig->readListEntry("Channels"));
slotTextChanged( m_combo->lineEdit()->text());
}
示例7: 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();
}
示例8: 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());
}
}
示例9: 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));
}
示例10: QObject
KIconTemplateContainer::KIconTemplateContainer() : QObject()
{
QString path;
instances++;
debug("KIconTemplateContainer: instances %d", instances);
if(templatelist)
return;
debug("KIconTemplateContainer: Creating templates");
templatelist = new QList<KIconTemplate>;
templatelist->setAutoDelete(true);
QStrList names;
KConfig *k = kapp->getConfig();
k->setGroup("Templates");
k->readListEntry("Names", names);
for(int i = 0; i < (int)names.count(); i++)
{
KIconTemplate *it = new KIconTemplate;
it->path = k->readEntry(names.at(i));
it->title = names.at(i);
//debug("Template: %s\n%s", names.at(i), path.data());
templatelist->append(it);
}
if(templatelist->count() == 0)
{
createStandardTemplates(templatelist);
}
}
示例11: readConfig
void PageAutoConnect::readConfig()
{
KConfig *conf = kapp->config();
conf->setGroup("AutoConnect");
QStringList servers = conf->readListEntry("Servers");
servers.sort();
QStringList::ConstIterator ser = servers.begin();
for( ; ser != servers.end(); ser++){
QStringList channels = conf->readListEntry(*ser);
QString server = *ser;
QString port = "6667";
QString ssl = QString::null;
QString pass = QString::null;
QRegExp rx("(.+) \\(SSL\\)(.*)");
if(rx.search(server) >= 0){
server = rx.cap(1) + rx.cap(3);
ssl = i18n("SSL");
}
rx.setPattern("(.+) \\(pass: (\\S+)\\)(.*)");
if(rx.search(server) >= 0){
server = rx.cap(1) + rx.cap(3);
pass = rx.cap(2);
}
rx.setPattern("([^: ]+):(\\d+)");
if(rx.search(server) >= 0){
kdDebug(5008) << server << ": Has port:" << rx.cap(2) << endl;
server = rx.cap(1);
port = rx.cap(2);
}
kdDebug(5008) << server << ": Done " << port << " " << ssl << " " << pass << endl;
QListViewItem *s = new QListViewItem(KLVAutoConnect, server, port, pass, ssl);
s->setOpen(TRUE);
channels.sort();
QStringList::ConstIterator chan = channels.begin();
for(; chan != channels.end(); chan++){
QString channel = *chan;
QString key = QString::null;
QRegExp crx("(.+) \\(key: (\\S+)\\)");
if(crx.search(channel) >= 0){
channel = crx.cap(1);
key = crx.cap(2);
}
new QListViewItem(s, channel, key);
}
}
}
示例12: 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()) );
}
}
}
示例13: ReadConfig
bool KHost::ReadConfig()
{
KConfig *config = ((KConnection*) topLevelWidget())->GetConfig();
QStrList List;
const char *Value;
int i;
if (config == NULL)
return FALSE;
config->setGroup(KI_SEC_HOSTS);
config->readListEntry(KI_ENT_HOSTS,List);
hostCombo->insertStrList(&List);
List.clear();
config->readListEntry(KI_ENT_PORTS,List);
portCombo->insertStrList(&List);
Value = config->readEntry(KI_ENT_LAST_HOST);
if (Value != NULL && *Value != '\0')
for (i = 0; i < hostCombo->count(); i++)
if (!strcmp(Value,hostCombo->text(i)))
{
hostCombo->setCurrentItem(i);
break;
}
Value = config->readEntry(KI_ENT_LAST_PORT);
if (Value != NULL && *Value != '\0')
for (i = 0; i < portCombo->count(); i++)
if (!strcmp(Value,portCombo->text(i)))
{
portCombo->setCurrentItem(i);
break;
}
hostChanged(0);
portChanged(0);
return TRUE;
}
示例14: saveGroup
KAArchieSettings::KAArchieSettings(const char *title, QWidget *parent, const char *name)
:QGroupBox( title, parent, name )
{
// debug( "set KAArchieSettings Combobox" );
hostbox = new QGroupBox( this, "hostbox" );
hostbox->setFrameStyle( QFrame::NoFrame );
hostname = new QComboBox( hostbox, "hostname" );
hostnamelabel = new QLabel( hostname, i18n("&Host"), hostbox, "hostnamelabel" );
timeoutbox = new QGroupBox ( this, "timeoutbox" );
timeoutbox->setFrameStyle( QFrame::NoFrame );
timeoutline = new KIntegerLine( timeoutbox, "timeoutline" );
// timeoutline->hide();
// timeoutline->setText("0000");
// get the size for displaying "0000"
// const QSize lineEditSize = timeoutline->sizeHint();
// QFontMetrics *fm = &timeoutline->fontMetrics();
// int lineEditHeight = fm->boundingRect('8').height();
// timeoutline->setFixedHeight( timeoutline->height() );
// timeoutline->show();
timeoutlabel = new QLabel( timeoutline, i18n("&Timeout (seconds)"), timeoutbox, "timeoutlabel" );
connect(timeoutline, SIGNAL(returnPressed()),
this, SLOT(slotRP()) );
triesbox = new QGroupBox ( this, "triesbox" );
triesbox->setFrameStyle( QFrame::NoFrame );
triesline = new KIntegerLine( triesbox, "triesline" );
// QString tmp("set KLineEdit height ");
// tmp.setNum( lineEditHeight );
// debug( tmp );
// triesline->setFixedHeight( triesline->height() );
trieslabel = new QLabel( triesline, i18n("Maximal &retries"), triesbox, "trieslabel" );
connect(triesline, SIGNAL(returnPressed()),
this, SLOT(slotRP()) );
doLayout();
// read initial archie server list
QStrList archiehostlist;
KConfig *config = KApplication::getKApplication()->getConfig();
// get the list of hosts
KConfigGroupSaver saveGroup( config, "HostConfig" );
// archiehostlistnumber =
config->readListEntry( "Hosts", archiehostlist );
QString defaulthost = "archie.sura.net" ;
if ( archiehostlist.isEmpty() ) {
archiehostlist.append( defaulthost );
// currentHostId = 0;
}
hostname->insertStrList( &archiehostlist );
hostname->adjustSize();
readConfig();
}
示例15: readSettings
void MainWidget::readSettings( )
{ m_htmlWidget->readSettings( );
KConfig* config = kapp->config( );
config->setGroup( "General" );
m_stylesheetURLs = config->readListEntry( "stylesheetURLs" );
m_useLocalManPage = config->readBoolEntry( "useLocalManPage", false );
m_wrapText = config->readBoolEntry( "wrapText", false );
QValueList<int> splitterSizes = config->readIntListEntry( "splitterSizes" );
setSizes( splitterSizes );
QStringList scanNames = config->readListEntry( "scanNames" );
if( !scanNames.count( ))
scanNames.append( "default" );
QString visibleScanName = config->readEntry( "visibleScan", QString::null );
ScanWidget* visibleScanWidget = NULL;
for( QStringList::Iterator it = scanNames.begin( ); it != scanNames.end(); ++it )
{ ScanWidget* scanWidget = createScan( *it, false, QString::null );
if( visibleScanName == scanWidget->scanName( ))
visibleScanWidget = scanWidget;
}
if( visibleScanWidget == NULL )
{ visibleScanWidget = m_scanStack->firstScanWidget( );
if( visibleScanWidget == NULL )
{ KMessageBox::error( this, i18n( "Internal error - no ScanWidget to display!" ), i18n( "Internal error" ));
kapp->quit( );
}
}
m_scanStack->raiseWidget( visibleScanWidget );
}