diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-03 20:16:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-03 20:16:47 +0000 |
commit | 495d08bc2db58ee7fc4ea55a7158f2f61b82fc56 (patch) | |
tree | daabcb652c07b9a17cad88ca50b63a2d91ead4a3 /kxkb/kxkb.cpp | |
parent | 50001f1757f97510e80cb1990e2f2d5b00144c2a (diff) | |
download | tdebase-495d08bc2db58ee7fc4ea55a7158f2f61b82fc56.tar.gz tdebase-495d08bc2db58ee7fc4ea55a7158f2f61b82fc56.zip |
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1211357 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kxkb/kxkb.cpp')
-rw-r--r-- | kxkb/kxkb.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/kxkb/kxkb.cpp b/kxkb/kxkb.cpp index 43e9f8046..576ddf4a0 100644 --- a/kxkb/kxkb.cpp +++ b/kxkb/kxkb.cpp @@ -72,12 +72,12 @@ KXKBApp::KXKBApp(bool allowStyles, bool GUIenabled) ::exit(1); } - // keep in sync with kcmlayout.cpp + // keep in sync with kcmtqlayout.cpp keys = new KGlobalAccel(this); #include "kxkbbindings.cpp" keys->updateConnections(); - m_layoutOwnerMap = new LayoutMap(kxkbConfig); + m_tqlayoutOwnerMap = new LayoutMap(kxkbConfig); connect( this, TQT_SIGNAL(settingsChanged(int)), TQT_SLOT(slotSettingsChanged(int)) ); addKipcEventMask( KIPC::SettingsChanged ); @@ -92,7 +92,7 @@ KXKBApp::~KXKBApp() delete m_tray; delete m_rules; delete m_extension; - delete m_layoutOwnerMap; + delete m_tqlayoutOwnerMap; delete kWinModule; } @@ -101,7 +101,7 @@ int KXKBApp::newInstance() m_extension->reset(); if( settingsRead() ) - layoutApply(); + tqlayoutApply(); return 0; } @@ -143,29 +143,29 @@ bool KXKBApp::settingsRead() kdDebug() << "Active window " << m_prevWinId << endl; } - m_layoutOwnerMap->reset(); - m_layoutOwnerMap->setCurrentWindow( m_prevWinId ); + m_tqlayoutOwnerMap->reset(); + m_tqlayoutOwnerMap->setCurrentWindow( m_prevWinId ); if( m_rules == NULL ) m_rules = new XkbRules(false); - for(int ii=0; ii<(int)kxkbConfig.m_layouts.count(); ii++) { - LayoutUnit& layoutUnit = kxkbConfig.m_layouts[ii]; - layoutUnit.defaultGroup = m_rules->getDefaultGroup(layoutUnit.layout, layoutUnit.includeGroup); - kdDebug() << "default group for " << layoutUnit.toPair() << " is " << layoutUnit.defaultGroup << endl; + for(int ii=0; ii<(int)kxkbConfig.m_tqlayouts.count(); ii++) { + LayoutUnit& tqlayoutUnit = kxkbConfig.m_tqlayouts[ii]; + tqlayoutUnit.defaultGroup = m_rules->getDefaultGroup(tqlayoutUnit.tqlayout, tqlayoutUnit.includeGroup); + kdDebug() << "default group for " << tqlayoutUnit.toPair() << " is " << tqlayoutUnit.defaultGroup << endl; } m_currentLayout = kxkbConfig.getDefaultLayout(); - if( kxkbConfig.m_layouts.count() == 1 ) { - TQString layoutName = m_currentLayout.layout; + if( kxkbConfig.m_tqlayouts.count() == 1 ) { + TQString tqlayoutName = m_currentLayout.tqlayout; 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) + if( !m_extension->setLayout(kxkbConfig.m_model, tqlayoutName, variantName, includeName, false) || !m_extension->setGroup( group ) ) { - kdDebug() << "Error switching to single layout " << m_currentLayout.toPair() << endl; + kdDebug() << "Error switching to single tqlayout " << m_currentLayout.toPair() << endl; // TODO: alert user } @@ -201,51 +201,51 @@ void KXKBApp::initTray() } m_tray->setShowFlag(kxkbConfig.m_showFlag); - m_tray->initLayoutList(kxkbConfig.m_layouts, *m_rules); + m_tray->initLayoutList(kxkbConfig.m_tqlayouts, *m_rules); m_tray->setCurrentLayout(m_currentLayout); m_tray->show(); } -// This function activates the keyboard layout specified by the +// This function activates the keyboard tqlayout specified by the // configuration members (m_currentLayout) -void KXKBApp::layoutApply() +void KXKBApp::tqlayoutApply() { setLayout(m_currentLayout); } // kdcop -bool KXKBApp::setLayout(const TQString& layoutPair) +bool KXKBApp::setLayout(const TQString& tqlayoutPair) { - const LayoutUnit layoutUnitKey(layoutPair); - if( kxkbConfig.m_layouts.contains(layoutUnitKey) ) { - return setLayout( *kxkbConfig.m_layouts.find(layoutUnitKey) ); + const LayoutUnit tqlayoutUnitKey(tqlayoutPair); + if( kxkbConfig.m_tqlayouts.tqcontains(tqlayoutUnitKey) ) { + return setLayout( *kxkbConfig.m_tqlayouts.find(tqlayoutUnitKey) ); } return false; } -// Activates the keyboard layout specified by 'layoutUnit' -bool KXKBApp::setLayout(const LayoutUnit& layoutUnit, int group) +// Activates the keyboard tqlayout specified by 'tqlayoutUnit' +bool KXKBApp::setLayout(const LayoutUnit& tqlayoutUnit, int group) { bool res = false; if( group == -1 ) - group = layoutUnit.defaultGroup; + group = tqlayoutUnit.defaultGroup; res = m_extension->setLayout(kxkbConfig.m_model, - layoutUnit.layout, layoutUnit.variant, - layoutUnit.includeGroup); + tqlayoutUnit.tqlayout, tqlayoutUnit.variant, + tqlayoutUnit.includeGroup); if( res ) m_extension->setGroup(group); // not checking for ret - not important if( res ) - m_currentLayout = layoutUnit; + m_currentLayout = tqlayoutUnit; if (m_tray) { if( res ) - m_tray->setCurrentLayout(layoutUnit); + m_tray->setCurrentLayout(tqlayoutUnit); else - m_tray->setError(layoutUnit.toPair()); + m_tray->setError(tqlayoutUnit.toPair()); } return res; @@ -253,23 +253,23 @@ bool KXKBApp::setLayout(const LayoutUnit& layoutUnit, int group) void KXKBApp::toggled() { - const LayoutUnit& layout = m_layoutOwnerMap->getNextLayout().layoutUnit; - setLayout(layout); + const LayoutUnit& tqlayout = m_tqlayoutOwnerMap->getNextLayout().tqlayoutUnit; + setLayout(tqlayout); } void KXKBApp::menuActivated(int id) { if( KxkbLabelController::START_MENU_ID <= id - && id < KxkbLabelController::START_MENU_ID + (int)kxkbConfig.m_layouts.count() ) + && id < KxkbLabelController::START_MENU_ID + (int)kxkbConfig.m_tqlayouts.count() ) { - const LayoutUnit& layout = kxkbConfig.m_layouts[id - KxkbLabelController::START_MENU_ID]; - m_layoutOwnerMap->setCurrentLayout( layout ); - setLayout( layout ); + const LayoutUnit& tqlayout = kxkbConfig.m_tqlayouts[id - KxkbLabelController::START_MENU_ID]; + m_tqlayoutOwnerMap->setCurrentLayout( tqlayout ); + setLayout( tqlayout ); } else if (id == KxkbLabelController::CONFIG_MENU_ID) { KProcess p; - p << "kcmshell" << "keyboard_layout"; + p << "kcmshell" << "keyboard_tqlayout"; p.start(KProcess::DontCare); } else if (id == KxkbLabelController::HELP_MENU_ID) @@ -295,25 +295,25 @@ void KXKBApp::windowChanged(WId winId) kdDebug() << "old WinId: " << m_prevWinId << ", new WinId: " << winId << endl; - if( m_prevWinId != X11Helper::UNKNOWN_WINDOW_ID ) { // saving layout/group from previous window + if( m_prevWinId != X11Helper::UNKNOWN_WINDOW_ID ) { // saving tqlayout/group from previous window // kdDebug() << "storing " << m_currentLayout.toPair() << ":" << group << " for " << m_prevWinId << endl; -// m_layoutOwnerMap->setCurrentWindow(m_prevWinId); - m_layoutOwnerMap->setCurrentLayout(m_currentLayout); - m_layoutOwnerMap->setCurrentGroup(group); +// m_tqlayoutOwnerMap->setCurrentWindow(m_prevWinId); + m_tqlayoutOwnerMap->setCurrentLayout(m_currentLayout); + m_tqlayoutOwnerMap->setCurrentGroup(group); } m_prevWinId = winId; if( winId != X11Helper::UNKNOWN_WINDOW_ID ) { - m_layoutOwnerMap->setCurrentWindow(winId); - const LayoutState& layoutState = m_layoutOwnerMap->getCurrentLayout(); + m_tqlayoutOwnerMap->setCurrentWindow(winId); + const LayoutState& tqlayoutState = m_tqlayoutOwnerMap->getCurrentLayout(); - if( layoutState.layoutUnit != m_currentLayout ) { - kdDebug() << "switching to " << layoutState.layoutUnit.toPair() << ":" << group << " for " << winId << endl; - setLayout( layoutState.layoutUnit, layoutState.group ); + if( tqlayoutState.tqlayoutUnit != m_currentLayout ) { + kdDebug() << "switching to " << tqlayoutState.tqlayoutUnit.toPair() << ":" << group << " for " << winId << endl; + setLayout( tqlayoutState.tqlayoutUnit, tqlayoutState.group ); } - else if( layoutState.group != group ) { // we need to change only the group - m_extension->setGroup(layoutState.group); + else if( tqlayoutState.group != group ) { // we need to change only the group + m_extension->setGroup(tqlayoutState.group); } } } @@ -331,18 +331,18 @@ void KXKBApp::slotSettingsChanged(int category) /* Viki (onscreen keyboard) has problems determining some modifiers states - when kxkb uses precompiled layouts instead of setxkbmap. Probably a bug - in the xkb functions used for the precompiled layouts *shrug*. + when kxkb uses precompiled tqlayouts instead of setxkbmap. Probably a bug + in the xkb functions used for the precompiled tqlayouts *shrug*. */ void KXKBApp::forceSetXKBMap( bool set ) { if( m_forceSetXKBMap == set ) return; m_forceSetXKBMap = set; - layoutApply(); + tqlayoutApply(); } -/*Precompiles the keyboard layouts for faster activation later. +/*Precompiles the keyboard tqlayouts for faster activation later. 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() @@ -350,20 +350,20 @@ map from the X server into our local buffer.*/ // TQStringList dirs = KGlobal::dirs()->findDirs ( "tmp", "" ); // TQString tempDir = dirs.count() == 0 ? "/tmp/" : dirs[0]; // -// TQValueList<LayoutUnit>::ConstIterator end = kxkbConfig.m_layouts.end(); +// TQValueList<LayoutUnit>::ConstIterator end = kxkbConfig.m_tqlayouts.end(); // -// for (TQValueList<LayoutUnit>::ConstIterator it = kxkbConfig.m_layouts.begin(); it != end; ++it) +// for (TQValueList<LayoutUnit>::ConstIterator it = kxkbConfig.m_tqlayouts.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) ) { -// TQString compiledLayoutFileName = tempDir + layoutUnit.layout + "." + layoutUnit.variant + ".xkm"; +// LayoutUnit tqlayoutUnit(*it); +// // const char* baseGr = m_includes[tqlayout]; +// // int group = m_rules->getGroup(tqlayout, baseGr); +// // if( m_extension->setLayout(m_model, tqlayout, m_variants[tqlayout], group, baseGr) ) { +// TQString compiledLayoutFileName = tempDir + tqlayoutUnit.tqlayout + "." + tqlayoutUnit.variant + ".xkm"; // // if( m_extension->getCompiledLayout(compiledLayoutFileName) ) -// m_compiledLayoutFileNames[layoutUnit.toPair()] = compiledLayoutFileName; +// m_compiledLayoutFileNames[tqlayoutUnit.toPair()] = compiledLayoutFileName; // // } // // else { -// // kdDebug() << "Error precompiling layout " << layout << endl; +// // kdDebug() << "Error precompiling tqlayout " << tqlayout << endl; // // } // } // } |