#include <qprogressdialog.h>
#include <qmessagebox.h>
+#include "libkita/thread.h"
+
KitaHTMLPart::KitaHTMLPart(QWidget *parent, const char *name)
: KHTMLPart(parent, name), m_parent(parent)
{
if ( ! url.isEmpty() ) emit setLocationBarURL(url.url());
}
+void KitaHTMLPart::displayContentsAndGotoURL( const QString& input, const Kita::Thread& thread )
+{
+ setContents( input );
+ displayContents( contents(), thread.datURL() );
+
+ if ( thread.datURL().hasRef() ) {
+ if ( ! gotoAnchor( thread.datURL().encodedHtmlRef()) )
+ gotoAnchor( thread.datURL().htmlRef() );
+ } else {
+ gotoAnchor( QString().setNum( thread.resNum() ) );
+ }
+ clearPosition();
+ pushCurrentPosition();
+}
+
void KitaHTMLPart::pushCurrentPosition()
{
m_pointStack.push( QPoint( view()->contentsX(), view()->contentsY() ) );
#include <qvaluestack.h> // for gcc-2.9x
template<class T> class QValueStack;
+namespace Kita
+{
+ class Thread;
+}
+
/**
@author Hideki Ikemoto
*/
void highLighten(bool yes, const QStringList &query);
void highLightenNodes(DOM::NodeList nodes, const QStringList &query);
static QStringList lt_gt_spliter( const QString & input );
- void displayContents(const QString& input, const KURL& urlOfInput = 0);
+ void displayContentsAndGotoURL( const QString& input, const Kita::Thread& thread );
public slots:
bool gobackAnchor();
+private:
+ void displayContents( const QString& input, const KURL& urlOfInput = 0 );
signals:
void setLocationBarURL( const QString &url );
};
text += "</body></html>";
m_threadData.truncate(0);
- m_threadPart->setContents(text);
- m_threadPart->displayContents( m_threadPart->contents(), m_thread.datURL() );
-
- if ( m_thread.datURL().hasRef() ) {
- if ( ! m_threadPart->gotoAnchor( m_thread.datURL().encodedHtmlRef()) )
- m_threadPart->gotoAnchor( m_thread.datURL().htmlRef() );
- } else {
- m_threadPart->gotoAnchor( QString().setNum(m_thread.resNum()) );
- }
- m_threadPart->clearPosition();
- m_threadPart->pushCurrentPosition();
+ m_threadPart->displayContentsAndGotoURL( text, m_thread );
if ( HighLightButton->isOn() ) {
HighLightButton->toggle();