From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kxkb/x11helper.cpp | 86 +++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'kxkb/x11helper.cpp') 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 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -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 = ""; -const QString X11Helper::X11_WIN_CLASS_UNKNOWN = ""; +const TQString X11Helper::X11_WIN_CLASS_ROOT = ""; +const TQString X11Helper::X11_WIN_CLASS_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; iilayouts.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 it(rulesInfo->options) ; it.current() != NULL; ++it ) { - QString option(it.currentKey()); + for(TQDictIterator 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(prop_ret)); + property = TQString::fromLocal8Bit(reinterpret_cast(prop_ret)); XFree(prop_ret); } else { -- cgit v1.2.1