本文整理汇总了C++中KConfig::setDesktopGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::setDesktopGroup方法的具体用法?C++ KConfig::setDesktopGroup怎么用?C++ KConfig::setDesktopGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::setDesktopGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: aboutData
//.........这里部分代码省略.........
char *ls = (char *)strchr(sz.data(), 'x');
if(ls != NULL)
{
*ls = '\0';
ls++;
c = atoi(sz.data());
l = atoi(ls);
}
else
{
KCmdLineArgs::usage(i18n("expected --vt_sz <#columns>x<#lines> e.g. 80x40\n"));
}
}
if(!kapp->authorizeKAction("size"))
fixed_size = true;
// ///////////////////////////////////////////////
// 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;
QString key;
QString sTitle;
QString sPgm;
QString sTerm;
QString sIcon;
QString sCwd;
int n_tabbar;
// TODO: Session management stores everything in same group,
// should use one group / mainwindow
while(KMainWindow::canBeRestored(n) || !profile.isEmpty())
{
sessionconfig->setGroup(QString("%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 = QMIN(sessionconfig->readUnsignedNumEntry("tabbar", Konsole::TabBottom), 2);
Konsole *m = new Konsole(wname, histon, menubaron, tabbaron, frameon, scrollbaron, 0 /*type*/, true, n_tabbar, workDir);
示例2: initialize
//.........这里部分代码省略.........
bool first_entry = true;
bool dirfile_separator = false;
int item_count = 0;
int run_id = _startid;
// get list iterator
QFileInfoListIterator it(*list);
// jump to startid
it += _startid;
// iterate over entry list
for (; it.current(); ++it)
{
// bump id
run_id++;
QFileInfo *fi = it.current();
// handle directories
if (fi->isDir())
{
QString name = fi->fileName();
// ignore . and .. entries
if (name == "." || name == "..") continue;
QPixmap icon;
QString path = fi->absFilePath();
// parse .directory if it does exist
if (QFile::exists(path + "/.directory")) {
KSimpleConfig c(path + "/.directory", true);
c.setDesktopGroup();
QString iconPath = c.readEntry("Icon");
if ( iconPath.startsWith("./") )
iconPath = path + '/' + iconPath.mid(2);
icon = KGlobal::iconLoader()->loadIcon(iconPath,
KIcon::Small, KIcon::SizeSmall,
KIcon::DefaultState, 0, true);
if(icon.isNull())
icon = CICON("folder");
name = c.readEntry("Name", name);
}
// use cached folder icon for directories without special icon
if (icon.isNull())
icon = CICON("folder");
// insert separator if we are the first menu entry
if(first_entry) {
if (_startid == 0 && !_filesOnly)
insertSeparator();
first_entry = false;
}
// append menu entry
PanelBrowserMenu *submenu = new PanelBrowserMenu(path, this);
submenu->_filesOnly = _filesOnly;
append(icon, name, submenu);
// bump item count
item_count++;