diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-16 02:40:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-16 02:40:35 +0000 |
commit | bab40890696ec68c337dc290880423a0602b83c7 (patch) | |
tree | 6ba03f720b1fa88235ba339e7aedb4455430357e /khtml/ecma | |
parent | f7e71d47719ab6094cf4a9fafffa5ea351973522 (diff) | |
download | tdelibs-bab40890696ec68c337dc290880423a0602b83c7.tar.gz tdelibs-bab40890696ec68c337dc290880423a0602b83c7.zip |
Finished remaining porting to new TQt API
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214736 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khtml/ecma')
-rw-r--r-- | khtml/ecma/kjs_binding.cpp | 14 | ||||
-rw-r--r-- | khtml/ecma/kjs_binding.h | 2 | ||||
-rw-r--r-- | khtml/ecma/kjs_debugwin.cpp | 46 | ||||
-rw-r--r-- | khtml/ecma/kjs_dom.cpp | 2 | ||||
-rw-r--r-- | khtml/ecma/kjs_events.cpp | 2 | ||||
-rw-r--r-- | khtml/ecma/kjs_navigator.cpp | 4 | ||||
-rw-r--r-- | khtml/ecma/kjs_window.cpp | 18 | ||||
-rw-r--r-- | khtml/ecma/xmlhttprequest.cpp | 6 |
8 files changed, 47 insertions, 47 deletions
diff --git a/khtml/ecma/kjs_binding.cpp b/khtml/ecma/kjs_binding.cpp index b67e206f0..4fa87e2ce 100644 --- a/khtml/ecma/kjs_binding.cpp +++ b/khtml/ecma/kjs_binding.cpp @@ -53,7 +53,7 @@ Value DOMObject::get(ExecState *exec, const Identifier &p) const // ### translate code into readable string ? // ### oh, and s/QString/i18n or I18N_NOOP (the code in kjs uses I18N_NOOP... but where is it translated ?) // and where does it appear to the user ? - Object err = Error::create(exec, GeneralError, TQString("DOM exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString(TQString("DOM exception %1").arg(e.code)).local8Bit()); exec->setException( err ); result = Undefined(); } @@ -72,7 +72,7 @@ void DOMObject::put(ExecState *exec, const Identifier &propertyName, tryPut(exec, propertyName, value, attr); } catch (DOM::DOMException e) { - Object err = Error::create(exec, GeneralError, TQString("DOM exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString(TQString("DOM exception %1").arg(e.code)).local8Bit()); exec->setException(err); } catch (...) { @@ -120,7 +120,7 @@ Value DOMFunction::get(ExecState *exec, const Identifier &propertyName) const return tryGet(exec, propertyName); } catch (DOM::DOMException e) { - Object err = Error::create(exec, GeneralError, TQString("DOM exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString(TQString("DOM exception %1").arg(e.code)).local8Bit()); exec->setException(err); return Undefined(); } @@ -139,25 +139,25 @@ Value DOMFunction::call(ExecState *exec, Object &thisObj, const List &args) // ### Look into setting prototypes of these & the use of instanceof so the exception // type can be determined. See what other browsers do. catch (DOM::DOMException e) { - Object err = Error::create(exec, GeneralError, TQString("DOM Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString(TQString("DOM Exception %1").arg(e.code)).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); } catch (DOM::RangeException e) { - Object err = Error::create(exec, GeneralError, TQString("DOM Range Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString(TQString("DOM Range Exception %1").arg(e.code)).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); } catch (DOM::CSSException e) { - Object err = Error::create(exec, GeneralError, TQString("CSS Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString(TQString("CSS Exception %1").arg(e.code)).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); } catch (DOM::EventException e) { - Object err = Error::create(exec, GeneralError, TQString("DOM Event Exception %1").arg(e.code).local8Bit()); + Object err = Error::create(exec, GeneralError, TQString(TQString("DOM Event Exception %1").arg(e.code)).local8Bit()); err.put(exec, "code", Number(e.code)); exec->setException(err); return Undefined(); diff --git a/khtml/ecma/kjs_binding.h b/khtml/ecma/kjs_binding.h index c55da21ce..0672cd8eb 100644 --- a/khtml/ecma/kjs_binding.h +++ b/khtml/ecma/kjs_binding.h @@ -103,7 +103,7 @@ namespace KJS { m_domObjects.insert( objectHandle, obj ); } void customizedDOMObject( DOMObject* obj ) { - m_customizedDomObjects.replace( obj, this ); + m_customizedDomObjects.tqreplace( obj, this ); } bool deleteDOMObject( void* objectHandle ) { DOMObject* obj = m_domObjects.take( objectHandle ); diff --git a/khtml/ecma/kjs_debugwin.cpp b/khtml/ecma/kjs_debugwin.cpp index 8e5cf5dae..bd290af16 100644 --- a/khtml/ecma/kjs_debugwin.cpp +++ b/khtml/ecma/kjs_debugwin.cpp @@ -80,7 +80,7 @@ SourceDisplay::SourceDisplay(KJSDebugWin *debugWin, TQWidget *parent, const char m_font(KGlobalSettings::fixedFont()) { verticalScrollBar()->setLineStep(TQFontMetrics(m_font).height()); - viewport()->setBackgroundMode(Qt::NoBackground); + viewport()->setBackgroundMode(TQt::NoBackground); m_breakpointIcon = KGlobal::iconLoader()->loadIcon("stop",KIcon::Small); } @@ -182,7 +182,7 @@ void SourceDisplay::showEvent(TQShowEvent *) void SourceDisplay::drawContents(TQPainter *p, int clipx, int clipy, int clipw, int cliph) { if (!m_sourceFile) { - p->fillRect(clipx,clipy,clipw,cliph,palette().active().base()); + p->fillRect(clipx,clipy,clipw,cliph,tqpalette().active().base()); return; } @@ -207,26 +207,26 @@ void SourceDisplay::drawContents(TQPainter *p, int clipx, int clipy, int clipw, TQString linenoStr = TQString().sprintf("%d",lineno+1); - p->fillRect(0,height*lineno,linenoWidth,height,palette().active().mid()); + p->fillRect(0,height*lineno,linenoWidth,height,tqpalette().active().mid()); - p->setPen(palette().active().text()); + p->setPen(tqpalette().active().text()); p->drawText(0,height*lineno,linenoWidth,height,Qt::AlignRight,linenoStr); TQColor bgColor; TQColor textColor; if (lineno == m_currentLine) { - bgColor = palette().active().highlight(); - textColor = palette().active().highlightedText(); + bgColor = tqpalette().active().highlight(); + textColor = tqpalette().active().highlightedText(); } else if (m_debugWin->haveBreakpoint(m_sourceFile,lineno+1,lineno+1)) { - bgColor = palette().active().text(); - textColor = palette().active().base(); + bgColor = tqpalette().active().text(); + textColor = tqpalette().active().base(); p->drawPixmap(2,height*lineno+height/2-m_breakpointIcon.height()/2,m_breakpointIcon); } else { - bgColor = palette().active().base(); - textColor = palette().active().text(); + bgColor = tqpalette().active().base(); + textColor = tqpalette().active().text(); } p->fillRect(linenoWidth,height*lineno,right-linenoWidth,height,bgColor); @@ -236,10 +236,10 @@ void SourceDisplay::drawContents(TQPainter *p, int clipx, int clipy, int clipw, } int remainingTop = height*(lastLine+1); - p->fillRect(0,remainingTop,linenoWidth,bottom-remainingTop,palette().active().mid()); + p->fillRect(0,remainingTop,linenoWidth,bottom-remainingTop,tqpalette().active().mid()); p->fillRect(linenoWidth,remainingTop, - right-linenoWidth,bottom-remainingTop,palette().active().base()); + right-linenoWidth,bottom-remainingTop,tqpalette().active().base()); } //------------------------------------------------------------------------- @@ -347,7 +347,7 @@ void EvalMultiLineEdit::keyPressEvent(TQKeyEvent * e) } //------------------------------------------------------------------------- KJSDebugWin::KJSDebugWin(TQWidget *parent, const char *name) - : KMainWindow(parent, name, WType_TopLevel), KInstance("kjs_debugger") + : KMainWindow(parent, name, (WFlags)WType_TopLevel), KInstance("kjs_debugger") { m_breakpoints = 0; m_breakpointCount = 0; @@ -445,18 +445,18 @@ KJSDebugWin::KJSDebugWin(TQWidget *parent, const char *name) // Venkman use F12, KDevelop F10 KShortcut scNext = KShortcut(KKeySequence(KKey(Qt::Key_F12))); scNext.append(KKeySequence(KKey(Qt::Key_F10))); - m_nextAction = new KAction(i18n("Next breakpoint","&Next"),"dbgnext",scNext,this,TQT_SLOT(slotNext()), + m_nextAction = new KAction(i18n("Next breakpoint","&Next"),"dbgnext",scNext,TQT_TQOBJECT(this),TQT_SLOT(slotNext()), m_actionCollection,"next"); - m_stepAction = new KAction(i18n("&Step"),"dbgstep",KShortcut(Qt::Key_F11),this,TQT_SLOT(slotStep()), + m_stepAction = new KAction(i18n("&Step"),"dbgstep",KShortcut(Qt::Key_F11),TQT_TQOBJECT(this),TQT_SLOT(slotStep()), m_actionCollection,"step"); // Venkman use F5, Kdevelop F9 KShortcut scCont = KShortcut(KKeySequence(KKey(Qt::Key_F5))); scCont.append(KKeySequence(KKey(Qt::Key_F9))); - m_continueAction = new KAction(i18n("&Continue"),"dbgrun",scCont,this,TQT_SLOT(slotContinue()), + m_continueAction = new KAction(i18n("&Continue"),"dbgrun",scCont,TQT_TQOBJECT(this),TQT_SLOT(slotContinue()), m_actionCollection,"cont"); - m_stopAction = new KAction(i18n("St&op"),"stop",KShortcut(Qt::Key_F4),this,TQT_SLOT(slotStop()), + m_stopAction = new KAction(i18n("St&op"),"stop",KShortcut(Qt::Key_F4),TQT_TQOBJECT(this),TQT_SLOT(slotStop()), m_actionCollection,"stop"); - m_breakAction = new KAction(i18n("&Break at Next Statement"),"dbgrunto",KShortcut(Qt::Key_F8),this,TQT_SLOT(slotBreakNext()), + m_breakAction = new KAction(i18n("&Break at Next Statement"),"dbgrunto",KShortcut(Qt::Key_F8),TQT_TQOBJECT(this),TQT_SLOT(slotBreakNext()), m_actionCollection,"breaknext"); @@ -677,8 +677,8 @@ bool KJSDebugWin::eventFilter(TQObject *o, TQEvent *e) case TQEvent::Close: case TQEvent::Quit: while (o->parent()) - o = o->parent(); - if (o == this) + o = TQT_TQOBJECT(o->parent()); + if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this)) return TQWidget::eventFilter(o,e); else return true; @@ -690,7 +690,7 @@ bool KJSDebugWin::eventFilter(TQObject *o, TQEvent *e) void KJSDebugWin::disableOtherWindows() { - TQWidgetList *widgets = TQApplication::allWidgets(); + TQWidgetList *widgets = TQApplication::tqallWidgets(); TQWidgetListIt it(*widgets); for (; it.current(); ++it) it.current()->installEventFilter(this); @@ -698,7 +698,7 @@ void KJSDebugWin::disableOtherWindows() void KJSDebugWin::enableOtherWindows() { - TQWidgetList *widgets = TQApplication::allWidgets(); + TQWidgetList *widgets = TQApplication::tqallWidgets(); TQWidgetListIt it(*widgets); for (; it.current(); ++it) it.current()->removeEventFilter(this); @@ -1123,7 +1123,7 @@ bool KJSDebugWin::haveBreakpoint(SourceFile *sourceFile, int line0, int line1) for (int i = 0; i < m_breakpointCount; i++) { int sourceId = m_breakpoints[i].sourceId; int lineno = m_breakpoints[i].lineno; - if (m_sourceFragments.contains(sourceId) && + if (m_sourceFragments.tqcontains(sourceId) && m_sourceFragments[sourceId]->sourceFile == sourceFile) { int absLineno = m_sourceFragments[sourceId]->baseLine+lineno-1; if (absLineno >= line0 && absLineno <= line1) diff --git a/khtml/ecma/kjs_dom.cpp b/khtml/ecma/kjs_dom.cpp index 1231c5710..cc2f3c78a 100644 --- a/khtml/ecma/kjs_dom.cpp +++ b/khtml/ecma/kjs_dom.cpp @@ -524,7 +524,7 @@ UString DOMNode::toString(ExecState *) const DOM::Element e = node; if ( !e.isNull() ) { - s = e.nodeName().string(); + s = static_cast<UString>(e.nodeName().string()); } else s = className(); // fallback diff --git a/khtml/ecma/kjs_events.cpp b/khtml/ecma/kjs_events.cpp index 38664c1b2..a0daf19c8 100644 --- a/khtml/ecma/kjs_events.cpp +++ b/khtml/ecma/kjs_events.cpp @@ -191,7 +191,7 @@ void JSLazyEventListener::parseCode() const listener = Object();// Error creating function } else { DeclaredFunctionImp *declFunc = static_cast<DeclaredFunctionImp*>(listener.imp()); - declFunc->setName(Identifier(name)); + declFunc->setName(Identifier(static_cast<UString>(name))); if (originalNode) { diff --git a/khtml/ecma/kjs_navigator.cpp b/khtml/ecma/kjs_navigator.cpp index b8712e01b..2d61bb29b 100644 --- a/khtml/ecma/kjs_navigator.cpp +++ b/khtml/ecma/kjs_navigator.cpp @@ -255,9 +255,9 @@ Value Navigator::getValueProperty(ExecState *exec, int token) const struct utsname name; int ret = uname(&name); if ( ret >= 0 ) - return String(TQString::tqfromLatin1("%1 %1 X11").arg(name.sysname).arg(name.machine)); + return String(TQString(TQString::tqfromLatin1("%1 %1 X11").arg(name.sysname).arg(name.machine))); else // can't happen - return String(TQString::tqfromLatin1("Unix X11")); + return String(TQString(TQString::tqfromLatin1("Unix X11"))); } case CpuClass: { diff --git a/khtml/ecma/kjs_window.cpp b/khtml/ecma/kjs_window.cpp index 5fe2ef33e..b57a8faae 100644 --- a/khtml/ecma/kjs_window.cpp +++ b/khtml/ecma/kjs_window.cpp @@ -1633,13 +1633,13 @@ Value Window::executeOpenWindow(ExecState *exec, const KURL& url, const TQString if (winargs.y < screen.y() || winargs.y > screen.bottom()) winargs.y = screen.y(); // only safe choice until size is determined } else if (key == "height") { - winargs.height = (int)val.toFloat() + 2*tqApp->style().tqpixelMetric( TQStyle::PM_DefaultFrameWidth ) + 2; + winargs.height = (int)val.toFloat() + 2*tqApp->tqstyle().tqpixelMetric( TQStyle::PM_DefaultFrameWidth ) + 2; if (winargs.height > screen.height()) // should actually check workspace winargs.height = screen.height(); if (winargs.height < 100) winargs.height = 100; } else if (key == "width") { - winargs.width = (int)val.toFloat() + 2*tqApp->style().tqpixelMetric( TQStyle::PM_DefaultFrameWidth ) + 2; + winargs.width = (int)val.toFloat() + 2*tqApp->tqstyle().tqpixelMetric( TQStyle::PM_DefaultFrameWidth ) + 2; if (winargs.width > screen.width()) // should actually check workspace winargs.width = screen.width(); if (winargs.width < 100) @@ -2271,7 +2271,7 @@ void WindowQObject::timerEvent(TQTimerEvent *) it = TQPtrListIterator<ScheduledAction>(toExecute); for (; it.current(); ++it) { ScheduledAction *action = it.current(); - if (!scheduledActions.containsRef(action)) // removed by clearTimeout() + if (!scheduledActions.tqcontainsRef(action)) // removed by clearTimeout() continue; action->executing = true; // prevent deletion in clearTimeout() @@ -2288,7 +2288,7 @@ void WindowQObject::timerEvent(TQTimerEvent *) action->executing = false; - if (!scheduledActions.containsRef(action)) + if (!scheduledActions.tqcontainsRef(action)) delete action; else action->nextTime = action->nextTime.addMSecs(action->interval); @@ -2305,16 +2305,16 @@ void WindowQObject::timerEvent(TQTimerEvent *) DateTimeMS DateTimeMS::addMSecs(int s) const { DateTimeMS c = *this; - c.mTime = mTime.addMSecs(s); + c.mTime = TQT_TQTIME_OBJECT(mTime.addMSecs(s)); if (s > 0) { if (c.mTime < mTime) - c.mDate = mDate.addDays(1); + c.mDate = TQT_TQDATE_OBJECT(mDate.addDays(1)); } else { if (c.mTime > mTime) - c.mDate = mDate.addDays(-1); + c.mDate = TQT_TQDATE_OBJECT(mDate.addDays(-1)); } return c; } @@ -2353,10 +2353,10 @@ DateTimeMS DateTimeMS::now() { DateTimeMS t; TQTime before = TQTime::currentTime(); - t.mDate = TQDate::tqcurrentDate(); + t.mDate = TQDate::currentDate(); t.mTime = TQTime::currentTime(); if (t.mTime < before) - t.mDate = TQDate::tqcurrentDate(); // prevent race condition in hacky way :) + t.mDate = TQDate::currentDate(); // prevent race condition in hacky way :) return t; } diff --git a/khtml/ecma/xmlhttprequest.cpp b/khtml/ecma/xmlhttprequest.cpp index a2095769f..f821d7b95 100644 --- a/khtml/ecma/xmlhttprequest.cpp +++ b/khtml/ecma/xmlhttprequest.cpp @@ -489,7 +489,7 @@ void XMLHttpRequest::setRequestHeader(const TQString& _name, const TQString &val TQStringList bannedHeaders = TQStringList::split(',', TQString::tqfromLatin1(BANNED_HTTP_HEADERS)); - if (bannedHeaders.contains(name)) + if (bannedHeaders.tqcontains(name)) return; // Denied requestHeaders[name] = value.stripWhiteSpace(); @@ -665,9 +665,9 @@ void XMLHttpRequest::slotData(KIO::Job*, const TQByteArray &_data) pos += 13; int index = responseHeaders.tqfind('\n', pos); TQString type = responseHeaders.mid(pos, (index-pos)); - index = type.find (';'); + index = type.tqfind (';'); if (index > -1) - encoding = type.mid( index+1 ).remove(TQRegExp("charset[ ]*=[ ]*", false)).stripWhiteSpace(); + encoding = TQString(type.mid( index+1 ).remove(TQRegExp("charset[ ]*=[ ]*", false))).stripWhiteSpace(); } decoder = new Decoder; |