本文整理汇总了C++中KConfigGroup::readListEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfigGroup::readListEntry方法的具体用法?C++ KConfigGroup::readListEntry怎么用?C++ KConfigGroup::readListEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfigGroup
的用法示例。
在下文中一共展示了KConfigGroup::readListEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readViewConfig
void TabView::readViewConfig(KConfig* c,
QString prefix, QString postfix,
bool withOptions)
{
if (0) qDebug("%s::readConfig(%s%s)", name(),
prefix.ascii(), postfix.ascii());
KConfigGroup* g = configGroup(c, prefix, postfix);
_mainSplitter->setSizes(g->readIntListEntry("MainSizes"));
_leftSplitter->setSizes(g->readIntListEntry("LeftSizes"));
_bottomSplitter->setSizes(g->readIntListEntry("BottomSizes"));
QString activeT = g->readEntry("ActiveTop", "CallerView");
QString activeB = g->readEntry("ActiveBottom", "CalleeView");
QString activeL = g->readEntry("ActiveLeft", "");
QString activeR = g->readEntry("ActiveRight", "");
QStringList topTabs = g->readListEntry("TopTabs");
QStringList bottomTabs = g->readListEntry("BottomTabs");
QStringList leftTabs = g->readListEntry("LeftTabs");
QStringList rightTabs = g->readListEntry("RightTabs");
if (topTabs.isEmpty() && bottomTabs.isEmpty() &&
rightTabs.isEmpty() && leftTabs.isEmpty()) {
// no tabs visible ?! Reset to default
topTabs << "CostTypeView" << "CallerView" << "AllCallerView"
<< "CalleeMapView" << "SourceView";
bottomTabs << "PartView" << "CalleeView" << "CallGraphView"
<< "AllCalleeView" << "CallerMapView" << "InstrView";
}
TraceItemView *activeTop = 0, *activeBottom = 0;
TraceItemView *activeLeft = 0, *activeRight = 0;
moveTab(0, TraceItemView::Top, true);
TraceItemView *v;
QPtrListIterator<TraceItemView> it( _tabs );
while ( (v=it.current()) != 0) {
++it;
QString n = QString(v->widget()->name());
if (topTabs.contains(n)) {
moveTab(v->widget(), TraceItemView::Top);
if (n == activeT) activeTop = v;
}
else if (bottomTabs.contains(n)) {
moveTab(v->widget(), TraceItemView::Bottom);
if (n == activeB) activeBottom = v;
}
else if (leftTabs.contains(n)) {
moveTab(v->widget(), TraceItemView::Left);
if (n == activeL) activeLeft = v;
}
else if (rightTabs.contains(n)) {
moveTab(v->widget(), TraceItemView::Right);
if (n == activeR) activeRight = v;
}
else moveTab(v->widget(), Hidden);
if (withOptions)
v->readViewConfig(c, QString("%1-%2")
.arg(prefix).arg(v->widget()->name()),
postfix, true);
}
if (activeTop) _topTW->showPage(activeTop->widget());
if (activeBottom)_bottomTW->showPage(activeBottom->widget());
if (activeLeft) _leftTW->showPage(activeLeft->widget());
if (activeRight) _rightTW->showPage(activeRight->widget());
QString activeType = g->readEntry("ActiveItemType", "");
QString activeName = g->readEntry("ActiveItemName", "");
QString selectedType = g->readEntry("SelectedItemType", "");
QString selectedName = g->readEntry("SelectedItemName", "");
delete g;
if (!_data) return;
if (withOptions) {
// restore active item
TraceItem::CostType t = TraceItem::costType(activeType);
if (t==TraceItem::NoCostType) t = TraceItem::Function;
TraceCost* activeItem = _data->search(t, activeName, _costType);
if (!activeItem) return;
activate(activeItem);
// restore selected item
t = TraceItem::costType(selectedType);
if (t==TraceItem::NoCostType) t = TraceItem::Function;
TraceCost* selectedItem = _data->search(t, selectedName,
_costType, activeItem);
if (selectedItem) select(selectedItem);
}
updateView();
}