OSDN Git Service

refactoring.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Tue, 19 Jun 2007 11:34:32 +0000 (11:34 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Tue, 19 Jun 2007 11:34:32 +0000 (11:34 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1971 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/write/previewpart.cpp
kita/src/write/previewpart.h

index 16300c3..c446e70 100644 (file)
@@ -179,11 +179,11 @@ void KitaPreviewPart::slotSetStyleSheetOfHTMLPart()
 {
     /* [0]<html> -> [1]<head> -> [2]<style> */
     DOM::HTMLCollection collection = htmlDocument().all();
-    DOM::HTMLElement elm;
+    DOM::HTMLElement element;
     unsigned int i;
     for ( i = 0 ; i < collection.length() ; i++ ) {
-        elm = collection.item( i );
-        if ( elm.tagName().upper() == "STYLE" ) {
+        element = collection.item( i );
+        if ( element.tagName().upper() == "STYLE" ) {
             QString style = QString( "body { font-size: %1pt; font-family: %2; color: %3; background-color: %4; }" )
                             .arg( Kita::Config::threadFont().pointSize() )
                             .arg( Kita::Config::threadFont().family() )
@@ -196,7 +196,7 @@ void KitaPreviewPart::slotSetStyleSheetOfHTMLPart()
                 style0 += KitaConfig::styleSheetText();
             }
 
-            elm.setInnerText( style0 );
+            element.setInnerText( style0 );
             htmlDocument().applyChanges();
             break;
         }
@@ -228,13 +228,15 @@ void KitaPreviewPart::khtmlMousePressEvent( khtml::MousePressEvent* e )
     emit mousePressed(); /* to KitaThreadView to focus this view. */
 
     KURL kurl;
-    if ( e->url().string() != QString::null )
+    if ( e->url().string() != QString::null ) {
         kurl = KURL( Kita::BoardManager::boardURL( m_datURL ), e->url().string() );
+    }
 
-    m_pushctrl = m_pushmidbt = m_pushrightbt = FALSE;
-    if ( e->qmouseEvent() ->button() & Qt::RightButton ) m_pushrightbt = TRUE;
-    if ( e->qmouseEvent() ->state() & Qt::ControlButton ) m_pushctrl = TRUE;
-    if ( e->qmouseEvent() ->button() & Qt::MidButton ) m_pushmidbt = TRUE;
+    if ( e->qmouseEvent()->button() & Qt::RightButton ) {
+        m_isPushedRightButton = TRUE;
+    } else {
+        m_isPushedRightButton = FALSE;
+    }
 
     if ( e->url() != NULL ) {
 
@@ -244,8 +246,8 @@ void KitaPreviewPart::khtmlMousePressEvent( khtml::MousePressEvent* e )
         }
 
         clickAnchor( kurl );
-        m_pushctrl = m_pushmidbt = m_pushrightbt = FALSE;
-        return ;
+        m_isPushedRightButton = FALSE;
+        return;
     }
 
     KHTMLPart::khtmlMousePressEvent( e );
@@ -275,7 +277,7 @@ void KitaPreviewPart::clickAnchor( const KURL& urlin )
 
     /*-------------------------*/
     /* start multi-popup mdde  */
-    if ( m_pushrightbt && startMultiPopup() ) return ;
+    if ( m_isPushedRightButton && startMultiPopup() ) return ;
 
     /*-------------------------------*/
     /* open Kita Navi or goto anchor */
@@ -334,7 +336,9 @@ bool KitaPreviewPart::startMultiPopup()
     if ( m_popup && m_popup->isVisible() ) {
         m_multiPopup = TRUE;
         m_popup->moveMouseAbove();
-    } else m_multiPopup = FALSE;
+    } else {
+        m_multiPopup = FALSE;
+    }
 
     return m_multiPopup;
 }
index 746ca73..6bf027c 100644 (file)
@@ -56,9 +56,7 @@ class KitaPreviewPart : public KHTMLPart
     KURL m_datURL;
 
     /* mouse event */
-    bool m_pushctrl;
-    bool m_pushmidbt;
-    bool m_pushrightbt;
+    bool m_isPushedRightButton;
 
     /* res popup */
     bool m_multiPopup;