本文整理汇总了C++中TDEConfig::hasKey方法的典型用法代码示例。如果您正苦于以下问题:C++ TDEConfig::hasKey方法的具体用法?C++ TDEConfig::hasKey怎么用?C++ TDEConfig::hasKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDEConfig
的用法示例。
在下文中一共展示了TDEConfig::hasKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void ExtensionManager::initialize()
{
m_loadingContainers = true;
// kdDebug(1210) << "ExtensionManager::loadContainerConfig()" << endl;
TDEConfig* config = TDEGlobal::config();
PluginManager* pm = PluginManager::the();
// set up the "main" panel
if (config->hasGroup("Main Panel"))
{
config->setGroup("Main Panel");
if (config->hasKey("DesktopFile"))
{
m_mainPanel = pm->createExtensionContainer(config->readPathEntry("DesktopFile"),
true, config->readPathEntry("ConfigFile"),
"Main Panel");
}
}
if (!m_mainPanel)
{
// fall back to a regular ol' PanelExtension
m_mainPanel = pm->createExtensionContainer(
"childpanelextension.desktop",
true,
TQString(kapp->aboutData()->appName()) + "rc",
"Main Panel");
}
if (!m_mainPanel)
{
KMessageBox::error(0, i18n("The TDE panel (kicker) could not load the main panel "
"due to a problem with your installation. "),
i18n("Fatal Error!"));
exit(1);
}
configureMenubar(true);
Kicker::the()->setMainWidget(m_mainPanel);
m_mainPanel->readConfig();
m_mainPanel->show();
kapp->processEvents();
// read extension list
config->setGroup("General");
TQStringList elist = config->readListEntry("Extensions2");
// now restore the extensions
TQStringList::iterator itEnd = elist.end();
for (TQStringList::iterator it = elist.begin(); it != elist.end(); ++it)
{
// last container?
TQStringList::iterator lastcheck(it);
lastcheck++;
if (lastcheck == elist.end()) {
m_loadingContainers = false;
}
// extension id
TQString extensionId(*it);
// create a matching applet container
if (extensionId.find("Extension") == -1)
{
continue;
}
// is there a config group for this extension?
if (!config->hasGroup(extensionId))
{
continue;
}
// set config group
config->setGroup(extensionId);
ExtensionContainer* e = pm->createExtensionContainer(config->readPathEntry("DesktopFile"),
true, // is startup
config->readPathEntry("ConfigFile"),
extensionId);
if (e)
{
addContainer(e);
e->readConfig();
e->show();
kapp->processEvents();
}
}
m_loadingContainers = false;
pm->clearUntrustedLists();
connect(Kicker::the(), TQT_SIGNAL(configurationChanged()), TQT_SLOT(configurationChanged()));
DCOPRef r( "ksmserver", "ksmserver" );
r.send( "resumeStartup", TQCString( "kicker" ));
}
示例2: aboutData
//.........这里部分代码省略.........
// ///////////////////////////////////////////////
// Ignore SIGHUP so that we don't get killed when
// our parent-shell gets closed.
signal(SIGHUP, SIG_IGN);
putenv((char*)"COLORTERM="); // to trigger mc's color detection
KonsoleSessionManaged ksm;
if (a->isRestored() || !profile.isEmpty())
{
if (!shell)
shell = konsole_shell(eargs);
if (profile.isEmpty())
sessionconfig = a->sessionConfig();
sessionconfig->setDesktopGroup();
int n = 1;
TQString key;
TQString sTitle;
TQString sPgm;
TQString sTerm;
TQString sIcon;
TQString sCwd;
int n_tabbar;
// TODO: Session management stores everything in same group,
// should use one group / mainwindow
while (TDEMainWindow::canBeRestored(n) || !profile.isEmpty())
{
sessionconfig->setGroup(TQString("%1").arg(n));
if (!sessionconfig->hasKey("Pgm0"))
sessionconfig->setDesktopGroup(); // Backwards compatible
int session_count = sessionconfig->readNumEntry("numSes");
int counter = 0;
wname = sessionconfig->readEntry("class",wname).latin1();
sPgm = sessionconfig->readEntry("Pgm0", shell);
sessionconfig->readListEntry("Args0", eargs);
sTitle = sessionconfig->readEntry("Title0", title);
sTerm = sessionconfig->readEntry("Term0");
sIcon = sessionconfig->readEntry("Icon0","konsole");
sCwd = sessionconfig->readPathEntry("Cwd0");
workDir = sessionconfig->readPathEntry("workdir");
n_tabbar = TQMIN(sessionconfig->readUnsignedNumEntry("tabbar",Konsole::TabBottom),2);
Konsole *m = new Konsole(wname,histon,menubaron,tabbaron,frameon,scrollbaron,0/*type*/,true,n_tabbar, workDir);
m->newSession(sPgm, eargs, sTerm, sIcon, sTitle, sCwd);
m->enableFullScripting(full_script);
m->enableFixedSize(fixed_size);
m->restore(n);
sessionconfig->setGroup(TQString("%1").arg(n));
if (!sessionconfig->hasKey("Pgm0"))
sessionconfig->setDesktopGroup(); // Backwards compatible
m->makeGUI();
m->setEncoding(sessionconfig->readNumEntry("Encoding0"));
m->setSchema(sessionconfig->readEntry("Schema0"));
// Use konsolerc default as tmpFont instead?
TQFont tmpFont = TDEGlobalSettings::fixedFont();
m->initSessionFont(sessionconfig->readFontEntry("SessionFont0", &tmpFont));
m->initSessionKeyTab(sessionconfig->readEntry("KeyTab0"));