OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 15 Jun 2003 15:29:44 +0000 (15:29 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 15 Jun 2003 15:29:44 +0000 (15:29 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@360 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/part/kitahtmlpart.cpp
kita/src/part/kitahtmlpart.h
kita/src/part/kitathreadview.cpp

index 3529b5d..ba24de3 100644 (file)
@@ -30,6 +30,15 @@ KitaHTMLPart::~KitaHTMLPart()
 {
 }
 
+void KitaHTMLPart::reset()
+{
+  m_prevQuery = "";
+  m_nextHit = 0;
+  m_hitCount = 0;
+  m_contents = "";
+  m_pointStack.clear();
+}
+
 void KitaHTMLPart::highLightenNodes( DOM::NodeList nodes, const QStringList &query )
 {
   for ( unsigned int count = 0; count < nodes.length(); ++count ) {
@@ -112,7 +121,7 @@ void KitaHTMLPart::displayContents( const QString& input, const KURL& url )
 
 void KitaHTMLPart::displayContentsAndGotoURL( const QString& input, const Kita::Thread& thread )
 {
-  setContents( input );
+  m_contents = input;
   displayContents( contents(), thread.datURL() );
 
   if ( thread.datURL().hasRef() ) {
@@ -167,7 +176,7 @@ void KitaHTMLPart::highLighten( bool yes, const QStringList &query )
   highlightCSS = highlightCSS.arg( "yellow" ).arg( "black" );
 
   if ( prevQuery() != query && !query.isEmpty() ) {
-    setPrevQuery(query);
+    m_prevQuery = query;
     displayContents( contents(), m_url );
     DOM::NodeList nodes;
     resetHit();
index 990b6f4..b387c20 100644 (file)
@@ -43,15 +43,13 @@ class KitaHTMLPart : public KHTMLPart
 public:
   int nextHit();
   void resetHit() { m_nextHit = 0; }
-  void resetHitCount() { m_hitCount = 0; }
   const QStringList prevQuery() const { return m_prevQuery; }
   void pushCurrentPosition();
-  void clearPosition() { m_pointStack.clear(); }
+  void reset();
   bool gotoAnchor( const QString& name );
+private:
 
-  void setPrevQuery( const QStringList& prevQuery ) { m_prevQuery = prevQuery; }
-  void setContents( const QString& contents ) { m_contents = contents; }
-
+public:
   KitaHTMLPart(QWidget *parent, const char *name = 0);
   ~KitaHTMLPart();
   void highLighten( bool yes, const QStringList &query );
@@ -65,6 +63,7 @@ public slots:
 private:
   const QString contents() const { return m_contents; }
   void displayContents( const QString& input, const KURL& urlOfInput = 0 );
+  void clearPosition() { m_pointStack.clear(); }
 
 signals:
   void setLocationBarURL( const QString &url );
index 18b4c0b..5d017b7 100644 (file)
@@ -131,12 +131,8 @@ void KitaThreadView::slotDOMNodeActivated(const DOM::Node &node)
 void KitaThreadView::showThread( const Kita::Thread& thread )
 {
   { //reset member variables associated with a thread.
-    m_threadPart->setPrevQuery("");
-    m_threadPart->resetHit();
-    m_threadPart->resetHitCount();
+    m_threadPart->reset();
     m_writeResult = "";
-    m_threadPart->setContents("");
-    m_threadPart->clearPosition();
   }
 
   m_thread = thread;