Ejemplo n.º 1
0
LayoutUnit X11Helper::getCurrentLayout()
{
	QList<LayoutUnit> currentLayouts = getLayoutsList();
	unsigned int group = X11Helper::getGroup();
	if( group < (unsigned int)currentLayouts.size() )
		return currentLayouts[group];

	kWarning() << "Current group number" << group << "is outside of current layout list" <<
						getLayoutsListAsString(currentLayouts);
	return LayoutUnit();
}
Ejemplo n.º 2
0
bool X11Helper::setLayout(const LayoutUnit& layout)
{
	QList<LayoutUnit> currentLayouts = getLayoutsList();
	int idx = currentLayouts.indexOf(layout);
	if( idx == -1 || idx >= X11Helper::MAX_GROUP_COUNT ) {
		qCWarning(KCM_KEYBOARD) << "Layout" << layout.toString() << "is not found in current layout list"
								<< getLayoutsListAsString(currentLayouts);
		return false;
	}

	return X11Helper::setGroup((unsigned int)idx);
}
Ejemplo n.º 3
0
LayoutUnit X11Helper::getCurrentLayout()
{
    if (!QX11Info::isPlatformX11()) {
        return LayoutUnit();
    }
	QList<LayoutUnit> currentLayouts = getLayoutsList();
	unsigned int group = X11Helper::getGroup();
	if( group < (unsigned int)currentLayouts.size() )
		return currentLayouts[group];

	qCWarning(KCM_KEYBOARD) << "Current group number" << group << "is outside of current layout list" <<
						getLayoutsListAsString(currentLayouts);
	return LayoutUnit();
}
Ejemplo n.º 4
0
LayoutSet X11Helper::getCurrentLayouts()
{
	LayoutSet layoutSet;

	QList<LayoutUnit> currentLayouts = getLayoutsList();
	layoutSet.layouts = currentLayouts;

	unsigned int group = X11Helper::getGroup();
	if( group < (unsigned int)currentLayouts.size() ) {
		layoutSet.currentLayout = currentLayouts[group];
	}
	else {
		qCWarning(KCM_KEYBOARD) << "Current group number" << group << "is outside of current layout list" << getLayoutsListAsString(currentLayouts);
		layoutSet.currentLayout = LayoutUnit();
	}

	return layoutSet;
}