OSDN Git Service

refactoring...
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Thu, 1 May 2003 17:15:04 +0000 (17:15 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Thu, 1 May 2003 17:15:04 +0000 (17:15 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@197 56b19765-1e22-0410-a548-a0f45d66c51a

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

index 2832d67..15f0ef6 100644 (file)
@@ -35,6 +35,7 @@ class KitaHTMLPart : public KHTMLPart
   QValueStack<QPoint> m_pointStack;
 public:
   int nextHit();
+  void resetHit() { m_nextHit = 0; }
   int hitCount() { return m_hitCount; }
   QStringList prevQuery() { return m_prevQuery; }
   QString contents() { return m_contents; }
@@ -43,7 +44,7 @@ public:
   bool gobackAnchor();
   bool gotoAnchor(const QString& name);
 
-  void setNextHit(int nextHit) { m_nextHit = nextHit; }
+//  void setNextHit(int nextHit) { m_nextHit = nextHit; }
   void setHitCount(int hitCount) { m_hitCount = hitCount; }
   void setPrevQuery(QStringList prevQuery) { m_prevQuery = prevQuery; }
   void setContents(QString contents) { m_contents = contents; }
index 87107ba..d9dec3d 100644 (file)
@@ -135,7 +135,7 @@ void KitaThreadView::slotShowThread(const Kita2ch::Board& board, const Kita2ch::
 {
   { //reset member variables associated with a thread.
     m_threadPart->setPrevQuery("");
-    m_threadPart->setNextHit(0);
+    m_threadPart->resetHit();
     m_threadPart->setHitCount(0);
     m_writeResult = "";
     m_threadData = "";
@@ -277,12 +277,7 @@ void KitaThreadView::slotThreadResult(KIO::Job* job)
     gotoAnchor( QString().setNum(m_thread.resNum() - 1) );
   }
   m_threadPart->pointStack().clear();
-#if 0
-  KHTMLView * view = m_threadPart->view();
-  m_threadPart->pointStack().push( QPoint( view->contentsX(), view->contentsY() ) );
-#else
   m_threadPart->pushCurrentPosition();
-#endif
 
   emit showThreadCompleted();
 }
@@ -395,21 +390,17 @@ void KitaThreadView::searchNext(const QStringList &query)
   if ( query.isEmpty() ) return;
   if ( ! HighLightButton->isOn() ) {
     HighLightButton->toggle();
-    m_threadPart->setNextHit(0); //A next jump-search target reset to '0'.
+    m_threadPart->resetHit(); //A next jump-search target reset to '0'.
     // Process works asynchronusly. So Firstly, we don't do jump-search as a simple solution.
     return;
   }
   if ( query != m_threadPart->prevQuery() ) {
     highLighten( true, query );
-    m_threadPart->setNextHit(0); //A next jump-search target reset to '0'.
+    m_threadPart->resetHit(); //A next jump-search target reset to '0'.
     return;
   }
 
-  gotoAnchor( QString("highlighten%1").arg(m_threadPart->nextHit())  );
-#if 0
-  m_threadPart->setNextHit(m_threadPart->nextHit() + 1);
-  if ( !( m_threadPart->nextHit() < m_threadPart->hitCount() ) ) m_threadPart->setNextHit(0);
-#endif
+  gotoAnchor( QString("highlighten%1").arg( m_threadPart->nextHit() )  );
 }
 
 void KitaThreadView::highLighten(bool yes, const QStringList &query)
@@ -433,7 +424,7 @@ void KitaThreadView::highLighten(bool yes, const QStringList &query)
     m_threadPart->setPrevQuery(query);
     slotDisplayContents( m_threadPart->contents(), m_thread.datURL() );
     DOM::NodeList nodes;
-    m_threadPart->setHitCount(0);
+    m_threadPart->resetHit();
     nodes = m_threadPart->document().getElementsByTagName("body");
     m_threadPart->highLightenNodes( nodes, query );
   }
index 51fb543..fb05692 100644 (file)
@@ -82,10 +82,7 @@ private: // Private attributes
   int m_serverTime;
   QWidget * m_parent;
   KIO::Job * m_currentJob;
-//  QString m_contents;
   int m_labelMaxLength;
-//  int m_nextHit;
-//  QValueStack<QPoint> m_pointStack;
 
   void insertSearchCombo();
   KURL filterReadCGI(const KURL&);