[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/kcontrol/kxkb
From: Stephen Leaf <smileaf () smileaf ! org>
Date: 2007-05-01 4:02:33
Message-ID: 1177992153.881831.30049.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 659920 by smileaf:
EBN fixes
M +13 -13 kcmlayout.cpp
M +1 -1 kcmmisc.cpp
M +3 -3 kxkbcore.cpp
M +1 -1 rules.cpp
M +2 -2 rules.h
M +19 -19 x11helper.cpp
M +1 -1 x11helper.h
--- trunk/KDE/kdebase/workspace/kcontrol/kxkb/kcmlayout.cpp #659919:659920
@@ -385,13 +385,13 @@
else
if( sel->itemAbove() )
newSel = sel->itemAbove();
-
+
delete sel;
if( newSel )
widget->listLayoutsSrc->setSelected(newSel, true);
layoutSelChanged(newSel);
}
-
+
updateAddButton();
updateLayoutCommand();
updateStickyLimit();
@@ -411,7 +411,7 @@
}
else
sel->moveItem(sel->itemAbove()->itemAbove());
-
+
updateLayoutCommand();
changed();
}
@@ -440,7 +440,7 @@
if( selectedVariant == DEFAULT_VARIANT_NAME )
selectedVariant = "";
selLayout->setText(LAYOUT_COLUMN_VARIANT, selectedVariant);
-
+
updateLayoutCommand();
changed();
}
@@ -595,10 +595,10 @@
}
void LayoutConfig::updateLayoutCommand()
-{
+{
QString kbdLayouts;
QString kbdVariants;
-
+
Q3ListViewItem *item = widget->listLayoutsDst->firstChild();
QList<LayoutUnit> layouts;
while (item) {
@@ -610,13 +610,13 @@
variant = "";
if( kbdLayouts.length() > 0 ) {
- kbdLayouts += ",";
- kbdVariants += ",";
+ kbdLayouts += ',';
+ kbdVariants += ',';
}
-
+
kbdLayouts += layout;
kbdVariants += variant;
-
+
item = item->nextSibling();
}
@@ -624,14 +624,14 @@
setxkbmap += " -model " + lookupLocalized(m_rules->models(), \
widget->comboModel->currentText()); setxkbmap += " -layout " + kbdLayouts;
setxkbmap += " -variant " + kbdVariants;
-
+
widget->editCmdLine->setText(setxkbmap);
}
void LayoutConfig::updateDisplayName()
{
Q3ListViewItem* sel = widget->listLayoutsDst->selectedItem();
-
+
QString layoutDisplayName;
kDebug() << "sel: '" << sel << "'" << endl;
if( sel != NULL ) {
@@ -654,7 +654,7 @@
}
kDebug() << "disp: '" << layoutDisplayName << "'" << endl;
}
-
+
widget->editDisplayName->setEnabled( sel != NULL );
widget->editDisplayName->setText(layoutDisplayName);
}
--- trunk/KDE/kdebase/workspace/kcontrol/kxkb/kcmmisc.cpp #659919:659920
@@ -190,7 +190,7 @@
QString KeyboardConfig::quickHelp() const
{
- return QString::null;
+ return QString();
/* "<h1>Keyboard</h1> This module allows you to choose options"
" for the way in which your keyboard works. The actual effect of"
--- trunk/KDE/kdebase/workspace/kcontrol/kxkb/kxkbcore.cpp #659919:659920
@@ -210,8 +210,8 @@
layouts += layoutUnit.layout;
variants += layoutUnit.variant;
if( ii < kxkbConfig.m_layouts.count() ) {
- layouts += ",";
- variants += ",";
+ layouts += ',';
+ variants += ',';
}
}
kDebug() << "initing " << "-layout " << layouts << " - variants " << variants << \
endl; @@ -270,7 +270,7 @@
res = m_extension->setGroup(layout); // not checking for ret - not important
updateIndicator(layout, res);
-
+
return res;
}
--- trunk/KDE/kdebase/workspace/kcontrol/kxkb/rules.cpp #659919:659920
@@ -69,7 +69,7 @@
#else
-void XkbRules::loadRules(QString file, bool layoutsOnly)
+void XkbRules::loadRules(const QString &file, bool layoutsOnly)
{
RulesInfo* rules = X11Helper::loadRules(file, layoutsOnly);
--- trunk/KDE/kdebase/workspace/kcontrol/kxkb/rules.h #659919:659920
@@ -33,7 +33,7 @@
QHash<QString, XkbOption> m_options;
QMap<QString, unsigned int> m_initialGroups;
QHash<QString, QStringList*> m_varLists;
-
+
QString X11_DIR; // pseudo-constant
static bool m_layoutsClean;
@@ -41,7 +41,7 @@
#ifdef HAVE_XKLAVIER
void loadNewRules(bool layoutsOnly);
#else
- void loadRules(QString filename, bool layoutsOnly=false);
+ void loadRules(const QString &filename, bool layoutsOnly=false);
void fixOptionGroups();
#endif
};
--- trunk/KDE/kdebase/workspace/kcontrol/kxkb/x11helper.cpp #659919:659920
@@ -61,20 +61,20 @@
const char* xDir = X11DirList[ii];
if( xDir != NULL && QDir(QString(xDir) + "xkb").exists() ) {
// for(int jj=0; jj<X11_RULES_COUNT; jj++) {
-//
+//
// }
return QString(xDir);
}
-
+
// if( X11_DIR.isEmpty() ) {
// return;
// }
}
- return NULL;
+ return NULL;
}
const QString
-X11Helper::findXkbRulesFile(QString x11Dir, Display *dpy)
+X11Helper::findXkbRulesFile(const QString &x11Dir, Display *dpy)
{
QString rulesFile;
XkbRF_VarDefsRec vd;
@@ -97,12 +97,12 @@
}
}
}
-
+
return rulesFile;
}
RulesInfo*
-X11Helper::loadRules(const QString& file, bool layoutsOnly)
+X11Helper::loadRules(const QString& file, bool layoutsOnly)
{
XkbRF_RulesPtr xkbRules = XkbRF_Load(QFile::encodeName(file).data(), (char*)"", \
true, true);
@@ -122,7 +122,7 @@
XkbRF_Free(xkbRules, true);
return rulesInfo;
}
-
+
for (int i = 0; i < xkbRules->models.num_desc; ++i)
rulesInfo->models.insert(xkbRules->models.desc[i].name, QString( \
xkbRules->models.desc[i].desc ) );
@@ -140,7 +140,7 @@
rulesInfo->optionGroups.insert(groupName, createMissingGroup(groupName));
kDebug() << " added missing option group: " << groupName << endl;
}
-
+
XkbOption option;
option.name = optionName;
option.description = xkbRules->options.desc[i].desc;
@@ -164,10 +164,10 @@
/*
for(QHashIterator<QString, QString> it(rulesInfo->options) ; it.hasNext(); ) {
it.next();
-
+
QString option(it.key());
int columnPos = option.indexOf(":");
-
+
if( columnPos != -1 ) {
QString group = option.mid(0, columnPos);
if( !rulesInfo->options.contains(group) ) {
@@ -186,7 +186,7 @@
}
-XkbOptionGroup
+XkbOptionGroup
X11Helper::createMissingGroup(const QString& groupName)
{
// workaround for empty 'compose' options group description
@@ -205,7 +205,7 @@
{
if( groupName == "ctrl" || groupName == "caps" || groupName == "altwin" )
return true;
-
+
return false;
}
@@ -223,11 +223,11 @@
// workaround for XFree 4.3 new directory for one-group layouts
if( QDir(file+"pc").exists() )
file += "pc/";
-
+
file += layout;
// kDebug() << "reading variants from " << file << endl;
-
+
QFile f(file);
if (f.open(IO_ReadOnly))
{
@@ -238,11 +238,11 @@
while ( ts.status() == QTextStream::Ok ) {
prev_line = line;
-
+
QString str = ts.readLine();
if( str.isNull() )
break;
-
+
line = str.simplified();
if (line[0] == '#' || line.left(2) == "//" || line.isEmpty())
@@ -275,7 +275,7 @@
const QString X11Helper::X11_WIN_CLASS_ROOT = "<root>";
const QString X11Helper::X11_WIN_CLASS_UNKNOWN = "<unknown>";
-QString
+QString
X11Helper::getWindowClass(WId winId, Display* dpy)
{
unsigned long nitems_ret, bytes_after_ret;
@@ -289,7 +289,7 @@
kDebug() << "Got window class for " << winId << ": '" << X11_WIN_CLASS_ROOT << \
"'" << endl; return X11_WIN_CLASS_ROOT;
}
-
+
// kDebug() << "Getting window class for " << winId << endl;
if((XGetWindowProperty(dpy, w, XA_WM_CLASS, 0L, 256L, 0, XA_STRING,
&type_ret, &format_ret, &nitems_ret,
@@ -301,6 +301,6 @@
property = X11_WIN_CLASS_UNKNOWN;
}
kDebug() << "Got window class for " << winId << ": '" << property << "'" << endl;
-
+
return property;
}
--- trunk/KDE/kdebase/workspace/kcontrol/kxkb/x11helper.h #659919:659920
@@ -43,7 +43,7 @@
* Tries to find X11 xkb config dir
*/
static const QString findX11Dir();
- static const QString findXkbRulesFile(QString x11Dir, Display* dpy);
+ static const QString findXkbRulesFile(const QString &x11Dir, Display* dpy);
static QStringList* getVariants(const QString& layout, const QString& x11Dir);
static RulesInfo* loadRules(const QString& rulesFile, bool layoutsOnly=false);
static OldLayouts* loadOldLayouts(const QString& rulesFile);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic