summaryrefslogtreecommitdiffstats
path: root/kdecore/kaccelmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdecore/kaccelmanager.cpp')
-rw-r--r--kdecore/kaccelmanager.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/kdecore/kaccelmanager.cpp b/kdecore/kaccelmanager.cpp
index e65434c7f..1b5ea4d24 100644
--- a/kdecore/kaccelmanager.cpp
+++ b/kdecore/kaccelmanager.cpp
@@ -64,7 +64,7 @@
class KAcceleratorManagerPrivate - internal helper class
- This class does all the work to tqfind accelerators for a hierarchy of
+ This class does all the work to find accelerators for a hierarchy of
widgets.
*********************************************************************/
@@ -144,7 +144,7 @@ bool KAcceleratorManagerPrivate::standardName(const TQString &str)
{
if (!kaccmp_sns)
kaccmp_sns_d.setObject(kaccmp_sns, new TQStringList(KStdAction::internal_stdNames()));
- return kaccmp_sns->tqcontains(str);
+ return kaccmp_sns->contains(str);
}
KAcceleratorManagerPrivate::Item::~Item()
@@ -201,8 +201,8 @@ void KAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &use
contents << it->m_content;
}
- // tqfind the right accelerators
- KAccelManagerAlgorithm::tqfindAccelerators(contents, used);
+ // find the right accelerators
+ KAccelManagerAlgorithm::findAccelerators(contents, used);
// write them back into the widgets
int cnt = -1;
@@ -223,7 +223,7 @@ void KAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &use
{
if (it->m_index >= 0)
{
- TQMenuItem *mitem = menuBar->tqfindItem(menuBar->idAt(it->m_index));
+ TQMenuItem *mitem = menuBar->findItem(menuBar->idAt(it->m_index));
if (mitem)
{
checkChange(contents[cnt]);
@@ -239,12 +239,12 @@ void KAcceleratorManagerPrivate::calculateAccelerators(Item *item, TQString &use
if ( dynamic_cast<TQLabel*>( it->m_widget ) && it->m_widget->inherits("KURLLabel") )
continue;
- int tprop = it->m_widget->tqmetaObject()->tqfindProperty("text", true);
+ int tprop = it->m_widget->metaObject()->findProperty("text", true);
if (tprop != -1) {
if (checkChange(contents[cnt]))
it->m_widget->setProperty("text", contents[cnt].accelerated());
} else {
- tprop = it->m_widget->tqmetaObject()->tqfindProperty("title", true);
+ tprop = it->m_widget->metaObject()->findProperty("title", true);
if (tprop != -1 && checkChange(contents[cnt]))
it->m_widget->setProperty("title", contents[cnt].accelerated());
}
@@ -265,12 +265,12 @@ void KAcceleratorManagerPrivate::traverseChildren(TQWidget *widget, Item *item)
TQObjectList *childList = widget->queryList("TQWidget", 0, false, false);
for ( TQObject *it = childList->first(); it; it = childList->next() )
{
- TQWidget *w = static_cast<TQWidget*>(static_cast<QObject*>(it));
+ TQWidget *w = static_cast<TQWidget*>(it);
if ( !w->isVisibleTo( widget ) || ( w->isTopLevel() && dynamic_cast<TQPopupMenu*>(w) == NULL ) )
continue;
- if ( KAcceleratorManagerPrivate::ignored_widgets.tqfind( w ) != KAcceleratorManagerPrivate::ignored_widgets.end() )
+ if ( KAcceleratorManagerPrivate::ignored_widgets.find( w ) != KAcceleratorManagerPrivate::ignored_widgets.end() )
continue;
manageWidget(w, item);
@@ -340,9 +340,9 @@ void KAcceleratorManagerPrivate::manageWidget(TQWidget *w, Item *item)
{
TQString content;
TQVariant variant;
- int tprop = w->tqmetaObject()->tqfindProperty("text", true);
+ int tprop = w->metaObject()->findProperty("text", true);
if (tprop != -1) {
- const TQMetaProperty* p = w->tqmetaObject()->property( tprop, true );
+ const TQMetaProperty* p = w->metaObject()->property( tprop, true );
if ( p && p->isValid() )
w->qt_property( tprop, 1, &variant );
else
@@ -350,9 +350,9 @@ void KAcceleratorManagerPrivate::manageWidget(TQWidget *w, Item *item)
}
if (tprop == -1) {
- tprop = w->tqmetaObject()->tqfindProperty("title", true);
+ tprop = w->metaObject()->findProperty("title", true);
if (tprop != -1) {
- const TQMetaProperty* p = w->tqmetaObject()->property( tprop, true );
+ const TQMetaProperty* p = w->metaObject()->property( tprop, true );
if ( p && p->isValid() )
w->qt_property( tprop, 1, &variant );
}
@@ -409,7 +409,7 @@ void KAcceleratorManagerPrivate::manageMenuBar(TQMenuBar *mbar, Item *item)
for (uint i=0; i<mbar->count(); ++i)
{
- mitem = mbar->tqfindItem(mbar->idAt(i));
+ mitem = mbar->findItem(mbar->idAt(i));
if (!mitem)
continue;
@@ -478,18 +478,18 @@ void KAcceleratorManager::last_manage(TQString &added, TQString &changed, TQStr
KAccelString::KAccelString(const TQString &input, int initialWeight)
: m_pureText(input), m_weight()
{
- m_orig_accel = m_pureText.tqfind("(!)&");
+ m_orig_accel = m_pureText.find("(!)&");
if (m_orig_accel != -1)
m_pureText.remove(m_orig_accel, 4);
- m_orig_accel = m_pureText.tqfind("(&&)");
+ m_orig_accel = m_pureText.find("(&&)");
if (m_orig_accel != -1)
- m_pureText.tqreplace(m_orig_accel, 4, "&");
+ m_pureText.replace(m_orig_accel, 4, "&");
m_origText = m_pureText;
- if (m_pureText.tqcontains('\t'))
- m_pureText = m_pureText.left(m_pureText.tqfind('\t'));
+ if (m_pureText.contains('\t'))
+ m_pureText = m_pureText.left(m_pureText.find('\t'));
m_orig_accel = m_accel = stripAccelerator(m_pureText);
@@ -519,7 +519,7 @@ TQString KAccelString::accelerated() const
oa += 4;
}
if (m_orig_accel >= 0)
- result.tqreplace(oa, 1, "(&&)");
+ result.replace(oa, 1, "(&&)");
}
} else {
if (m_accel >= 0 && m_orig_accel != m_accel) {
@@ -598,7 +598,7 @@ int KAccelString::stripAccelerator(TQString &text)
while (p >= 0)
{
- p = text.tqfind('&', p)+1;
+ p = text.find('&', p)+1;
if (p <= 0 || p >= (int)text.length())
return -1;
@@ -626,7 +626,7 @@ int KAccelString::maxWeight(int &index, const TQString &used)
index = -1;
for (uint pos=0; pos<m_pureText.length(); ++pos)
- if (used.tqfind(m_pureText[pos], 0, FALSE) == -1 && m_pureText[pos].latin1() != 0)
+ if (used.find(m_pureText[pos], 0, FALSE) == -1 && m_pureText[pos].latin1() != 0)
if (m_weight[pos] > max)
{
max = m_weight[pos];
@@ -648,7 +648,7 @@ void KAccelString::dump()
/*********************************************************************
- tqfindAccelerators - the algorithm determining the new accelerators
+ findAccelerators - the algorithm determining the new accelerators
The algorithm is very crude:
@@ -666,7 +666,7 @@ void KAccelString::dump()
The disadvantages:
- * it does not try to tqfind as many accelerators as possible
+ * it does not try to find as many accelerators as possible
TODO:
@@ -679,9 +679,9 @@ void KAccelString::dump()
*********************************************************************/
-void KAccelManagerAlgorithm::tqfindAccelerators(KAccelStringList &result, TQString &used)
+void KAccelManagerAlgorithm::findAccelerators(KAccelStringList &result, TQString &used)
{
- kdDebug(131) << "tqfindAccelerators\n";
+ kdDebug(131) << "findAccelerators\n";
KAccelStringList accel_strings = result;
// initally remove all accelerators
@@ -694,7 +694,7 @@ void KAccelManagerAlgorithm::tqfindAccelerators(KAccelStringList &result, TQStri
{
int max = 0, index = -1, accel = -1;
- // tqfind maximum weight
+ // find maximum weight
for (uint i=0; i<accel_strings.count(); ++i)
{
int a;
@@ -747,14 +747,14 @@ void KPopupAccelManager::aboutToShow()
if (m_count != (int)m_popup->count())
{
- tqfindMenuEntries(m_entries);
+ findMenuEntries(m_entries);
calculateAccelerators();
m_count = m_popup->count();
}
else
{
KAccelStringList entries;
- tqfindMenuEntries(entries);
+ findMenuEntries(entries);
if (entries != m_entries)
{
m_entries = entries;
@@ -766,16 +766,16 @@ void KPopupAccelManager::aboutToShow()
void KPopupAccelManager::calculateAccelerators()
{
- // tqfind the new accelerators
+ // find the new accelerators
TQString used;
- KAccelManagerAlgorithm::tqfindAccelerators(m_entries, used);
+ KAccelManagerAlgorithm::findAccelerators(m_entries, used);
// change the menu entries
setMenuEntries(m_entries);
}
-void KPopupAccelManager::tqfindMenuEntries(KAccelStringList &list)
+void KPopupAccelManager::findMenuEntries(KAccelStringList &list)
{
TQMenuItem *mitem;
TQString s;
@@ -785,7 +785,7 @@ void KPopupAccelManager::tqfindMenuEntries(KAccelStringList &list)
// read out the menu entries
for (uint i=0; i<m_popup->count(); i++)
{
- mitem = m_popup->tqfindItem(m_popup->idAt(i));
+ mitem = m_popup->findItem(m_popup->idAt(i));
if (mitem->isSeparator())
continue;
@@ -793,7 +793,7 @@ void KPopupAccelManager::tqfindMenuEntries(KAccelStringList &list)
// in full menus, look at entries with global accelerators last
int weight = 50;
- if (s.tqcontains('\t'))
+ if (s.contains('\t'))
weight = 0;
list.append(KAccelString(s, weight));
@@ -812,7 +812,7 @@ void KPopupAccelManager::setMenuEntries(const KAccelStringList &list)
uint cnt = 0;
for (uint i=0; i<m_popup->count(); i++)
{
- mitem = m_popup->tqfindItem(m_popup->idAt(i));
+ mitem = m_popup->findItem(m_popup->idAt(i));
if (mitem->isSeparator())
continue;
@@ -845,8 +845,8 @@ QWidgetStackAccelManager::QWidgetStackAccelManager(TQWidgetStack *stack)
bool QWidgetStackAccelManager::eventFilter ( TQObject * watched, TQEvent * e )
{
- if ( e->type() == TQEvent::Show && tqApp->activeWindow() ) {
- KAcceleratorManager::manage( tqApp->activeWindow() );
+ if ( e->type() == TQEvent::Show && qApp->activeWindow() ) {
+ KAcceleratorManager::manage( qApp->activeWindow() );
watched->removeEventFilter( this );
}
return false;