OSDN Git Service

show bookmark
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Tue, 17 Jun 2003 07:29:10 +0000 (07:29 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Tue, 17 Jun 2003 07:29:10 +0000 (07:29 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@365 56b19765-1e22-0410-a548-a0f45d66c51a

kita/ChangeLog
kita/src/kitasubjectview.cpp
kita/src/part/kitathreadview.cpp
kita/src/part/kitathreadview.h

index c59bcc5..86bca16 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-17  Hideki Ikemoto  <ikemo@users.sourceforge.jp>
+
+       * part/kitathreadview.{cpp, h}, kitasubjectview.cpp:
+       show "kokomadeyonda"(bookmark).
+
 2003-06-12  Hideki Ikemoto  <ikemo@users.sourceforge.jp>
 
        * libkita/comment.cpp:
index 04b189e..666b2c9 100644 (file)
@@ -87,7 +87,12 @@ void KitaSubjectView::loadThread(QListViewItem* item)
   QString datName = item->text(Row_DatName);
   KURL datURL = m_board.url();
   datURL.addPath("/dat/" + datName);
-  emit signalShowThread( Kita::Thread(m_board, datURL) );
+
+  Kita::Thread thread( m_board, datURL );
+  thread.setName( item->text( Row_Subject ) );
+  thread.setResNum( item->text( Row_Vested ).toInt() );
+
+  emit signalShowThread( thread );
 }
 
 void KitaSubjectView::loadBoard(const Kita::Board& board)
index de268d8..027f1a8 100644 (file)
@@ -56,6 +56,10 @@ static const char* cookie_message =
 "\n"
 "Á´ÀÕǤ¤òÉ餦¤³¤È¤ò¾µÂú¤·¤Æ½ñ¤­¹þ¤ß¤Þ¤¹¤«¡©\n";
 
+static const char* kokomade_yonda = "<p style=\"background-color: #CCCCCC; text-align: center\">"
+"¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¤³¤³¤Þ¤ÇÆɤó¤À¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡"
+"</p>";
+
 KitaThreadView::KitaThreadView(QWidget *parent, const char *name)
     : KitaThreadViewBase(parent, name)
     , m_parent( parent )
@@ -188,6 +192,7 @@ void KitaThreadView::update( const QString& result )
   int step = 0;
   int divide = total / ( 100 / 5 );
   int next = divide;
+  int prevResNum = m_thread.resNum();
   QProgressDialog * progress = new QProgressDialog( m_parent );
   progress->setTotalSteps( static_cast<int>(total * 0.7) );
   progress->setLabelText( "Parse DAT file.....");
@@ -209,6 +214,10 @@ void KitaThreadView::update( const QString& result )
     }
     text += comment.toHtml(num);
 
+    if( prevResNum == num ) {
+      text += QString::fromLocal8Bit( kokomade_yonda );
+    }
+
     if( (step+=line.length()) > next ) {
       progress->setProgress( step );
       next += divide;
@@ -221,7 +230,7 @@ void KitaThreadView::update( const QString& result )
 
   setSubjectLabel( m_thread.boardName(), m_thread.name() );
 
-  text += footer();
+  text += footer( prevResNum );
   text += "</body></html>";
 
   m_threadPart->displayContentsAndGotoURL( text, m_thread );
@@ -238,12 +247,14 @@ void KitaThreadView::update( const QString& result )
   emit showThreadCompleted( m_thread.url() );
 }
 
-const QString KitaThreadView::footer() const
+const QString KitaThreadView::footer( int prevResNum ) const
 {
   QString text;
   int target;
-  for ( target = 1; target < m_thread.resNum(); target += 100 )
+  for ( target = 1; target < m_thread.resNum(); target += 100 ) {
     text += QString(" <a href=\"#%1\">%3</a> ").arg(target).arg(target);
+  }
+  text += QString(" <a href=\"#%1\">New</a> ").arg( prevResNum + 1 );
   text += "<br/>";
 
   return text;
index 2b02d2b..749062e 100644 (file)
@@ -77,7 +77,7 @@ private: // Private attributes
   int getServerTimeFromHttpHeaders( const QString& headers );
   void setSubjectLabel( const QString& boardName, const QString& threadName );
   KitaWriteDialog* openDialog( const Kita::PostInfo& info );
-  const QString footer() const;
+  const QString footer( int ) const;
   QStringList parseSearchQuery( const QString &input ) const;
   void update( const QString& result );