summaryrefslogtreecommitdiffstats
path: root/kxkb
diff options
context:
space:
mode:
Diffstat (limited to 'kxkb')
-rw-r--r--kxkb/extension.cpp68
-rw-r--r--kxkb/extension.h24
-rw-r--r--kxkb/kcmlayout.cpp290
-rw-r--r--kxkb/kcmlayout.h20
-rw-r--r--kxkb/kcmmisc.cpp46
-rw-r--r--kxkb/kcmmisc.h4
-rw-r--r--kxkb/kxkb.cpp36
-rw-r--r--kxkb/kxkb.h14
-rw-r--r--kxkb/kxkbbindings.cpp4
-rw-r--r--kxkb/kxkbconfig.cpp80
-rw-r--r--kxkb/kxkbconfig.h46
-rw-r--r--kxkb/kxkbtraywindow.cpp38
-rw-r--r--kxkb/kxkbtraywindow.h28
-rw-r--r--kxkb/layoutmap.cpp8
-rw-r--r--kxkb/layoutmap.h12
-rw-r--r--kxkb/pixmap.cpp70
-rw-r--r--kxkb/pixmap.h22
-rw-r--r--kxkb/rules.cpp40
-rw-r--r--kxkb/rules.h40
-rw-r--r--kxkb/x11helper.cpp86
-rw-r--r--kxkb/x11helper.h30
21 files changed, 503 insertions, 503 deletions
diff --git a/kxkb/extension.cpp b/kxkb/extension.cpp
index 405208020..5e9d58ea3 100644
--- a/kxkb/extension.cpp
+++ b/kxkb/extension.cpp
@@ -1,10 +1,10 @@
#include <string.h>
#include <errno.h>
-#include <qstring.h>
-#include <qmap.h>
-#include <qfile.h>
-#include <qdir.h>
+#include <tqstring.h>
+#include <tqmap.h>
+#include <tqfile.h>
+#include <tqdir.h>
#include <kdebug.h>
#include <kstandarddirs.h>
@@ -21,17 +21,17 @@
#include "extension.h"
-QMap<QString, FILE*> XKBExtension::fileCache; //TODO: move to class?
+TQMap<TQString, FILE*> XKBExtension::fileCache; //TODO: move to class?
-static QString getLayoutKey(const QString& layout, const QString& variant)
+static TQString getLayoutKey(const TQString& layout, const TQString& variant)
{
return layout + "." + variant;
}
-QString XKBExtension::getPrecompiledLayoutFilename(const QString& layoutKey)
+TQString XKBExtension::getPrecompiledLayoutFilename(const TQString& layoutKey)
{
- QString compiledLayoutFileName = m_tempDir + layoutKey + ".xkm";
+ TQString compiledLayoutFileName = m_tempDir + layoutKey + ".xkm";
return compiledLayoutFileName;
}
@@ -41,7 +41,7 @@ XKBExtension::XKBExtension(Display *d)
d = qt_xdisplay();
m_dpy = d;
-// QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" );
+// TQStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" );
// m_tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0];
m_tempDir = locateLocal("tmp", "");
}
@@ -81,9 +81,9 @@ bool XKBExtension::init()
void XKBExtension::reset()
{
- for(QMap<QString, FILE*>::ConstIterator it = fileCache.begin(); it != fileCache.end(); it++) {
+ for(TQMap<TQString, FILE*>::ConstIterator it = fileCache.begin(); it != fileCache.end(); it++) {
fclose(*it);
-// remove( QFile::encodeName(getPrecompiledLayoutFileName(*it)) );
+// remove( TQFile::encodeName(getPrecompiledLayoutFileName(*it)) );
}
fileCache.clear();
}
@@ -94,12 +94,12 @@ XKBExtension::~XKBExtension()
deletePrecompiledLayouts();*/
}
-bool XKBExtension::setXkbOptions(const QString& options, bool resetOld)
+bool XKBExtension::setXkbOptions(const TQString& options, bool resetOld)
{
if (options.isEmpty())
return true;
- QString exe = KGlobal::dirs()->findExe("setxkbmap");
+ TQString exe = KGlobal::dirs()->findExe("setxkbmap");
if (exe.isEmpty())
return false;
@@ -114,15 +114,15 @@ bool XKBExtension::setXkbOptions(const QString& options, bool resetOld)
return p.normalExit() && (p.exitStatus() == 0);
}
-bool XKBExtension::setLayout(const QString& model,
- const QString& layout, const QString& variant,
- const QString& includeGroup, bool useCompiledLayouts)
+bool XKBExtension::setLayout(const TQString& model,
+ const TQString& layout, const TQString& variant,
+ const TQString& includeGroup, bool useCompiledLayouts)
{
if( useCompiledLayouts == false ) {
return setLayoutInternal( model, layout, variant, includeGroup );
}
- const QString layoutKey = getLayoutKey(layout, variant);
+ const TQString layoutKey = getLayoutKey(layout, variant);
bool res;
if( fileCache.contains(layoutKey) ) {
@@ -143,21 +143,21 @@ bool XKBExtension::setLayout(const QString& model,
}
// private
-bool XKBExtension::setLayoutInternal(const QString& model,
- const QString& layout, const QString& variant,
- const QString& includeGroup)
+bool XKBExtension::setLayoutInternal(const TQString& model,
+ const TQString& layout, const TQString& variant,
+ const TQString& includeGroup)
{
if ( layout.isEmpty() )
return false;
- QString exe = KGlobal::dirs()->findExe("setxkbmap");
+ TQString exe = KGlobal::dirs()->findExe("setxkbmap");
if( exe.isEmpty() ) {
kdError() << "Can't find setxkbmap" << endl;
return false;
}
- QString fullLayout = layout;
- QString fullVariant = variant;
+ TQString fullLayout = layout;
+ TQString fullVariant = variant;
if( includeGroup.isEmpty() == false ) {
fullLayout = includeGroup;
fullLayout += ",";
@@ -185,7 +185,7 @@ bool XKBExtension::setLayoutInternal(const QString& model,
pXmodmap.start(KProcess::Block);
KProcess pXmodmapHome;
- pXmodmapHome << "/usr/bin/xmodmap" << QDir::home().path() + "/.Xmodmap";
+ pXmodmapHome << "/usr/bin/xmodmap" << TQDir::home().path() + "/.Xmodmap";
pXmodmapHome.start(KProcess::Block);
return p.normalExit() && (p.exitStatus() == 0);
@@ -210,14 +210,14 @@ unsigned int XKBExtension::getGroup() const
* @param[in] fileName file to store compiled layout to
* @return true if no problem, false otherwise
*/
-bool XKBExtension::compileCurrentLayout(const QString &layoutKey)
+bool XKBExtension::compileCurrentLayout(const TQString &layoutKey)
{
XkbFileInfo result;
memset(&result, 0, sizeof(result));
result.type = XkmKeymapFile;
XkbReadFromServer(m_dpy, XkbAllMapComponentsMask, XkbAllMapComponentsMask, &result);
- const QString fileName = getPrecompiledLayoutFilename(layoutKey);
+ const TQString fileName = getPrecompiledLayoutFilename(layoutKey);
kdDebug() << "compiling layout " << this << " cache size: " << fileCache.count() << endl;
if( fileCache.contains(layoutKey) ) {
@@ -227,7 +227,7 @@ bool XKBExtension::compileCurrentLayout(const QString &layoutKey)
fileCache.remove(fileName);
}
- FILE *output = fopen(QFile::encodeName(fileName), "w");
+ FILE *output = fopen(TQFile::encodeName(fileName), "w");
if ( output == NULL )
{
@@ -243,7 +243,7 @@ bool XKBExtension::compileCurrentLayout(const QString &layoutKey)
}
fclose(output); // TODO: can we change mode w/out reopening?
- FILE *input = fopen(QFile::encodeName(fileName), "r");
+ FILE *input = fopen(TQFile::encodeName(fileName), "r");
fileCache[ layoutKey ] = input;
XkbFreeKeyboard(result.xkb, XkbAllControlsMask, True);
@@ -255,7 +255,7 @@ bool XKBExtension::compileCurrentLayout(const QString &layoutKey)
* and sets it as current
* TODO: cache layout in memory rather than in file
*/
-bool XKBExtension::setCompiledLayout(const QString &layoutKey)
+bool XKBExtension::setCompiledLayout(const TQString &layoutKey)
{
FILE *input = NULL;
@@ -265,10 +265,10 @@ bool XKBExtension::setCompiledLayout(const QString &layoutKey)
if( input == NULL ) {
kdWarning() << "setCompiledLayout trying to reopen xkb file" << endl; // should never happen
- const QString fileName = getPrecompiledLayoutFilename(layoutKey);
- input = fopen(QFile::encodeName(fileName), "r");
+ const TQString fileName = getPrecompiledLayoutFilename(layoutKey);
+ input = fopen(TQFile::encodeName(fileName), "r");
- // FILE *input = fopen(QFile::encodeName(fileName), "r");
+ // FILE *input = fopen(TQFile::encodeName(fileName), "r");
if ( input == NULL ) {
kdDebug() << "Unable to open " << fileName << ": " << strerror(errno) << endl;
fileCache.remove(layoutKey);
@@ -323,11 +323,11 @@ bool XKBExtension::setCompiledLayout(const QString &layoutKey)
// Deletes the precompiled layouts stored in temporary files
// void XKBExtension::deletePrecompiledLayouts()
// {
-// QMapConstIterator<LayoutUnit, QString> it, end;
+// TQMapConstIterator<LayoutUnit, TQString> it, end;
// end = m_compiledLayoutFileNames.end();
// for (it = m_compiledLayoutFileNames.begin(); it != end; ++it)
// {
-// unlink(QFile::encodeName(it.data()));
+// unlink(TQFile::encodeName(it.data()));
// }
// m_compiledLayoutFileNames.clear();
// }
diff --git a/kxkb/extension.h b/kxkb/extension.h
index 24a0324bc..bf4293d2b 100644
--- a/kxkb/extension.h
+++ b/kxkb/extension.h
@@ -12,25 +12,25 @@ public:
bool init();
void reset();
- static bool setXkbOptions(const QString& options, bool resetOldOptions);
- bool setLayout(const QString& model,
- const QString& layout, const QString& variant,
- const QString& includeGroup, bool useCompiledLayouts=true);
+ static bool setXkbOptions(const TQString& options, bool resetOldOptions);
+ bool setLayout(const TQString& model,
+ const TQString& layout, const TQString& variant,
+ const TQString& includeGroup, bool useCompiledLayouts=true);
bool setGroup(unsigned int group);
unsigned int getGroup() const;
private:
Display *m_dpy;
- QString m_tempDir;
- static QMap<QString, FILE*> fileCache;
+ TQString m_tempDir;
+ static TQMap<TQString, FILE*> fileCache;
- bool setLayoutInternal(const QString& model,
- const QString& layout, const QString& variant,
- const QString& includeGroup);
- bool compileCurrentLayout(const QString& layoutKey);
- bool setCompiledLayout(const QString& layoutKey);
+ bool setLayoutInternal(const TQString& model,
+ const TQString& layout, const TQString& variant,
+ const TQString& includeGroup);
+ bool compileCurrentLayout(const TQString& layoutKey);
+ bool setCompiledLayout(const TQString& layoutKey);
- QString getPrecompiledLayoutFilename(const QString& layoutKey);
+ TQString getPrecompiledLayoutFilename(const TQString& layoutKey);
// void deletePrecompiledLayouts();
};
diff --git a/kxkb/kcmlayout.cpp b/kxkb/kcmlayout.cpp
index 5f5b1ff84..502bf7972 100644
--- a/kxkb/kcmlayout.cpp
+++ b/kxkb/kcmlayout.cpp
@@ -1,18 +1,18 @@
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcombobox.h>
-#include <qtabwidget.h>
-#include <qvgroupbox.h>
-#include <qpushbutton.h>
-#include <qlistview.h>
-#include <qheader.h>
-#include <qwhatsthis.h>
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qlineedit.h>
-#include <qlistview.h>
-#include <qbuttongroup.h>
-#include <qspinbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcombobox.h>
+#include <tqtabwidget.h>
+#include <tqvgroupbox.h>
+#include <tqpushbutton.h>
+#include <tqlistview.h>
+#include <tqheader.h>
+#include <tqwhatsthis.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqlineedit.h>
+#include <tqlistview.h>
+#include <tqbuttongroup.h>
+#include <tqspinbox.h>
#include <kkeydialog.h>
#include <kglobal.h>
@@ -45,31 +45,31 @@ enum {
DST_LAYOUT_COLUMN_COUNT = 6
};
-static const QString DEFAULT_VARIANT_NAME("<default>");
+static const TQString DEFAULT_VARIANT_NAME("<default>");
class OptionListItem : public QCheckListItem
{
public:
- OptionListItem( OptionListItem *parent, const QString &text, Type tt,
- const QString &optionName );
- OptionListItem( QListView *parent, const QString &text, Type tt,
- const QString &optionName );
+ OptionListItem( OptionListItem *parent, const TQString &text, Type tt,
+ const TQString &optionName );
+ OptionListItem( TQListView *parent, const TQString &text, Type tt,
+ const TQString &optionName );
~OptionListItem() {}
- QString optionName() const { return m_OptionName; }
+ TQString optionName() const { return m_OptionName; }
- OptionListItem *findChildItem( const QString& text );
+ OptionListItem *findChildItem( const TQString& text );
protected:
- QString m_OptionName;
+ TQString m_OptionName;
};
-static QString lookupLocalized(const QDict<char> &dict, const QString& text)
+static TQString lookupLocalized(const TQDict<char> &dict, const TQString& text)
{
- QDictIterator<char> it(dict);
+ TQDictIterator<char> it(dict);
while (it.current())
{
if ( i18n(it.current()) == text )
@@ -77,12 +77,12 @@ static QString lookupLocalized(const QDict<char> &dict, const QString& text)
++it;
}
- return QString::null;
+ return TQString::null;
}
-static QListViewItem* copyLVI(const QListViewItem* src, QListView* parent)
+static TQListViewItem* copyLVI(const TQListViewItem* src, TQListView* parent)
{
- QListViewItem* ret = new QListViewItem(parent);
+ TQListViewItem* ret = new TQListViewItem(parent);
for(int i = 0; i < SRC_LAYOUT_COLUMN_COUNT; i++)
{
ret->setText(i, src->text(i));
@@ -94,46 +94,46 @@ static QListViewItem* copyLVI(const QListViewItem* src, QListView* parent)
}
-LayoutConfig::LayoutConfig(QWidget *parent, const char *name)
+LayoutConfig::LayoutConfig(TQWidget *parent, const char *name)
: KCModule(parent, name),
m_rules(NULL)
{
- QVBoxLayout *main = new QVBoxLayout(this, 0, KDialog::spacingHint());
+ TQVBoxLayout *main = new TQVBoxLayout(this, 0, KDialog::spacingHint());
widget = new LayoutConfigWidget(this, "widget");
main->addWidget(widget);
- connect( widget->chkEnable, SIGNAL( toggled( bool )), this, SLOT(changed()));
- connect( widget->chkShowSingle, SIGNAL( toggled( bool )), this, SLOT(changed()));
- connect( widget->chkShowFlag, SIGNAL( toggled( bool )), this, SLOT(changed()));
- connect( widget->comboModel, SIGNAL(activated(int)), this, SLOT(changed()));
+ connect( widget->chkEnable, TQT_SIGNAL( toggled( bool )), this, TQT_SLOT(changed()));
+ connect( widget->chkShowSingle, TQT_SIGNAL( toggled( bool )), this, TQT_SLOT(changed()));
+ connect( widget->chkShowFlag, TQT_SIGNAL( toggled( bool )), this, TQT_SLOT(changed()));
+ connect( widget->comboModel, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed()));
- connect( widget->listLayoutsSrc, SIGNAL(doubleClicked(QListViewItem*,const QPoint&, int)),
- this, SLOT(add()));
- connect( widget->btnAdd, SIGNAL(clicked()), this, SLOT(add()));
- connect( widget->btnRemove, SIGNAL(clicked()), this, SLOT(remove()));
+ connect( widget->listLayoutsSrc, TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint&, int)),
+ this, TQT_SLOT(add()));
+ connect( widget->btnAdd, TQT_SIGNAL(clicked()), this, TQT_SLOT(add()));
+ connect( widget->btnRemove, TQT_SIGNAL(clicked()), this, TQT_SLOT(remove()));
- connect( widget->comboVariant, SIGNAL(activated(int)), this, SLOT(changed()));
- connect( widget->comboVariant, SIGNAL(activated(int)), this, SLOT(variantChanged()));
- connect( widget->listLayoutsDst, SIGNAL(selectionChanged(QListViewItem *)),
- this, SLOT(layoutSelChanged(QListViewItem *)));
+ connect( widget->comboVariant, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed()));
+ connect( widget->comboVariant, TQT_SIGNAL(activated(int)), this, TQT_SLOT(variantChanged()));
+ connect( widget->listLayoutsDst, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
+ this, TQT_SLOT(layoutSelChanged(TQListViewItem *)));
- connect( widget->editDisplayName, SIGNAL(textChanged(const QString&)), this, SLOT(displayNameChanged(const QString&)));
+ connect( widget->editDisplayName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(displayNameChanged(const TQString&)));
- connect( widget->chkLatin, SIGNAL(clicked()), this, SLOT(changed()));
- connect( widget->chkLatin, SIGNAL(clicked()), this, SLOT(latinChanged()));
+ connect( widget->chkLatin, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+ connect( widget->chkLatin, TQT_SIGNAL(clicked()), this, TQT_SLOT(latinChanged()));
widget->btnUp->setIconSet(SmallIconSet("1uparrow"));
- connect( widget->btnUp, SIGNAL(clicked()), this, SLOT(changed()));
- connect( widget->btnUp, SIGNAL(clicked()), this, SLOT(moveUp()));
+ connect( widget->btnUp, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+ connect( widget->btnUp, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveUp()));
widget->btnDown->setIconSet(SmallIconSet("1downarrow"));
- connect( widget->btnDown, SIGNAL(clicked()), this, SLOT(changed()));
- connect( widget->btnDown, SIGNAL(clicked()), this, SLOT(moveDown()));
+ connect( widget->btnDown, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+ connect( widget->btnDown, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveDown()));
- connect( widget->grpSwitching, SIGNAL( clicked( int ) ), SLOT(changed()));
+ connect( widget->grpSwitching, TQT_SIGNAL( clicked( int ) ), TQT_SLOT(changed()));
- connect( widget->chkEnableSticky, SIGNAL(toggled(bool)), this, SLOT(changed()));
- connect( widget->spinStickyDepth, SIGNAL(valueChanged(int)), this, SLOT(changed()));
+ connect( widget->chkEnableSticky, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(changed()));
+ connect( widget->spinStickyDepth, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed()));
widget->listLayoutsSrc->setColumnText(LAYOUT_COLUMN_FLAG, "");
widget->listLayoutsDst->setColumnText(LAYOUT_COLUMN_FLAG, "");
@@ -145,16 +145,16 @@ LayoutConfig::LayoutConfig(QWidget *parent, const char *name)
widget->listLayoutsDst->header()->setResizeEnabled(FALSE, LAYOUT_COLUMN_INCLUDE);
widget->listLayoutsDst->header()->setResizeEnabled(FALSE, LAYOUT_COLUMN_DISPLAY_NAME);
- widget->listLayoutsDst->setColumnWidthMode(LAYOUT_COLUMN_INCLUDE, QListView::Manual);
+ widget->listLayoutsDst->setColumnWidthMode(LAYOUT_COLUMN_INCLUDE, TQListView::Manual);
widget->listLayoutsDst->setColumnWidth(LAYOUT_COLUMN_INCLUDE, 0);
// widget->listLayoutsDst->setColumnWidth(LAYOUT_COLUMN_DISPLAY_NAME, 0);
widget->listLayoutsDst->setSorting(-1);
#if 0
- widget->listLayoutsDst->setResizeMode(QListView::LastColumn);
- widget->listLayoutsSrc->setResizeMode(QListView::LastColumn);
+ widget->listLayoutsDst->setResizeMode(TQListView::LastColumn);
+ widget->listLayoutsSrc->setResizeMode(TQListView::LastColumn);
#endif
- widget->listLayoutsDst->setResizeMode(QListView::LastColumn);
+ widget->listLayoutsDst->setResizeMode(TQListView::LastColumn);
//Read rules - we _must_ read _before_ creating xkb-options comboboxes
loadRules();
@@ -185,19 +185,19 @@ void LayoutConfig::initUI() {
widget->comboModel->setCurrentText(i18n(modelName));
- QValueList<LayoutUnit> otherLayouts = m_kxkbConfig.m_layouts;
+ TQValueList<LayoutUnit> otherLayouts = m_kxkbConfig.m_layouts;
widget->listLayoutsDst->clear();
// to optimize we should have gone from it.end to it.begin
- QValueList<LayoutUnit>::ConstIterator it;
+ TQValueList<LayoutUnit>::ConstIterator it;
for (it = otherLayouts.begin(); it != otherLayouts.end(); ++it ) {
- QListViewItemIterator src_it( widget->listLayoutsSrc );
+ TQListViewItemIterator src_it( widget->listLayoutsSrc );
LayoutUnit layoutUnit = *it;
for ( ; src_it.current(); ++src_it ) {
- QListViewItem* srcItem = src_it.current();
+ TQListViewItem* srcItem = src_it.current();
if ( layoutUnit.layout == src_it.current()->text(LAYOUT_COLUMN_MAP) ) { // check if current config knows about this layout
- QListViewItem* newItem = copyLVI(srcItem, widget->listLayoutsDst);
+ TQListViewItem* newItem = copyLVI(srcItem, widget->listLayoutsDst);
newItem->setText(LAYOUT_COLUMN_VARIANT, layoutUnit.variant);
newItem->setText(LAYOUT_COLUMN_INCLUDE, layoutUnit.includeGroup);
@@ -241,19 +241,19 @@ void LayoutConfig::initUI() {
widget->optionsFrame->setEnabled( m_kxkbConfig.m_useKxkb );
// display xkb options
- QStringList options = QStringList::split(',', m_kxkbConfig.m_options);
- for (QStringList::ConstIterator it = options.begin(); it != options.end(); ++it)
+ TQStringList options = TQStringList::split(',', m_kxkbConfig.m_options);
+ for (TQStringList::ConstIterator it = options.begin(); it != options.end(); ++it)
{
- QString option = *it;
- QString optionKey = option.mid(0, option.find(':'));
- QString optionName = m_rules->options()[option];
+ TQString option = *it;
+ TQString optionKey = option.mid(0, option.find(':'));
+ TQString optionName = m_rules->options()[option];
OptionListItem *item = m_optionGroups[i18n(optionKey.latin1())];
if (item != NULL) {
OptionListItem *child = item->findChildItem( option );
if ( child )
- child->setState( QCheckListItem::On );
+ child->setState( TQCheckListItem::On );
else
kdDebug() << "load: Unknown option: " << option << endl;
}
@@ -269,20 +269,20 @@ void LayoutConfig::initUI() {
void LayoutConfig::save()
{
- QString model = lookupLocalized(m_rules->models(), widget->comboModel->currentText());
+ TQString model = lookupLocalized(m_rules->models(), widget->comboModel->currentText());
m_kxkbConfig.m_model = model;
m_kxkbConfig.m_enableXkbOptions = widget->chkEnableOptions->isChecked();
m_kxkbConfig.m_resetOldOptions = widget->checkResetOld->isChecked();
m_kxkbConfig.m_options = createOptionString();
- QListViewItem *item = widget->listLayoutsDst->firstChild();
- QValueList<LayoutUnit> layouts;
+ TQListViewItem *item = widget->listLayoutsDst->firstChild();
+ TQValueList<LayoutUnit> layouts;
while (item) {
- QString layout = item->text(LAYOUT_COLUMN_MAP);
- QString variant = item->text(LAYOUT_COLUMN_VARIANT);
- QString includes = item->text(LAYOUT_COLUMN_INCLUDE);
- QString displayName = item->text(LAYOUT_COLUMN_DISPLAY_NAME);
+ TQString layout = item->text(LAYOUT_COLUMN_MAP);
+ TQString variant = item->text(LAYOUT_COLUMN_VARIANT);
+ TQString includes = item->text(LAYOUT_COLUMN_INCLUDE);
+ TQString displayName = item->text(LAYOUT_COLUMN_DISPLAY_NAME);
LayoutUnit layoutUnit(layout, variant);
layoutUnit.includeGroup = includes;
@@ -345,13 +345,13 @@ void LayoutConfig::updateStickyLimit()
void LayoutConfig::add()
{
- QListViewItem* sel = widget->listLayoutsSrc->selectedItem();
+ TQListViewItem* sel = widget->listLayoutsSrc->selectedItem();
if( sel == 0 )
return;
// Create a copy of the sel widget, as one might add the same layout more
// than one time, with different variants.
- QListViewItem* toadd = copyLVI(sel, widget->listLayoutsDst);
+ TQListViewItem* toadd = copyLVI(sel, widget->listLayoutsDst);
widget->listLayoutsDst->insertItem(toadd);
if( widget->listLayoutsDst->childCount() > 1 )
@@ -366,8 +366,8 @@ void LayoutConfig::add()
void LayoutConfig::remove()
{
- QListViewItem* sel = widget->listLayoutsDst->selectedItem();
- QListViewItem* newSel = 0;
+ TQListViewItem* sel = widget->listLayoutsDst->selectedItem();
+ TQListViewItem* newSel = 0;
if( sel == 0 )
return;
@@ -389,7 +389,7 @@ void LayoutConfig::remove()
void LayoutConfig::moveUp()
{
- QListViewItem* sel = widget->listLayoutsDst->selectedItem();
+ TQListViewItem* sel = widget->listLayoutsDst->selectedItem();
if( sel == 0 || sel->itemAbove() == 0 )
return;
@@ -404,7 +404,7 @@ void LayoutConfig::moveUp()
void LayoutConfig::moveDown()
{
- QListViewItem* sel = widget->listLayoutsDst->selectedItem();
+ TQListViewItem* sel = widget->listLayoutsDst->selectedItem();
if( sel == 0 || sel->itemBelow() == 0 )
return;
@@ -413,37 +413,37 @@ void LayoutConfig::moveDown()
void LayoutConfig::variantChanged()
{
- QListViewItem* selLayout = widget->listLayoutsDst->selectedItem();
+ TQListViewItem* selLayout = widget->listLayoutsDst->selectedItem();
if( selLayout == NULL ) {
widget->comboVariant->clear();
widget->comboVariant->setEnabled(false);
return;
}
- QString selectedVariant = widget->comboVariant->currentText();
+ TQString selectedVariant = widget->comboVariant->currentText();
if( selectedVariant == DEFAULT_VARIANT_NAME )
selectedVariant = "";
selLayout->setText(LAYOUT_COLUMN_VARIANT, selectedVariant);
}
// helper
-LayoutUnit LayoutConfig::getLayoutUnitKey(QListViewItem *sel)
+LayoutUnit LayoutConfig::getLayoutUnitKey(TQListViewItem *sel)
{
- QString kbdLayout = sel->text(LAYOUT_COLUMN_MAP);
- QString kbdVariant = sel->text(LAYOUT_COLUMN_VARIANT);
+ TQString kbdLayout = sel->text(LAYOUT_COLUMN_MAP);
+ TQString kbdVariant = sel->text(LAYOUT_COLUMN_VARIANT);
return LayoutUnit(kbdLayout, kbdVariant);
}
-void LayoutConfig::displayNameChanged(const QString& newDisplayName)
+void LayoutConfig::displayNameChanged(const TQString& newDisplayName)
{
- QListViewItem* selLayout = widget->listLayoutsDst->selectedItem();
+ TQListViewItem* selLayout = widget->listLayoutsDst->selectedItem();
if( selLayout == NULL )
return;
const LayoutUnit layoutUnitKey = getLayoutUnitKey( selLayout );
LayoutUnit& layoutUnit = *m_kxkbConfig.m_layouts.find(layoutUnitKey);
- QString oldName = selLayout->text(LAYOUT_COLUMN_DISPLAY_NAME);
+ TQString oldName = selLayout->text(LAYOUT_COLUMN_DISPLAY_NAME);
if( oldName.isEmpty() )
oldName = KxkbConfig::getDefaultDisplayName( layoutUnit );
@@ -458,21 +458,21 @@ void LayoutConfig::displayNameChanged(const QString& newDisplayName)
/** will update flag with label if layout label has been edited
*/
-void LayoutConfig::updateIndicator(QListViewItem* selLayout)
+void LayoutConfig::updateIndicator(TQListViewItem* selLayout)
{
}
void LayoutConfig::latinChanged()
{
- QListViewItem* selLayout = widget->listLayoutsDst->selectedItem();
+ TQListViewItem* selLayout = widget->listLayoutsDst->selectedItem();
if ( !selLayout ) {
widget->chkLatin->setChecked( false );
widget->chkLatin->setEnabled( false );
return;
}
- QString include;
+ TQString include;
if( widget->chkLatin->isChecked() )
include = "us";
else
@@ -483,7 +483,7 @@ void LayoutConfig::latinChanged()
kdDebug() << "layout " << layoutUnitKey.toPair() << ", inc: " << include << endl;
}
-void LayoutConfig::layoutSelChanged(QListViewItem *sel)
+void LayoutConfig::layoutSelChanged(TQListViewItem *sel)
{
widget->comboVariant->clear();
widget->comboVariant->setEnabled( sel != NULL );
@@ -497,7 +497,7 @@ void LayoutConfig::layoutSelChanged(QListViewItem *sel)
LayoutUnit layoutUnitKey = getLayoutUnitKey(sel);
- QString kbdLayout = layoutUnitKey.layout;
+ TQString kbdLayout = layoutUnitKey.layout;
// TODO: need better algorithm here for determining if needs us group
if ( ! m_rules->isSingleGroup(kbdLayout)
@@ -505,7 +505,7 @@ void LayoutConfig::layoutSelChanged(QListViewItem *sel)
widget->chkLatin->setEnabled( false );
}
else {
- QString inc = sel->text(LAYOUT_COLUMN_INCLUDE);
+ TQString inc = sel->text(LAYOUT_COLUMN_INCLUDE);
if ( inc.startsWith("us") || inc.startsWith("en") ) {
widget->chkLatin->setChecked(true);
}
@@ -514,14 +514,14 @@ void LayoutConfig::layoutSelChanged(QListViewItem *sel)
}
}
- QStringList vars = m_rules->getAvailableVariants(kbdLayout);
+ TQStringList vars = m_rules->getAvailableVariants(kbdLayout);
kdDebug() << "layout " << kbdLayout << " has " << vars.count() << " variants" << endl;
if( vars.count() > 0 ) {
vars.prepend(DEFAULT_VARIANT_NAME);
widget->comboVariant->insertStringList(vars);
- QString variant = sel->text(LAYOUT_COLUMN_VARIANT);
+ TQString variant = sel->text(LAYOUT_COLUMN_VARIANT);
if( variant != NULL && variant.isEmpty() == false ) {
widget->comboVariant->setCurrentText(variant);
}
@@ -532,25 +532,25 @@ void LayoutConfig::layoutSelChanged(QListViewItem *sel)
updateLayoutCommand();
}
-QWidget* LayoutConfig::makeOptionsTab()
+TQWidget* LayoutConfig::makeOptionsTab()
{
- QListView *listView = widget->listOptions;
+ TQListView *listView = widget->listOptions;
listView->setMinimumHeight(150);
listView->setSortColumn( -1 );
listView->setColumnText( 0, i18n( "Options" ) );
listView->clear();
- connect(listView, SIGNAL(clicked(QListViewItem *)), SLOT(changed()));
- connect(listView, SIGNAL(clicked(QListViewItem *)), SLOT(updateOptionsCommand()));
+ connect(listView, TQT_SIGNAL(clicked(TQListViewItem *)), TQT_SLOT(changed()));
+ connect(listView, TQT_SIGNAL(clicked(TQListViewItem *)), TQT_SLOT(updateOptionsCommand()));
- connect(widget->chkEnableOptions, SIGNAL(toggled(bool)), SLOT(changed()));
+ connect(widget->chkEnableOptions, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
- connect(widget->checkResetOld, SIGNAL(toggled(bool)), SLOT(changed()));
- connect(widget->checkResetOld, SIGNAL(toggled(bool)), SLOT(updateOptionsCommand()));
+ connect(widget->checkResetOld, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed()));
+ connect(widget->checkResetOld, TQT_SIGNAL(toggled(bool)), TQT_SLOT(updateOptionsCommand()));
//Create controllers for all options
- QDictIterator<char> it(m_rules->options());
+ TQDictIterator<char> it(m_rules->options());
OptionListItem *parent;
for (; it.current(); ++it)
{
@@ -559,14 +559,14 @@ QWidget* LayoutConfig::makeOptionsTab()
if( it.currentKey() == "ctrl" || it.currentKey() == "caps"
|| it.currentKey() == "altwin" ) {
parent = new OptionListItem(listView, i18n( it.current() ),
- QCheckListItem::RadioButtonController, it.currentKey());
+ TQCheckListItem::RadioButtonController, it.currentKey());
OptionListItem *item = new OptionListItem(parent, i18n( "None" ),
- QCheckListItem::RadioButton, "none");
- item->setState(QCheckListItem::On);
+ TQCheckListItem::RadioButton, "none");
+ item->setState(TQCheckListItem::On);
}
else {
parent = new OptionListItem(listView, i18n( it.current() ),
- QCheckListItem::CheckBoxController, it.currentKey());
+ TQCheckListItem::CheckBoxController, it.currentKey());
}
parent->setOpen(true);
m_optionGroups.insert(i18n(it.currentKey().local8Bit()), parent);
@@ -576,7 +576,7 @@ QWidget* LayoutConfig::makeOptionsTab()
it.toFirst();
for( ; it.current(); ++it)
{
- QString key = it.currentKey();
+ TQString key = it.currentKey();
int pos = key.find(':');
if (pos >= 0)
{
@@ -585,14 +585,14 @@ QWidget* LayoutConfig::makeOptionsTab()
parent = m_optionGroups["misc"];
if (parent != NULL) {
// workaroung for mistake in rules file for xkb options in XFree 4.2.0
- QString text(it.current());
+ TQString text(it.current());
text = text.replace( "Cap$", "Caps." );
- if( parent->type() == QCheckListItem::RadioButtonController )
+ if( parent->type() == TQCheckListItem::RadioButtonController )
new OptionListItem(parent, i18n(text.utf8()),
- QCheckListItem::RadioButton, key);
+ TQCheckListItem::RadioButton, key);
else
new OptionListItem(parent, i18n(text.utf8()),
- QCheckListItem::CheckBox, key);
+ TQCheckListItem::CheckBox, key);
}
}
}
@@ -604,8 +604,8 @@ QWidget* LayoutConfig::makeOptionsTab()
void LayoutConfig::updateOptionsCommand()
{
- QString setxkbmap;
- QString options = createOptionString();
+ TQString setxkbmap;
+ TQString options = createOptionString();
if( !options.isEmpty() ) {
setxkbmap = "setxkbmap -option "; //-rules " + m_rule
@@ -618,13 +618,13 @@ void LayoutConfig::updateOptionsCommand()
void LayoutConfig::updateLayoutCommand()
{
- QString setxkbmap;
- QString layoutDisplayName;
- QListViewItem* sel = widget->listLayoutsDst->selectedItem();
+ TQString setxkbmap;
+ TQString layoutDisplayName;
+ TQListViewItem* sel = widget->listLayoutsDst->selectedItem();
if( sel != NULL ) {
- QString kbdLayout = sel->text(LAYOUT_COLUMN_MAP);
- QString variant = widget->comboVariant->currentText();
+ TQString kbdLayout = sel->text(LAYOUT_COLUMN_MAP);
+ TQString variant = widget->comboVariant->currentText();
if( variant == DEFAULT_VARIANT_NAME )
variant = "";
@@ -640,9 +640,9 @@ void LayoutConfig::updateLayoutCommand()
layoutDisplayName = sel->text(LAYOUT_COLUMN_DISPLAY_NAME);
if( layoutDisplayName.isEmpty() ) {
int count = 0;
- QListViewItem *item = widget->listLayoutsDst->firstChild();
+ TQListViewItem *item = widget->listLayoutsDst->firstChild();
while (item) {
- QString layout_ = item->text(LAYOUT_COLUMN_MAP);
+ TQString layout_ = item->text(LAYOUT_COLUMN_MAP);
if( layout_ == kbdLayout )
++count;
item = item->nextSibling();
@@ -680,8 +680,8 @@ void LayoutConfig::loadRules()
delete m_rules;
m_rules = new XkbRules();
- QStringList modelsList;
- QDictIterator<char> it(m_rules->models());
+ TQStringList modelsList;
+ TQDictIterator<char> it(m_rules->models());
while (it.current()) {
modelsList.append(i18n(it.current()));
++it;
@@ -695,35 +695,35 @@ void LayoutConfig::loadRules()
// fill in the additional layouts
widget->listLayoutsSrc->clear();
widget->listLayoutsDst->clear();
- QDictIterator<char> it2(m_rules->layouts());
+ TQDictIterator<char> it2(m_rules->layouts());
while (it2.current())
{
- QString layout = it2.currentKey();
- QString layoutName = it2.current();
- QListViewItem *item = new QListViewItem(widget->listLayoutsSrc);
+ TQString layout = it2.currentKey();
+ TQString layoutName = it2.current();
+ TQListViewItem *item = new TQListViewItem(widget->listLayoutsSrc);
item->setPixmap(LAYOUT_COLUMN_FLAG, LayoutIcon::getInstance().findPixmap(layout, true));
item->setText(LAYOUT_COLUMN_NAME, i18n(layoutName.latin1()));
item->setText(LAYOUT_COLUMN_MAP, layout);
++it2;
}
- widget->listLayoutsSrc->setSorting(LAYOUT_COLUMN_NAME); // from Qt3 QListView sorts by language
+ widget->listLayoutsSrc->setSorting(LAYOUT_COLUMN_NAME); // from Qt3 TQListView sorts by language
//TODO: reset options and xkb options
}
-QString LayoutConfig::createOptionString()
+TQString LayoutConfig::createOptionString()
{
- QString options;
- for (QDictIterator<char> it(m_rules->options()); it.current(); ++it)
+ TQString options;
+ for (TQDictIterator<char> it(m_rules->options()); it.current(); ++it)
{
- QString option(it.currentKey());
+ TQString option(it.currentKey());
if (option.contains(':')) {
- QString optionKey = option.mid(0, option.find(':'));
+ TQString optionKey = option.mid(0, option.find(':'));
OptionListItem *item = m_optionGroups[optionKey];
if( !item ) {
@@ -735,8 +735,8 @@ QString LayoutConfig::createOptionString()
OptionListItem *child = item->findChildItem( option );
if ( child ) {
- if ( child->state() == QCheckListItem::On ) {
- QString selectedName = child->optionName();
+ if ( child->state() == TQCheckListItem::On ) {
+ TQString selectedName = child->optionName();
if ( !selectedName.isEmpty() && selectedName != "none" ) {
if (!options.isEmpty())
options.append(',');
@@ -763,19 +763,19 @@ void LayoutConfig::defaults()
}
-OptionListItem::OptionListItem( OptionListItem *parent, const QString &text,
- Type tt, const QString &optionName )
- : QCheckListItem( parent, text, tt ), m_OptionName( optionName )
+OptionListItem::OptionListItem( OptionListItem *parent, const TQString &text,
+ Type tt, const TQString &optionName )
+ : TQCheckListItem( parent, text, tt ), m_OptionName( optionName )
{
}
-OptionListItem::OptionListItem( QListView *parent, const QString &text,
- Type tt, const QString &optionName )
- : QCheckListItem( parent, text, tt ), m_OptionName( optionName )
+OptionListItem::OptionListItem( TQListView *parent, const TQString &text,
+ Type tt, const TQString &optionName )
+ : TQCheckListItem( parent, text, tt ), m_OptionName( optionName )
{
}
-OptionListItem * OptionListItem::findChildItem( const QString& optionName )
+OptionListItem * OptionListItem::findChildItem( const TQString& optionName )
{
OptionListItem *child = static_cast<OptionListItem *>( firstChild() );
@@ -792,12 +792,12 @@ OptionListItem * OptionListItem::findChildItem( const QString& optionName )
extern "C"
{
- KDE_EXPORT KCModule *create_keyboard_layout(QWidget *parent, const char *)
+ KDE_EXPORT KCModule *create_keyboard_layout(TQWidget *parent, const char *)
{
return new LayoutConfig(parent, "kcmlayout");
}
- KDE_EXPORT KCModule *create_keyboard(QWidget *parent, const char *)
+ KDE_EXPORT KCModule *create_keyboard(TQWidget *parent, const char *)
{
return new KeyboardConfig(parent, "kcmlayout");
}
diff --git a/kxkb/kcmlayout.h b/kxkb/kcmlayout.h
index 76c8b6d55..6f61e9e06 100644
--- a/kxkb/kcmlayout.h
+++ b/kxkb/kcmlayout.h
@@ -4,8 +4,8 @@
#include <kcmodule.h>
-#include <qstring.h>
-#include <qlistview.h>
+#include <tqstring.h>
+#include <tqlistview.h>
#include "kxkbconfig.h"
@@ -19,7 +19,7 @@ class LayoutConfig : public KCModule
Q_OBJECT
public:
- LayoutConfig(QWidget *parent = 0L, const char *name = 0L);
+ LayoutConfig(TQWidget *parent = 0L, const char *name = 0L);
virtual ~LayoutConfig();
void load();
@@ -28,16 +28,16 @@ public:
void initUI();
protected:
- QString createOptionString();
- void updateIndicator(QListViewItem* selLayout);
+ TQString createOptionString();
+ void updateIndicator(TQListViewItem* selLayout);
protected slots:
void moveUp();
void moveDown();
void variantChanged();
- void displayNameChanged(const QString& name);
+ void displayNameChanged(const TQString& name);
void latinChanged();
- void layoutSelChanged(QListViewItem *);
+ void layoutSelChanged(TQListViewItem *);
void loadRules();
void updateLayoutCommand();
void updateOptionsCommand();
@@ -51,11 +51,11 @@ private:
XkbRules *m_rules;
KxkbConfig m_kxkbConfig;
- QDict<OptionListItem> m_optionGroups;
+ TQDict<OptionListItem> m_optionGroups;
- QWidget* makeOptionsTab();
+ TQWidget* makeOptionsTab();
void updateStickyLimit();
- static LayoutUnit getLayoutUnitKey(QListViewItem *sel);
+ static LayoutUnit getLayoutUnitKey(TQListViewItem *sel);
};
diff --git a/kxkb/kcmmisc.cpp b/kxkb/kcmmisc.cpp
index 3453c4abb..f66ea587c 100644
--- a/kxkb/kcmmisc.cpp
+++ b/kxkb/kcmmisc.cpp
@@ -28,14 +28,14 @@
#include <config.h>
#include <math.h>
-#include <qslider.h>
-#include <qfileinfo.h>
-#include <qcheckbox.h>
-#include <qstring.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qvbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqslider.h>
+#include <tqfileinfo.h>
+#include <tqcheckbox.h>
+#include <tqstring.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqvbuttongroup.h>
+#include <tqradiobutton.h>
#include <klocale.h>
#include <kconfig.h>
@@ -50,11 +50,11 @@
#include "kcmmiscwidget.h"
#include <X11/Xlib.h>
-KeyboardConfig::KeyboardConfig (QWidget * parent, const char *)
+KeyboardConfig::KeyboardConfig (TQWidget * parent, const char *)
: KCModule (parent, "kcmlayout")
{
- QString wtstr;
- QBoxLayout* lay = new QVBoxLayout(this, 0, KDialog::spacingHint());
+ TQString wtstr;
+ TQBoxLayout* lay = new TQVBoxLayout(this, 0, KDialog::spacingHint());
ui = new KeyboardConfigWidget(this, "ui");
lay->addWidget(ui);
lay->addStretch();
@@ -73,14 +73,14 @@ KeyboardConfig::KeyboardConfig (QWidget * parent, const char *)
ui->rateSlider->setSteps(30, 500);
ui->rateSlider->setTickInterval(498);
- connect(ui->repeatBox, SIGNAL(clicked()), this, SLOT(changed()));
- connect(ui->delay, SIGNAL(valueChanged(int)), this, SLOT(delaySpinboxChanged(int)));
- connect(ui->delaySlider, SIGNAL(valueChanged(int)), this, SLOT(delaySliderChanged(int)));
- connect(ui->rate, SIGNAL(valueChanged(double)), this, SLOT(rateSpinboxChanged(double)));
- connect(ui->rateSlider, SIGNAL(valueChanged(int)), this, SLOT(rateSliderChanged(int)));
+ connect(ui->repeatBox, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+ connect(ui->delay, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(delaySpinboxChanged(int)));
+ connect(ui->delaySlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(delaySliderChanged(int)));
+ connect(ui->rate, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(rateSpinboxChanged(double)));
+ connect(ui->rateSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(rateSliderChanged(int)));
- connect(ui->click, SIGNAL(valueChanged(int)), this, SLOT(changed()));
- connect(ui->numlockGroup, SIGNAL(released(int)), this, SLOT(changed()));
+ connect(ui->click, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed()));
+ connect(ui->numlockGroup, TQT_SIGNAL(released(int)), this, TQT_SLOT(changed()));
#if !defined(HAVE_XTEST) && !defined(HAVE_XKB)
ui->numlockGroup->setDisabled( true );
@@ -113,7 +113,7 @@ void KeyboardConfig::setClick(int v)
int KeyboardConfig::getNumLockState()
{
- QButton* selected = ui->numlockGroup->selected();
+ TQButton* selected = ui->numlockGroup->selected();
if( selected == NULL )
return 2;
int ret = ui->numlockGroup->id( selected );
@@ -183,9 +183,9 @@ void KeyboardConfig::defaults()
setNumLockState( 2 );
}
-QString KeyboardConfig::quickHelp() const
+TQString KeyboardConfig::quickHelp() const
{
- return QString::null;
+ return TQString::null;
/* "<h1>Keyboard</h1> This module allows you to choose options"
" for the way in which your keyboard works. The actual effect of"
@@ -470,12 +470,12 @@ void set_repeatrate(int delay, double rate)
else
r = (int)floor(rate + 0.5);
- QString exe = KGlobal::dirs()->findExe("xset");
+ TQString exe = KGlobal::dirs()->findExe("xset");
if (exe.isEmpty())
return;
KProcess p;
- p << exe << "r" << "rate" << QString::number(delay) << QString::number(r);
+ p << exe << "r" << "rate" << TQString::number(delay) << TQString::number(r);
p.start(KProcess::Block);
}
diff --git a/kxkb/kcmmisc.h b/kxkb/kcmmisc.h
index 02829cd20..52b7a046f 100644
--- a/kxkb/kcmmisc.h
+++ b/kxkb/kcmmisc.h
@@ -34,13 +34,13 @@ class KeyboardConfig : public KCModule
{
Q_OBJECT
public:
- KeyboardConfig( QWidget *parent=0, const char* name=0);
+ KeyboardConfig( TQWidget *parent=0, const char* name=0);
void save();
void load();
void defaults();
- QString quickHelp() const;
+ TQString quickHelp() const;
static void init_keyboard();
diff --git a/kxkb/kxkb.cpp b/kxkb/kxkb.cpp
index 114ddc7a9..43e9f8046 100644
--- a/kxkb/kxkb.cpp
+++ b/kxkb/kxkb.cpp
@@ -27,10 +27,10 @@ DESCRIPTION
#include <stdlib.h>
#include <assert.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qstringlist.h>
-#include <qimage.h>
+#include <tqregexp.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqimage.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
@@ -79,7 +79,7 @@ KXKBApp::KXKBApp(bool allowStyles, bool GUIenabled)
m_layoutOwnerMap = new LayoutMap(kxkbConfig);
- connect( this, SIGNAL(settingsChanged(int)), SLOT(slotSettingsChanged(int)) );
+ connect( this, TQT_SIGNAL(settingsChanged(int)), TQT_SLOT(slotSettingsChanged(int)) );
addKipcEventMask( KIPC::SettingsChanged );
}
@@ -129,7 +129,7 @@ bool KXKBApp::settingsRead()
kWinModule = NULL;
}
else {
- QDesktopWidget desktopWidget;
+ TQDesktopWidget desktopWidget;
if( desktopWidget.numScreens() > 1 && desktopWidget.isVirtualDesktop() == false ) {
kdWarning() << "With non-virtual desktop only global switching policy supported on non-primary screens" << endl;
//TODO: find out how to handle that
@@ -137,7 +137,7 @@ bool KXKBApp::settingsRead()
if( kWinModule == NULL ) {
kWinModule = new KWinModule(0, KWinModule::INFO_DESKTOP);
- connect(kWinModule, SIGNAL(activeWindowChanged(WId)), SLOT(windowChanged(WId)));
+ connect(kWinModule, TQT_SIGNAL(activeWindowChanged(WId)), TQT_SLOT(windowChanged(WId)));
}
m_prevWinId = kWinModule->activeWindow();
kdDebug() << "Active window " << m_prevWinId << endl;
@@ -158,9 +158,9 @@ bool KXKBApp::settingsRead()
m_currentLayout = kxkbConfig.getDefaultLayout();
if( kxkbConfig.m_layouts.count() == 1 ) {
- QString layoutName = m_currentLayout.layout;
- QString variantName = m_currentLayout.variant;
- QString includeName = m_currentLayout.includeGroup;
+ TQString layoutName = m_currentLayout.layout;
+ TQString variantName = m_currentLayout.variant;
+ TQString includeName = m_currentLayout.includeGroup;
int group = m_currentLayout.defaultGroup;
if( !m_extension->setLayout(kxkbConfig.m_model, layoutName, variantName, includeName, false)
@@ -196,8 +196,8 @@ void KXKBApp::initTray()
// popupMenu->insertTitle( kapp->miniIcon(), kapp->caption() );
m_tray = new KxkbLabelController(sysTray, popupMenu);
- connect(popupMenu, SIGNAL(activated(int)), this, SLOT(menuActivated(int)));
- connect(sysTray, SIGNAL(toggled()), this, SLOT(toggled()));
+ connect(popupMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuActivated(int)));
+ connect(sysTray, TQT_SIGNAL(toggled()), this, TQT_SLOT(toggled()));
}
m_tray->setShowFlag(kxkbConfig.m_showFlag);
@@ -214,7 +214,7 @@ void KXKBApp::layoutApply()
}
// kdcop
-bool KXKBApp::setLayout(const QString& layoutPair)
+bool KXKBApp::setLayout(const TQString& layoutPair)
{
const LayoutUnit layoutUnitKey(layoutPair);
if( kxkbConfig.m_layouts.contains(layoutUnitKey) ) {
@@ -347,18 +347,18 @@ This is done by loading each one of them and then dumping the compiled
map from the X server into our local buffer.*/
// void KXKBApp::initPrecompiledLayouts()
// {
-// QStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" );
-// QString tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0];
+// TQStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" );
+// TQString tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0];
//
-// QValueList<LayoutUnit>::ConstIterator end = kxkbConfig.m_layouts.end();
+// TQValueList<LayoutUnit>::ConstIterator end = kxkbConfig.m_layouts.end();
//
-// for (QValueList<LayoutUnit>::ConstIterator it = kxkbConfig.m_layouts.begin(); it != end; ++it)
+// for (TQValueList<LayoutUnit>::ConstIterator it = kxkbConfig.m_layouts.begin(); it != end; ++it)
// {
// LayoutUnit layoutUnit(*it);
// // const char* baseGr = m_includes[layout];
// // int group = m_rules->getGroup(layout, baseGr);
// // if( m_extension->setLayout(m_model, layout, m_variants[layout], group, baseGr) ) {
-// QString compiledLayoutFileName = tempDir + layoutUnit.layout + "." + layoutUnit.variant + ".xkm";
+// TQString compiledLayoutFileName = tempDir + layoutUnit.layout + "." + layoutUnit.variant + ".xkm";
// // if( m_extension->getCompiledLayout(compiledLayoutFileName) )
// m_compiledLayoutFileNames[layoutUnit.toPair()] = compiledLayoutFileName;
// // }
diff --git a/kxkb/kxkb.h b/kxkb/kxkb.h
index 914ae0f92..fc05c620a 100644
--- a/kxkb/kxkb.h
+++ b/kxkb/kxkb.h
@@ -26,10 +26,10 @@ DESCRIPTION
#define __K_XKB_H__
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qdict.h>
-#include <qptrqueue.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqdict.h>
+#include <tqptrqueue.h>
#include <kuniqueapplication.h>
@@ -60,9 +60,9 @@ public:
bool setLayout(const LayoutUnit& layoutUnit, int group=-1);
k_dcop:
- bool setLayout(const QString& layoutPair);
- QString getCurrentLayout() { return m_currentLayout.toPair(); }
- QStringList getLayoutsList() { return kxkbConfig.getLayoutStringList(); }
+ bool setLayout(const TQString& layoutPair);
+ TQString getCurrentLayout() { return m_currentLayout.toPair(); }
+ TQStringList getLayoutsList() { return kxkbConfig.getLayoutStringList(); }
void forceSetXKBMap( bool set );
protected slots:
diff --git a/kxkb/kxkbbindings.cpp b/kxkb/kxkbbindings.cpp
index d8cfc36d5..3a6137ee1 100644
--- a/kxkb/kxkbbindings.cpp
+++ b/kxkb/kxkbbindings.cpp
@@ -1,9 +1,9 @@
#ifndef NOSLOTS
# define DEF( name, key3, key4, fnSlot ) \
- keys->insert( name, i18n(name), QString::null, key3, key4, this, SLOT(fnSlot) )
+ keys->insert( name, i18n(name), TQString::null, key3, key4, this, TQT_SLOT(fnSlot) )
#else
# define DEF( name, key3, key4, fnSlot ) \
- keys->insert( name, i18n(name), QString::null, key3, key4 )
+ keys->insert( name, i18n(name), TQString::null, key3, key4 )
#endif
keys->insert( "Program:kxkb", i18n("Keyboard") );
diff --git a/kxkb/kxkbconfig.cpp b/kxkb/kxkbconfig.cpp
index 4164a06c3..0e62fbc21 100644
--- a/kxkb/kxkbconfig.cpp
+++ b/kxkb/kxkbconfig.cpp
@@ -11,9 +11,9 @@
//
#include <assert.h>
-#include <qregexp.h>
-#include <qstringlist.h>
-#include <qdict.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
+#include <tqdict.h>
#include <kconfig.h>
#include <kdebug.h>
@@ -63,12 +63,12 @@ bool KxkbConfig::load(int loadMode)
m_model = config->readEntry("Model", DEFAULT_MODEL);
kdDebug() << "Model: " << m_model << endl;
- QStringList layoutList;
+ TQStringList layoutList;
if( config->hasKey("LayoutList") ) {
layoutList = config->readListEntry("LayoutList");
}
else { // old config
- QString mainLayout = config->readEntry("Layout", DEFAULT_LAYOUT_UNIT.toPair());
+ TQString mainLayout = config->readEntry("Layout", DEFAULT_LAYOUT_UNIT.toPair());
layoutList = config->readListEntry("Additional");
layoutList.prepend(mainLayout);
}
@@ -76,16 +76,16 @@ bool KxkbConfig::load(int loadMode)
layoutList.append("us");
m_layouts.clear();
- for(QStringList::ConstIterator it = layoutList.begin(); it != layoutList.end() ; ++it) {
+ for(TQStringList::ConstIterator it = layoutList.begin(); it != layoutList.end() ; ++it) {
m_layouts.append( LayoutUnit(*it) );
kdDebug() << " layout " << LayoutUnit(*it).toPair() << " in list: " << m_layouts.contains( LayoutUnit(*it) ) << endl;
}
kdDebug() << "Found " << m_layouts.count() << " layouts, default is " << getDefaultLayout().toPair() << endl;
- QStringList displayNamesList = config->readListEntry("DisplayNames", ',');
- for(QStringList::ConstIterator it = displayNamesList.begin(); it != displayNamesList.end() ; ++it) {
- QStringList displayNamePair = QStringList::split(':', *it );
+ TQStringList displayNamesList = config->readListEntry("DisplayNames", ',');
+ for(TQStringList::ConstIterator it = displayNamesList.begin(); it != displayNamesList.end() ; ++it) {
+ TQStringList displayNamePair = TQStringList::split(':', *it );
if( displayNamePair.count() == 2 ) {
LayoutUnit layoutUnit( displayNamePair[0] );
if( m_layouts.contains( layoutUnit ) ) {
@@ -97,9 +97,9 @@ bool KxkbConfig::load(int loadMode)
// m_includes.clear();
if( X11Helper::areSingleGroupsSupported() ) {
if( config->hasKey("IncludeGroups") ) {
- QStringList includeList = config->readListEntry("IncludeGroups", ',');
- for(QStringList::ConstIterator it = includeList.begin(); it != includeList.end() ; ++it) {
- QStringList includePair = QStringList::split(':', *it );
+ TQStringList includeList = config->readListEntry("IncludeGroups", ',');
+ for(TQStringList::ConstIterator it = includeList.begin(); it != includeList.end() ; ++it) {
+ TQStringList includePair = TQStringList::split(':', *it );
if( includePair.count() == 2 ) {
LayoutUnit layoutUnit( includePair[0] );
if( m_layouts.contains( layoutUnit ) ) {
@@ -111,13 +111,13 @@ bool KxkbConfig::load(int loadMode)
}
else { //old includes format
kdDebug() << "Old includes..." << endl;
- QStringList includeList = config->readListEntry("Includes");
- for(QStringList::ConstIterator it = includeList.begin(); it != includeList.end() ; ++it) {
- QString layoutName = LayoutUnit::parseLayout( *it );
+ TQStringList includeList = config->readListEntry("Includes");
+ for(TQStringList::ConstIterator it = includeList.begin(); it != includeList.end() ; ++it) {
+ TQString layoutName = LayoutUnit::parseLayout( *it );
LayoutUnit layoutUnit( layoutName, "" );
kdDebug() << "old layout for inc: " << layoutUnit.toPair() << " included " << m_layouts.contains( layoutUnit ) << endl;
if( m_layouts.contains( layoutUnit ) ) {
- QString variantName = LayoutUnit::parseVariant(*it);
+ TQString variantName = LayoutUnit::parseVariant(*it);
m_layouts[m_layouts.findIndex(layoutUnit)].includeGroup = variantName;
kdDebug() << "Got inc group: " << layoutUnit.toPair() << ": " << variantName << endl;
}
@@ -128,7 +128,7 @@ bool KxkbConfig::load(int loadMode)
m_showSingle = config->readBoolEntry("ShowSingle", false);
m_showFlag = config->readBoolEntry("ShowFlag", true);
- QString layoutOwner = config->readEntry("SwitchMode", "Global");
+ TQString layoutOwner = config->readEntry("SwitchMode", "Global");
if( layoutOwner == "WinClass" ) {
m_switchingPolicy = SWITCH_POLICY_WIN_CLASS;
@@ -180,25 +180,25 @@ void KxkbConfig::save()
config->writeEntry("ResetOldOptions", m_resetOldOptions);
config->writeEntry("Options", m_options );
- QStringList layoutList;
- QStringList includeList;
- QStringList displayNamesList;
+ TQStringList layoutList;
+ TQStringList includeList;
+ TQStringList displayNamesList;
- QValueList<LayoutUnit>::ConstIterator it;
+ TQValueList<LayoutUnit>::ConstIterator it;
for(it = m_layouts.begin(); it != m_layouts.end(); ++it) {
const LayoutUnit& layoutUnit = *it;
layoutList.append( layoutUnit.toPair() );
if( layoutUnit.includeGroup.isEmpty() == false ) {
- QString incGroupUnit = QString("%1:%2").arg(layoutUnit.toPair(), layoutUnit.includeGroup);
+ TQString incGroupUnit = TQString("%1:%2").arg(layoutUnit.toPair(), layoutUnit.includeGroup);
includeList.append( incGroupUnit );
}
- QString displayName( layoutUnit.displayName );
+ TQString displayName( layoutUnit.displayName );
kdDebug() << " displayName " << layoutUnit.toPair() << " : " << displayName << endl;
if( displayName.isEmpty() == false && displayName != layoutUnit.layout ) {
- displayName = QString("%1:%2").arg(layoutUnit.toPair(), displayName);
+ displayName = TQString("%1:%2").arg(layoutUnit.toPair(), displayName);
displayNamesList.append( displayName );
}
}
@@ -257,10 +257,10 @@ void KxkbConfig::setDefaults()
m_stickySwitchingDepth = 2;
}
-QStringList KxkbConfig::getLayoutStringList(/*bool compact*/)
+TQStringList KxkbConfig::getLayoutStringList(/*bool compact*/)
{
- QStringList layoutList;
- for(QValueList<LayoutUnit>::ConstIterator it = m_layouts.begin(); it != m_layouts.end(); ++it) {
+ TQStringList layoutList;
+ for(TQValueList<LayoutUnit>::ConstIterator it = m_layouts.begin(); it != m_layouts.end(); ++it) {
const LayoutUnit& layoutUnit = *it;
layoutList.append( layoutUnit.toPair() );
}
@@ -268,17 +268,17 @@ QStringList KxkbConfig::getLayoutStringList(/*bool compact*/)
}
-QString KxkbConfig::getDefaultDisplayName(const QString& code_)
+TQString KxkbConfig::getDefaultDisplayName(const TQString& code_)
{
- QString displayName;
+ TQString displayName;
if( code_.length() <= 2 ) {
displayName = code_;
}
else {
- int sepPos = code_.find(QRegExp("[-_]"));
- QString leftCode = code_.mid(0, sepPos);
- QString rightCode;
+ int sepPos = code_.find(TQRegExp("[-_]"));
+ TQString leftCode = code_.mid(0, sepPos);
+ TQString rightCode;
if( sepPos != -1 )
rightCode = code_.mid(sepPos+1);
@@ -291,12 +291,12 @@ QString KxkbConfig::getDefaultDisplayName(const QString& code_)
return displayName;
}
-QString KxkbConfig::getDefaultDisplayName(const LayoutUnit& layoutUnit, bool single)
+TQString KxkbConfig::getDefaultDisplayName(const LayoutUnit& layoutUnit, bool single)
{
if( layoutUnit.variant == "" )
return getDefaultDisplayName( layoutUnit.layout );
- QString displayName = layoutUnit.layout.left(2);
+ TQString displayName = layoutUnit.layout.left(2);
if( single == false )
displayName += layoutUnit.variant.left(1);
return displayName;
@@ -307,11 +307,11 @@ QString KxkbConfig::getDefaultDisplayName(const LayoutUnit& layoutUnit, bool sin
* @param[in] layvar String in form layout(variant) to parse
* @return The layout found in the string
*/
-const QString LayoutUnit::parseLayout(const QString &layvar)
+const TQString LayoutUnit::parseLayout(const TQString &layvar)
{
static const char* LAYOUT_PATTERN = "[a-zA-Z0-9_/-]*";
- QString varLine = layvar.stripWhiteSpace();
- QRegExp rx(LAYOUT_PATTERN);
+ TQString varLine = layvar.stripWhiteSpace();
+ TQRegExp rx(LAYOUT_PATTERN);
int pos = rx.search(varLine, 0);
int len = rx.matchedLength();
// check for errors
@@ -326,11 +326,11 @@ const QString LayoutUnit::parseLayout(const QString &layvar)
* @param[in] layvar String in form layout(variant) to parse
* @return The variant found in the string, no check is performed
*/
-const QString LayoutUnit::parseVariant(const QString &layvar)
+const TQString LayoutUnit::parseVariant(const TQString &layvar)
{
static const char* VARIANT_PATTERN = "\\([a-zA-Z0-9_-]*\\)";
- QString varLine = layvar.stripWhiteSpace();
- QRegExp rx(VARIANT_PATTERN);
+ TQString varLine = layvar.stripWhiteSpace();
+ TQRegExp rx(VARIANT_PATTERN);
int pos = rx.search(varLine, 0);
int len = rx.matchedLength();
// check for errors
diff --git a/kxkb/kxkbconfig.h b/kxkb/kxkbconfig.h
index df32b026c..82fe610c9 100644
--- a/kxkb/kxkbconfig.h
+++ b/kxkb/kxkbconfig.h
@@ -12,10 +12,10 @@
#ifndef KXKBCONFIG_H
#define KXKBCONFIG_H
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qptrqueue.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqptrqueue.h>
+#include <tqmap.h>
/* Utility classes for per-window/per-application layout implementation
@@ -29,37 +29,37 @@ enum SwitchingPolicy {
-inline QString createPair(QString key, QString value)
+inline TQString createPair(TQString key, TQString value)
{
if( value.isEmpty() )
return key;
- return QString("%1(%2)").arg(key, value);
+ return TQString("%1(%2)").arg(key, value);
}
struct LayoutUnit {
- QString layout;
- QString variant;
- QString includeGroup;
- QString displayName;
+ TQString layout;
+ TQString variant;
+ TQString includeGroup;
+ TQString displayName;
int defaultGroup;
LayoutUnit() {}
- LayoutUnit(QString layout_, QString variant_):
+ LayoutUnit(TQString layout_, TQString variant_):
layout(layout_),
variant(variant_)
{}
- LayoutUnit(QString pair) {
+ LayoutUnit(TQString pair) {
setFromPair( pair );
}
- void setFromPair(const QString& pair) {
+ void setFromPair(const TQString& pair) {
layout = parseLayout(pair);
variant = parseVariant(pair);
}
- QString toPair() const {
+ TQString toPair() const {
return createPair(layout, variant);
}
@@ -78,8 +78,8 @@ struct LayoutUnit {
}
//private:
- static const QString parseLayout(const QString &layvar);
- static const QString parseVariant(const QString &layvar);
+ static const TQString parseLayout(const TQString &layvar);
+ static const TQString parseVariant(const TQString &layvar);
};
extern const LayoutUnit DEFAULT_LAYOUT_UNIT;
@@ -100,9 +100,9 @@ public:
bool m_stickySwitching;
int m_stickySwitchingDepth;
- QString m_model;
- QString m_options;
- QValueList<LayoutUnit> m_layouts;
+ TQString m_model;
+ TQString m_options;
+ TQValueList<LayoutUnit> m_layouts;
LayoutUnit getDefaultLayout();
@@ -110,12 +110,12 @@ public:
void save();
void setDefaults();
- QStringList getLayoutStringList(/*bool compact*/);
- static QString getDefaultDisplayName(const QString& code_);
- static QString getDefaultDisplayName(const LayoutUnit& layoutUnit, bool single=false);
+ TQStringList getLayoutStringList(/*bool compact*/);
+ static TQString getDefaultDisplayName(const TQString& code_);
+ static TQString getDefaultDisplayName(const LayoutUnit& layoutUnit, bool single=false);
private:
- static const QMap<QString, QString> parseIncludesMap(const QStringList& pairList);
+ static const TQMap<TQString, TQString> parseIncludesMap(const TQStringList& pairList);
};
diff --git a/kxkb/kxkbtraywindow.cpp b/kxkb/kxkbtraywindow.cpp
index 50fab7323..749ef4353 100644
--- a/kxkb/kxkbtraywindow.cpp
+++ b/kxkb/kxkbtraywindow.cpp
@@ -9,7 +9,7 @@
// Copyright: See COPYING file that comes with this distribution
//
//
-#include <qtooltip.h>
+#include <tqtooltip.h>
#include <kdebug.h>
#include <klocale.h>
@@ -25,7 +25,7 @@
#include "kxkbconfig.h"
-KxkbLabelController::KxkbLabelController(QLabel* label_, QPopupMenu* contextMenu_) :
+KxkbLabelController::KxkbLabelController(TQLabel* label_, TQPopupMenu* contextMenu_) :
label(label_),
contextMenu(contextMenu_),
m_menuStartIndex(contextMenu_->count()),
@@ -35,13 +35,13 @@ KxkbLabelController::KxkbLabelController(QLabel* label_, QPopupMenu* contextMenu
// kdDebug() << "Creating KxkbLabelController with startMenuIndex " << m_menuStartIndex << endl;
}
-void KxkbLabelController::setToolTip(const QString& tip)
+void KxkbLabelController::setToolTip(const TQString& tip)
{
- QToolTip::remove(label);
- QToolTip::add(label, tip);
+ TQToolTip::remove(label);
+ TQToolTip::add(label, tip);
}
-void KxkbLabelController::setPixmap(const QPixmap& pixmap)
+void KxkbLabelController::setPixmap(const TQPixmap& pixmap)
{
KIconEffect iconeffect;
label->setPixmap( iconeffect.apply(pixmap, KIcon::Panel, KIcon::DefaultState) );
@@ -55,19 +55,19 @@ void KxkbLabelController::setCurrentLayout(const LayoutUnit& layoutUnit)
}
-void KxkbLabelController::setError(const QString& layoutInfo)
+void KxkbLabelController::setError(const TQString& layoutInfo)
{
- QString msg = i18n("Error changing keyboard layout to '%1'").arg(layoutInfo);
+ TQString msg = i18n("Error changing keyboard layout to '%1'").arg(layoutInfo);
setToolTip(msg);
label->setPixmap(LayoutIcon::getInstance().findPixmap("error", m_showFlag));
}
-void KxkbLabelController::initLayoutList(const QValueList<LayoutUnit>& layouts, const XkbRules& rules)
+void KxkbLabelController::initLayoutList(const TQValueList<LayoutUnit>& layouts, const XkbRules& rules)
{
// KPopupMenu* menu = contextMenu();
- QPopupMenu* menu = contextMenu;
+ TQPopupMenu* menu = contextMenu;
// int index = menu->indexOf(0);
m_descriptionMap.clear();
@@ -84,16 +84,16 @@ void KxkbLabelController::initLayoutList(const QValueList<LayoutUnit>& layouts,
KIconEffect iconeffect;
int cnt = 0;
- QValueList<LayoutUnit>::ConstIterator it;
+ TQValueList<LayoutUnit>::ConstIterator it;
for (it=layouts.begin(); it != layouts.end(); ++it)
{
- const QString layoutName = (*it).layout;
- const QString variantName = (*it).variant;
+ const TQString layoutName = (*it).layout;
+ const TQString variantName = (*it).variant;
- const QPixmap& layoutPixmap = LayoutIcon::getInstance().findPixmap(layoutName, m_showFlag, (*it).displayName);
- const QPixmap pix = iconeffect.apply(layoutPixmap, KIcon::Small, KIcon::DefaultState);
+ const TQPixmap& layoutPixmap = LayoutIcon::getInstance().findPixmap(layoutName, m_showFlag, (*it).displayName);
+ const TQPixmap pix = iconeffect.apply(layoutPixmap, KIcon::Small, KIcon::DefaultState);
- QString fullName = i18n((rules.layouts()[layoutName]));
+ TQString fullName = i18n((rules.layouts()[layoutName]));
if( variantName.isEmpty() == false )
fullName += " (" + variantName + ")";
contextMenu->insertItem(pix, fullName, START_MENU_ID + cnt, m_menuStartIndex + cnt);
@@ -114,15 +114,15 @@ void KxkbLabelController::initLayoutList(const QValueList<LayoutUnit>& layouts,
/* if( index != -1 ) { //not first start
menu->insertSeparator();
- KAction* quitAction = KStdAction::quit(this, SIGNAL(quitSelected()), actionCollection());
+ KAction* quitAction = KStdAction::quit(this, TQT_SIGNAL(quitSelected()), actionCollection());
if (quitAction)
quitAction->plug(menu);
}*/
}
-// void KxkbLabelController::mouseReleaseEvent(QMouseEvent *ev)
+// void KxkbLabelController::mouseReleaseEvent(TQMouseEvent *ev)
// {
-// if (ev->button() == QMouseEvent::LeftButton)
+// if (ev->button() == TQMouseEvent::LeftButton)
// emit toggled();
// KSystemTray::mouseReleaseEvent(ev);
// }
diff --git a/kxkb/kxkbtraywindow.h b/kxkb/kxkbtraywindow.h
index 9c2c070c6..4c58c5871 100644
--- a/kxkb/kxkbtraywindow.h
+++ b/kxkb/kxkbtraywindow.h
@@ -14,8 +14,8 @@
#include <ksystemtray.h>
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
#include "kxkbconfig.h"
@@ -35,12 +35,12 @@ class KxkbLabelController: public QObject
public:
enum { START_MENU_ID = 100, CONFIG_MENU_ID = 130, HELP_MENU_ID = 131 };
- KxkbLabelController(QLabel *label, QPopupMenu* contextMenu);
+ KxkbLabelController(TQLabel *label, TQPopupMenu* contextMenu);
- void initLayoutList(const QValueList<LayoutUnit>& layouts, const XkbRules& rule);
+ void initLayoutList(const TQValueList<LayoutUnit>& layouts, const XkbRules& rule);
void setCurrentLayout(const LayoutUnit& layout);
-// void setCurrentLayout(const QString& layout, const QString &variant);
- void setError(const QString& layoutInfo="");
+// void setCurrentLayout(const TQString& layout, const TQString &variant);
+ void setError(const TQString& layoutInfo="");
void setShowFlag(bool showFlag) { m_showFlag = showFlag; }
void show() { label->show(); }
@@ -51,19 +51,19 @@ public:
// protected:
//
-// void mouseReleaseEvent(QMouseEvent *);
+// void mouseReleaseEvent(TQMouseEvent *);
private:
- QLabel* label;
- QPopupMenu* contextMenu;
+ TQLabel* label;
+ TQPopupMenu* contextMenu;
const int m_menuStartIndex;
bool m_showFlag;
int m_prevLayoutCount;
- QMap<QString, QString> m_descriptionMap;
+ TQMap<TQString, TQString> m_descriptionMap;
- void setToolTip(const QString& tip);
- void setPixmap(const QPixmap& pixmap);
+ void setToolTip(const TQString& tip);
+ void setPixmap(const TQPixmap& pixmap);
};
@@ -76,9 +76,9 @@ class KxkbSystemTray : public KSystemTray
KSystemTray(NULL)
{}
- void mouseReleaseEvent(QMouseEvent *ev)
+ void mouseReleaseEvent(TQMouseEvent *ev)
{
- if (ev->button() == QMouseEvent::LeftButton)
+ if (ev->button() == TQMouseEvent::LeftButton)
emit toggled();
KSystemTray::mouseReleaseEvent(ev);
}
diff --git a/kxkb/layoutmap.cpp b/kxkb/layoutmap.cpp
index f6273c967..9c13fc49b 100644
--- a/kxkb/layoutmap.cpp
+++ b/kxkb/layoutmap.cpp
@@ -47,14 +47,14 @@ void LayoutMap::setCurrentWindow(WId winId)
// private
//LayoutQueue&
-QPtrQueue<LayoutState>& LayoutMap::getCurrentLayoutQueueInternal(WId winId)
+TQPtrQueue<LayoutState>& LayoutMap::getCurrentLayoutQueueInternal(WId winId)
{
if( winId == X11Helper::UNKNOWN_WINDOW_ID )
return m_globalLayouts;
switch( m_kxkbConfig.m_switchingPolicy ) {
case SWITCH_POLICY_WIN_CLASS: {
-// QString winClass = X11Helper::getWindowClass(winId, qt_xdisplay());
+// TQString winClass = X11Helper::getWindowClass(winId, qt_xdisplay());
return m_appLayouts[ m_currentWinClass ];
}
case SWITCH_POLICY_WINDOW:
@@ -67,9 +67,9 @@ QPtrQueue<LayoutState>& LayoutMap::getCurrentLayoutQueueInternal(WId winId)
// private
//LayoutQueue&
-QPtrQueue<LayoutState>& LayoutMap::getCurrentLayoutQueue(WId winId)
+TQPtrQueue<LayoutState>& LayoutMap::getCurrentLayoutQueue(WId winId)
{
- QPtrQueue<LayoutState>& layoutQueue = getCurrentLayoutQueueInternal(winId);
+ TQPtrQueue<LayoutState>& layoutQueue = getCurrentLayoutQueueInternal(winId);
if( layoutQueue.count() == 0 ) {
initLayoutQueue(layoutQueue);
kdDebug() << "map: Created queue for " << winId << " size: " << layoutQueue.count() << endl;
diff --git a/kxkb/layoutmap.h b/kxkb/layoutmap.h
index 198990327..4be4cdfb2 100644
--- a/kxkb/layoutmap.h
+++ b/kxkb/layoutmap.h
@@ -15,8 +15,8 @@
#include <assert.h>
-#include <qptrqueue.h>
-#include <qmap.h>
+#include <tqptrqueue.h>
+#include <tqmap.h>
#include <kwinmodule.h>
#include <kdebug.h>
@@ -40,9 +40,9 @@ struct LayoutState {
// LayoutMap is used for per-window or per-application switching policy
class LayoutMap {
- typedef QPtrQueue<LayoutState> LayoutQueue;
- typedef QMap<WId, LayoutQueue> WinLayoutMap;
- typedef QMap<QString, LayoutQueue> WinClassLayoutMap;
+ typedef TQPtrQueue<LayoutState> LayoutQueue;
+ typedef TQMap<WId, LayoutQueue> WinLayoutMap;
+ typedef TQMap<TQString, LayoutQueue> WinClassLayoutMap;
public:
LayoutMap(const KxkbConfig& kxkbConfig);
@@ -64,7 +64,7 @@ private:
const KxkbConfig& m_kxkbConfig;
WId m_currentWinId;
- QString m_currentWinClass; // only for SWITCH_POLICY_WIN_CLASS
+ TQString m_currentWinClass; // only for SWITCH_POLICY_WIN_CLASS
void initLayoutQueue(LayoutQueue& layoutQueue);
LayoutQueue& getCurrentLayoutQueue(WId winId);
diff --git a/kxkb/pixmap.cpp b/kxkb/pixmap.cpp
index 37176b097..0ca1500e3 100644
--- a/kxkb/pixmap.cpp
+++ b/kxkb/pixmap.cpp
@@ -1,9 +1,9 @@
-#include <qimage.h>
-//#include <qbitmap.h>
-#include <qfont.h>
-#include <qpainter.h>
-#include <qregexp.h>
-#include <qdict.h>
+#include <tqimage.h>
+//#include <tqbitmap.h>
+#include <tqfont.h>
+#include <tqpainter.h>
+#include <tqregexp.h>
+#include <tqdict.h>
#include <kstandarddirs.h>
#include <klocale.h>
@@ -17,8 +17,8 @@
static const int FLAG_MAX_WIDTH = 21;
static const int FLAG_MAX_HEIGHT = 14;
-const QString LayoutIcon::flagTemplate("l10n/%1/flag.png");
-const QString& LayoutIcon::ERROR_CODE("error");
+const TQString LayoutIcon::flagTemplate("l10n/%1/flag.png");
+const TQString& LayoutIcon::ERROR_CODE("error");
LayoutIcon* LayoutIcon::instance;
@@ -34,13 +34,13 @@ LayoutIcon::LayoutIcon():
m_labelFont("sans")
{
m_labelFont.setPixelSize(10);
- m_labelFont.setWeight(QFont::Bold);
+ m_labelFont.setWeight(TQFont::Bold);
}
-const QPixmap&
-LayoutIcon::findPixmap(const QString& code_, bool showFlag, const QString& displayName_)
+const TQPixmap&
+LayoutIcon::findPixmap(const TQString& code_, bool showFlag, const TQString& displayName_)
{
- QPixmap* pm = NULL;
+ TQPixmap* pm = NULL;
if( code_ == ERROR_CODE ) {
pm = m_pixmapCache[ERROR_CODE];
@@ -51,7 +51,7 @@ LayoutIcon::findPixmap(const QString& code_, bool showFlag, const QString& displ
return *pm;
}
- QString displayName(displayName_);
+ TQString displayName(displayName_);
if( displayName.isEmpty() ) {
displayName = KxkbConfig::getDefaultDisplayName(code_);
@@ -59,38 +59,38 @@ LayoutIcon::findPixmap(const QString& code_, bool showFlag, const QString& displ
if( displayName.length() > 3 )
displayName = displayName.left(3);
- const QString pixmapKey( showFlag ? code_ + "." + displayName : displayName );
+ const TQString pixmapKey( showFlag ? code_ + "." + displayName : displayName );
pm = m_pixmapCache[pixmapKey];
if( pm )
return *pm;
- QString flag;
+ TQString flag;
if( showFlag ) {
- QString countryCode = getCountryFromLayoutName( code_ );
+ TQString countryCode = getCountryFromLayoutName( code_ );
flag = locate("locale", flagTemplate.arg(countryCode));
}
if( flag.isEmpty() ) {
- pm = new QPixmap(FLAG_MAX_WIDTH, FLAG_MAX_HEIGHT);
+ pm = new TQPixmap(FLAG_MAX_WIDTH, FLAG_MAX_HEIGHT);
pm->fill(Qt::gray);
}
else {
- pm = new QPixmap(flag);
+ pm = new TQPixmap(flag);
dimPixmap( *pm );
#if 0
if( pm->height() < FLAG_MAX_HEIGHT ) {
- QPixmap* pix = new QPixmap(FLAG_MAX_WIDTH, FLAG_MAX_HEIGHT);
+ TQPixmap* pix = new TQPixmap(FLAG_MAX_WIDTH, FLAG_MAX_HEIGHT);
pix->fill( Qt::lightGray );
-// pix->fill( QColor(qRgba(127,127,127,255)) );
-// QBitmap mask;
+// pix->fill( TQColor(qRgba(127,127,127,255)) );
+// TQBitmap mask;
// mask.fill(1);
// pix->setMask(mask);
int dy = (pix->height() - pm->height()) / 2;
copyBlt( pix, 0, dy, pm, 0, 0, -1, -1 );
-// QPixmap* px = new QPixmap(21, 14);
+// TQPixmap* px = new TQPixmap(21, 14);
// px->convertFromImage(img);*/
delete pm;
pm = pix;
@@ -98,7 +98,7 @@ LayoutIcon::findPixmap(const QString& code_, bool showFlag, const QString& displ
#endif
}
- QPainter p(pm);
+ TQPainter p(pm);
p.setFont(m_labelFont);
p.setPen(Qt::black);
@@ -114,16 +114,16 @@ LayoutIcon::findPixmap(const QString& code_, bool showFlag, const QString& displ
/**
@brief Try to get country code from layout name in xkb before xorg 6.9.0
*/
-QString LayoutIcon::getCountryFromLayoutName(const QString& layoutName)
+TQString LayoutIcon::getCountryFromLayoutName(const TQString& layoutName)
{
- QString flag;
+ TQString flag;
if( X11Helper::areLayoutsClean() ) { // >= Xorg 6.9.0
if( layoutName == "mkd" )
flag = "mk";
else
if( layoutName == "srp" ) {
- QString csFlagFile = locate("locale", flagTemplate.arg("cs"));
+ TQString csFlagFile = locate("locale", flagTemplate.arg("cs"));
flag = csFlagFile.isEmpty() ? "yu" : "cs";
}
else
@@ -183,15 +183,15 @@ QString LayoutIcon::getCountryFromLayoutName(const QString& layoutName)
|| layoutName == "tel" || layoutName == "tml" || layoutName == "ben" ) // some Indian languages
flag = "in";
else {
- int sepPos = layoutName.find(QRegExp("[-_]"));
- QString leftCode = layoutName.mid(0, sepPos);
- QString rightCode;
+ int sepPos = layoutName.find(TQRegExp("[-_]"));
+ TQString leftCode = layoutName.mid(0, sepPos);
+ TQString rightCode;
if( sepPos != -1 )
rightCode = layoutName.mid(sepPos+1);
// kdDebug() << "layout name breakup: " << leftCode << ":" << rightCode << endl;
if( rightCode.length() == 2
- && QRegExp("[A-Z][A-Z]").exactMatch(rightCode) ) {
+ && TQRegExp("[A-Z][A-Z]").exactMatch(rightCode) ) {
flag = rightCode.lower();
}
else {
@@ -204,9 +204,9 @@ QString LayoutIcon::getCountryFromLayoutName(const QString& layoutName)
}
-void LayoutIcon::dimPixmap(QPixmap& pm)
+void LayoutIcon::dimPixmap(TQPixmap& pm)
{
- QImage image = pm.convertToImage();
+ TQImage image = pm.convertToImage();
for (int y=0; y<image.height(); y++)
for(int x=0; x<image.width(); x++)
{
@@ -220,12 +220,12 @@ void LayoutIcon::dimPixmap(QPixmap& pm)
static const char* ERROR_LABEL = "err";
//private
-QPixmap* LayoutIcon::createErrorPixmap()
+TQPixmap* LayoutIcon::createErrorPixmap()
{
- QPixmap* pm = new QPixmap(21, 14);
+ TQPixmap* pm = new TQPixmap(21, 14);
pm->fill(Qt::white);
- QPainter p(pm);
+ TQPainter p(pm);
p.setFont(m_labelFont);
p.setPen(Qt::red);
diff --git a/kxkb/pixmap.h b/kxkb/pixmap.h
index 42764c04f..7070d91b2 100644
--- a/kxkb/pixmap.h
+++ b/kxkb/pixmap.h
@@ -2,30 +2,30 @@
#define __PIXMAP_H__
-#include <qpixmap.h>
-#include <qdict.h>
-#include <qstring.h>
+#include <tqpixmap.h>
+#include <tqdict.h>
+#include <tqstring.h>
class LayoutIcon {
private:
static LayoutIcon* instance;
- static const QString flagTemplate;
+ static const TQString flagTemplate;
- QDict<QPixmap> m_pixmapCache;
- QFont m_labelFont;
+ TQDict<TQPixmap> m_pixmapCache;
+ TQFont m_labelFont;
LayoutIcon();
- QPixmap* createErrorPixmap();
- void dimPixmap(QPixmap& pixmap);
- QString getCountryFromLayoutName(const QString& layoutName);
+ TQPixmap* createErrorPixmap();
+ void dimPixmap(TQPixmap& pixmap);
+ TQString getCountryFromLayoutName(const TQString& layoutName);
public:
- static const QString& ERROR_CODE;
+ static const TQString& ERROR_CODE;
static LayoutIcon& getInstance();
- const QPixmap& findPixmap(const QString& code, bool showFlag, const QString& displayName="");
+ const TQPixmap& findPixmap(const TQString& code, bool showFlag, const TQString& displayName="");
};
#endif
diff --git a/kxkb/rules.cpp b/kxkb/rules.cpp
index 85c93f72b..dbf5b823d 100644
--- a/kxkb/rules.cpp
+++ b/kxkb/rules.cpp
@@ -1,9 +1,9 @@
-#include <qwindowdefs.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qregexp.h>
-#include <qstringlist.h>
-#include <qdir.h>
+#include <tqwindowdefs.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
#include <kstandarddirs.h>
#include <kglobal.h>
@@ -26,7 +26,7 @@ XkbRules::XkbRules(bool layoutsOnly):
return;
}
- QString rulesFile = X11Helper::findXkbRulesFile(X11_DIR, qt_xdisplay());
+ TQString rulesFile = X11Helper::findXkbRulesFile(X11_DIR, qt_xdisplay());
if( rulesFile.isEmpty() ) {
kdError() << "Cannot find rules file in " << X11_DIR << endl;
@@ -40,7 +40,7 @@ XkbRules::XkbRules(bool layoutsOnly):
}
-void XkbRules::loadRules(QString file, bool layoutsOnly)
+void XkbRules::loadRules(TQString file, bool layoutsOnly)
{
RulesInfo* rules = X11Helper::loadRules(file, layoutsOnly);
@@ -79,7 +79,7 @@ void XkbRules::loadRules(QString file, bool layoutsOnly)
// }
// }
-bool XkbRules::isSingleGroup(const QString& layout)
+bool XkbRules::isSingleGroup(const TQString& layout)
{
return X11Helper::areSingleGroupsSupported()
&& !m_oldLayouts.contains(layout)
@@ -88,7 +88,7 @@ bool XkbRules::isSingleGroup(const QString& layout)
// check $oldlayouts and $nonlatin groups for XFree 4.3 and later
-void XkbRules::loadOldLayouts(QString rulesFile)
+void XkbRules::loadOldLayouts(TQString rulesFile)
{
OldLayouts* oldLayoutsStruct = X11Helper::loadOldLayouts( rulesFile );
m_oldLayouts = oldLayoutsStruct->oldLayouts;
@@ -97,13 +97,13 @@ void XkbRules::loadOldLayouts(QString rulesFile)
// for multi-group layouts in XFree 4.2 and older
// or if layout is present in $oldlayout or $nonlatin groups
-void XkbRules::loadGroups(QString file)
+void XkbRules::loadGroups(TQString file)
{
- QFile f(file);
+ TQFile f(file);
if (f.open(IO_ReadOnly))
{
- QTextStream ts(&f);
- QString locale;
+ TQTextStream ts(&f);
+ TQString locale;
unsigned int grp;
while (!ts.eof()) {
@@ -121,7 +121,7 @@ void XkbRules::loadGroups(QString file)
}
unsigned int
-XkbRules::getDefaultGroup(const QString& layout, const QString& includeGroup)
+XkbRules::getDefaultGroup(const TQString& layout, const TQString& includeGroup)
{
// check for new one-group layouts in XFree 4.3 and older
if( isSingleGroup(layout) ) {
@@ -131,23 +131,23 @@ XkbRules::getDefaultGroup(const QString& layout, const QString& includeGroup)
return 0;
}
- QMap<QString, unsigned int>::iterator it = m_initialGroups.find(layout);
+ TQMap<TQString, unsigned int>::iterator it = m_initialGroups.find(layout);
return it == m_initialGroups.end() ? 0 : it.data();
}
QStringList
-XkbRules::getAvailableVariants(const QString& layout)
+XkbRules::getAvailableVariants(const TQString& layout)
{
if( layout.isEmpty() || !layouts().find(layout) )
- return QStringList();
+ return TQStringList();
- QStringList* result1 = m_varLists[layout];
+ TQStringList* result1 = m_varLists[layout];
if( result1 )
return *result1;
bool oldLayouts = m_oldLayouts.contains(layout);
- QStringList* result = X11Helper::getVariants(layout, X11_DIR, oldLayouts);
+ TQStringList* result = X11Helper::getVariants(layout, X11_DIR, oldLayouts);
m_varLists.insert(layout, result);
diff --git a/kxkb/rules.h b/kxkb/rules.h
index d3e72b7a6..a4955317e 100644
--- a/kxkb/rules.h
+++ b/kxkb/rules.h
@@ -1,9 +1,9 @@
#ifndef __RULES_H__
#define __RULES_H__
-#include <qstring.h>
-#include <qdict.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqdict.h>
+#include <tqmap.h>
class XkbRules
@@ -12,32 +12,32 @@ public:
XkbRules(bool layoutsOnly=false);
- const QDict<char> &models() const { return m_models; };
- const QDict<char> &layouts() const { return m_layouts; };
- const QDict<char> &options() const { return m_options; };
+ const TQDict<char> &models() const { return m_models; };
+ const TQDict<char> &layouts() const { return m_layouts; };
+ const TQDict<char> &options() const { return m_options; };
- QStringList getAvailableVariants(const QString& layout);
- unsigned int getDefaultGroup(const QString& layout, const QString& includeGroup);
+ TQStringList getAvailableVariants(const TQString& layout);
+ unsigned int getDefaultGroup(const TQString& layout, const TQString& includeGroup);
- bool isSingleGroup(const QString& layout);
+ bool isSingleGroup(const TQString& layout);
protected:
- void loadRules(QString filename, bool layoutsOnly=false);
- void loadGroups(QString filename);
- void loadOldLayouts(QString filename);
+ void loadRules(TQString filename, bool layoutsOnly=false);
+ void loadGroups(TQString filename);
+ void loadOldLayouts(TQString filename);
private:
- QDict<char> m_models;
- QDict<char> m_layouts;
- QDict<char> m_options;
- QMap<QString, unsigned int> m_initialGroups;
- QDict<QStringList> m_varLists;
- QStringList m_oldLayouts;
- QStringList m_nonLatinLayouts;
+ TQDict<char> m_models;
+ TQDict<char> m_layouts;
+ TQDict<char> m_options;
+ TQMap<TQString, unsigned int> m_initialGroups;
+ TQDict<TQStringList> m_varLists;
+ TQStringList m_oldLayouts;
+ TQStringList m_nonLatinLayouts;
- QString X11_DIR; // pseudo-constant
+ TQString X11_DIR; // pseudo-constant
// void fixLayouts();
};
diff --git a/kxkb/x11helper.cpp b/kxkb/x11helper.cpp
index 7e3c83c0b..e8f13f6aa 100644
--- a/kxkb/x11helper.cpp
+++ b/kxkb/x11helper.cpp
@@ -1,10 +1,10 @@
-#include <qdir.h>
-#include <qstring.h>
-#include <qwindowdefs.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qdict.h>
-#include <qregexp.h>
+#include <tqdir.h>
+#include <tqstring.h>
+#include <tqwindowdefs.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqdict.h>
+#include <tqregexp.h>
#include <kdebug.h>
@@ -52,10 +52,10 @@ static const char* rulesFileList[] =
static const int X11_DIR_COUNT = ARRAY_SIZE(X11DirList);
static const int X11_RULES_COUNT = ARRAY_SIZE(rulesFileList);
-const QString X11Helper::X11_WIN_CLASS_ROOT = "<root>";
-const QString X11Helper::X11_WIN_CLASS_UNKNOWN = "<unknown>";
+const TQString X11Helper::X11_WIN_CLASS_ROOT = "<root>";
+const TQString X11Helper::X11_WIN_CLASS_UNKNOWN = "<unknown>";
-static const QRegExp NON_CLEAN_LAYOUT_REGEXP("[^a-z]");
+static const TQRegExp NON_CLEAN_LAYOUT_REGEXP("[^a-z]");
bool X11Helper::m_layoutsClean = true;
@@ -64,11 +64,11 @@ X11Helper::findX11Dir()
{
for(int ii=0; ii<X11_DIR_COUNT; ii++) {
const char* xDir = X11DirList[ii];
- if( xDir != NULL && QDir(QString(xDir) + "xkb").exists() ) {
+ if( xDir != NULL && TQDir(TQString(xDir) + "xkb").exists() ) {
// for(int jj=0; jj<X11_RULES_COUNT; jj++) {
//
// }
- return QString(xDir);
+ return TQString(xDir);
}
// if( X11_DIR.isEmpty() ) {
@@ -79,24 +79,24 @@ X11Helper::findX11Dir()
}
const QString
-X11Helper::findXkbRulesFile(QString x11Dir, Display *dpy)
+X11Helper::findXkbRulesFile(TQString x11Dir, Display *dpy)
{
- QString rulesFile;
+ TQString rulesFile;
XkbRF_VarDefsRec vd;
char *tmp = NULL;
if (XkbRF_GetNamesProp(dpy, &tmp, &vd) && tmp != NULL ) {
// kdDebug() << "namesprop " << tmp << endl;
- rulesFile = x11Dir + QString("xkb/rules/%1").arg(tmp);
+ rulesFile = x11Dir + TQString("xkb/rules/%1").arg(tmp);
// kdDebug() << "rulesF " << rulesFile << endl;
}
else {
// old way
for(int ii=0; ii<X11_RULES_COUNT; ii++) {
const char* ruleFile = rulesFileList[ii];
- QString xruleFilePath = x11Dir + ruleFile;
+ TQString xruleFilePath = x11Dir + ruleFile;
// kdDebug() << "trying " << xruleFilePath << endl;
- if( QFile(xruleFilePath).exists() ) {
+ if( TQFile(xruleFilePath).exists() ) {
rulesFile = xruleFilePath;
break;
}
@@ -107,9 +107,9 @@ X11Helper::findXkbRulesFile(QString x11Dir, Display *dpy)
}
RulesInfo*
-X11Helper::loadRules(const QString& file, bool layoutsOnly)
+X11Helper::loadRules(const TQString& file, bool layoutsOnly)
{
- XkbRF_RulesPtr xkbRules = XkbRF_Load(QFile::encodeName(file).data(), "", true, true);
+ XkbRF_RulesPtr xkbRules = XkbRF_Load(TQFile::encodeName(file).data(), "", true, true);
if (xkbRules == NULL) {
// throw Exception
@@ -119,7 +119,7 @@ X11Helper::loadRules(const QString& file, bool layoutsOnly)
RulesInfo* rulesInfo = new RulesInfo();
for (int i = 0; i < xkbRules->layouts.num_desc; ++i) {
- QString layoutName(xkbRules->layouts.desc[i].name);
+ TQString layoutName(xkbRules->layouts.desc[i].name);
rulesInfo->layouts.replace( layoutName, qstrdup( xkbRules->layouts.desc[i].desc ) );
if( m_layoutsClean == true
@@ -147,12 +147,12 @@ X11Helper::loadRules(const QString& file, bool layoutsOnly)
rulesInfo->options.replace("compose", "Compose Key Position");
}
- for(QDictIterator<char> it(rulesInfo->options) ; it.current() != NULL; ++it ) {
- QString option(it.currentKey());
+ for(TQDictIterator<char> it(rulesInfo->options) ; it.current() != NULL; ++it ) {
+ TQString option(it.currentKey());
int columnPos = option.find(":");
if( columnPos != -1 ) {
- QString group = option.mid(0, columnPos);
+ TQString group = option.mid(0, columnPos);
if( rulesInfo->options.find(group) == NULL ) {
rulesInfo->options.replace(group, group.latin1());
kdDebug() << "Added missing option group: " << group << endl;
@@ -170,19 +170,19 @@ X11Helper::loadRules(const QString& file, bool layoutsOnly)
// check $oldlayouts and $nonlatin groups for XFree 4.3 and later
OldLayouts*
-X11Helper::loadOldLayouts(const QString& rulesFile)
+X11Helper::loadOldLayouts(const TQString& rulesFile)
{
static const char* oldLayoutsTag = "! $oldlayouts";
static const char* nonLatinLayoutsTag = "! $nonlatin";
- QStringList m_oldLayouts;
- QStringList m_nonLatinLayouts;
+ TQStringList m_oldLayouts;
+ TQStringList m_nonLatinLayouts;
- QFile f(rulesFile);
+ TQFile f(rulesFile);
if (f.open(IO_ReadOnly))
{
- QTextStream ts(&f);
- QString line;
+ TQTextStream ts(&f);
+ TQString line;
while (!ts.eof()) {
line = ts.readLine().simplifyWhiteSpace();
@@ -195,7 +195,7 @@ X11Helper::loadOldLayouts(const QString& rulesFile)
line = line.left(line.length()-1) + ts.readLine();
line = line.simplifyWhiteSpace();
- m_oldLayouts = QStringList::split(QRegExp("\\s"), line);
+ m_oldLayouts = TQStringList::split(TQRegExp("\\s"), line);
// kdDebug() << "oldlayouts " << m_oldLayouts.join("|") << endl;
if( !m_nonLatinLayouts.empty() )
break;
@@ -210,7 +210,7 @@ X11Helper::loadOldLayouts(const QString& rulesFile)
line = line.left(line.length()-1) + ts.readLine();
line = line.simplifyWhiteSpace();
- m_nonLatinLayouts = QStringList::split(QRegExp("\\s"), line);
+ m_nonLatinLayouts = TQStringList::split(TQRegExp("\\s"), line);
// kdDebug() << "nonlatin " << m_nonLatinLayouts.join("|") << endl;
if( !m_oldLayouts.empty() )
break;
@@ -233,27 +233,27 @@ X11Helper::loadOldLayouts(const QString& rulesFile)
tries to find "xkb_symbols"
also checks whether previous line contains "hidden" to skip it
*/
-QStringList*
-X11Helper::getVariants(const QString& layout, const QString& x11Dir, bool oldLayouts)
+TQStringList*
+X11Helper::getVariants(const TQString& layout, const TQString& x11Dir, bool oldLayouts)
{
- QStringList* result = new QStringList();
+ TQStringList* result = new TQStringList();
- QString file = x11Dir + "xkb/symbols/";
+ TQString file = x11Dir + "xkb/symbols/";
// workaround for XFree 4.3 new directory for one-group layouts
- if( QDir(file+"pc").exists() && !oldLayouts )
+ if( TQDir(file+"pc").exists() && !oldLayouts )
file += "pc/";
file += layout;
// kdDebug() << "reading variants from " << file << endl;
- QFile f(file);
+ TQFile f(file);
if (f.open(IO_ReadOnly))
{
- QTextStream ts(&f);
+ TQTextStream ts(&f);
- QString line;
- QString prev_line;
+ TQString line;
+ TQString prev_line;
while (!ts.eof()) {
prev_line = line;
@@ -284,7 +284,7 @@ X11Helper::getVariants(const QString& layout, const QString& x11Dir, bool oldLay
return result;
}
-QString
+TQString
X11Helper::getWindowClass(WId winId, Display* dpy)
{
unsigned long nitems_ret, bytes_after_ret;
@@ -292,7 +292,7 @@ X11Helper::getWindowClass(WId winId, Display* dpy)
Atom type_ret;
int format_ret;
Window w = (Window)winId; // suppose WId == Window
- QString property;
+ TQString property;
if( winId == X11Helper::UNKNOWN_WINDOW_ID ) {
kdDebug() << "Got window class for " << winId << ": '" << X11_WIN_CLASS_ROOT << "'" << endl;
@@ -303,7 +303,7 @@ X11Helper::getWindowClass(WId winId, Display* dpy)
if((XGetWindowProperty(dpy, w, XA_WM_CLASS, 0L, 256L, 0, XA_STRING,
&type_ret, &format_ret, &nitems_ret,
&bytes_after_ret, &prop_ret) == Success) && (type_ret != None)) {
- property = QString::fromLocal8Bit(reinterpret_cast<char*>(prop_ret));
+ property = TQString::fromLocal8Bit(reinterpret_cast<char*>(prop_ret));
XFree(prop_ret);
}
else {
diff --git a/kxkb/x11helper.h b/kxkb/x11helper.h
index a4faba899..042fb4ce5 100644
--- a/kxkb/x11helper.h
+++ b/kxkb/x11helper.h
@@ -1,19 +1,19 @@
#ifndef X11HELPER_H_
#define X11HELPER_H_
-#include <qdict.h>
-#include <qstringlist.h>
+#include <tqdict.h>
+#include <tqstringlist.h>
struct RulesInfo {
- QDict<char> models;
- QDict<char> layouts;
- QDict<char> options;
+ TQDict<char> models;
+ TQDict<char> layouts;
+ TQDict<char> options;
};
struct OldLayouts {
- QStringList oldLayouts;
- QStringList nonLatinLayouts;
+ TQStringList oldLayouts;
+ TQStringList nonLatinLayouts;
};
class X11Helper
@@ -22,17 +22,17 @@ class X11Helper
public:
static const WId UNKNOWN_WINDOW_ID = (WId) 0;
- static const QString X11_WIN_CLASS_ROOT;
- static const QString X11_WIN_CLASS_UNKNOWN;
+ static const TQString X11_WIN_CLASS_ROOT;
+ static const TQString X11_WIN_CLASS_UNKNOWN;
/**
* Tries to find X11 xkb config dir
*/
- static const QString findX11Dir();
- static const QString findXkbRulesFile(QString x11Dir, Display* dpy);
- static QString getWindowClass(WId winId, Display* dpy);
- static QStringList* getVariants(const QString& layout, const QString& x11Dir, bool oldLayouts=false);
- static RulesInfo* loadRules(const QString& rulesFile, bool layoutsOnly=false);
- static OldLayouts* loadOldLayouts(const QString& rulesFile);
+ static const TQString findX11Dir();
+ static const TQString findXkbRulesFile(TQString x11Dir, Display* dpy);
+ static TQString getWindowClass(WId winId, Display* dpy);
+ static TQStringList* getVariants(const TQString& layout, const TQString& x11Dir, bool oldLayouts=false);
+ static RulesInfo* loadRules(const TQString& rulesFile, bool layoutsOnly=false);
+ static OldLayouts* loadOldLayouts(const TQString& rulesFile);
static bool areLayoutsClean() { return m_layoutsClean; }
static bool areSingleGroupsSupported();