OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 5 Dec 2003 18:31:53 +0000 (18:31 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Fri, 5 Dec 2003 18:31:53 +0000 (18:31 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@604 56b19765-1e22-0410-a548-a0f45d66c51a

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

index 9659967..c6af2c6 100644 (file)
@@ -398,8 +398,7 @@ void KitaThreadView::slotOnURL(const QString& url)
       delete m_popup;
     }
 
-    m_popup = new QFrame( view, "res_popup", WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WType_TopLevel );
-    m_browser = new Kita::PopupTextBrowser( m_popup );
+    m_popup = new Kita::ResPopup( view );
     connect( m_threadPart->view(), SIGNAL( leave() ), SLOT( hidePopup() ) );
 
     int refNum = 0;
@@ -415,8 +414,7 @@ void KitaThreadView::slotOnURL(const QString& url)
       DOM::HTMLDListElement comment_dl = static_cast<DOM::HTMLDListElement>(comments.item( refNum - 1 ));
       QString innerHTML = comment_dl.innerHTML().string();
 
-      m_browser->setText( innerHTML );
-      m_browser->resize( m_browser->contentsWidth() + 10, m_browser->contentsHeight() );
+      m_popup->setText( innerHTML );
       m_popup->adjustSize();
 
       QPoint pos = QCursor::pos();
@@ -517,7 +515,8 @@ void KitaThreadView::killJob()
   }
 }
 
-namespace Kita {
+namespace Kita
+{
 
 PopupTextBrowser::PopupTextBrowser( QFrame* frame )
  : QTextBrowser( frame )
@@ -532,5 +531,26 @@ PopupTextBrowser::~ PopupTextBrowser()
 {
 }
 
+ResPopup::ResPopup( KHTMLView* view )
+  : QFrame( view, "res_popup", WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WType_TopLevel )
+{
+  m_browser = new Kita::PopupTextBrowser( this );
+}
+
+ResPopup::~ ResPopup()
+{
+}
+
+void ResPopup::setText( QString& str )
+{
+  m_browser->setText( str );
+}
+
+void ResPopup::adjustSize()
+{
+  m_browser->resize( m_browser->contentsWidth() + 10, m_browser->contentsHeight() );
+  QFrame::adjustSize();
+}
+
 };
 // vim:sw=2:
index aff6667..9119679 100644 (file)
@@ -31,6 +31,7 @@ template<class T> class QValueStack;
 namespace Kita {
   class ThreadAccess;
   class PopupTextBrowser;
+  class ResPopup;
 };
 
 namespace KIO {
@@ -70,8 +71,7 @@ private: // Private attributes
   int m_serverTime;
   QWidget * m_parent;
   Kita::PostInfo m_postInfo;
-  QFrame* m_popup;
-  Kita::PopupTextBrowser* m_browser;
+  Kita::ResPopup* m_popup;
 
   void insertSearchCombo();
   KURL filterReadCGI( const KURL& );
@@ -117,6 +117,16 @@ namespace Kita {
     PopupTextBrowser( QFrame* frame );
     ~PopupTextBrowser();
   };
+
+  class ResPopup : public QFrame
+  {
+  public:
+    Kita::PopupTextBrowser* m_browser;
+    ResPopup( KHTMLView* view );
+    ~ResPopup();
+    void setText( QString& str );
+    void adjustSize();
+  };
 }
 
 #endif