OSDN Git Service

reformat.
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 19 Sep 2004 16:17:43 +0000 (16:17 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sun, 19 Sep 2004 16:17:43 +0000 (16:17 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1383 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/part/kita2ch.cpp
kita/src/prefs/prefs.cpp
kita/src/prefs/prefs.h

index 4c600af..ed601a4 100644 (file)
@@ -1,12 +1,12 @@
 /***************************************************************************
- *   Copyright (C) 2003 by Hideki Ikemoto                                  *
- *   ikemo@users.sourceforge.jp                                            *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- ***************************************************************************/
+*   Copyright (C) 2003 by Hideki Ikemoto                                  *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
 
 #include "kita2ch.h"
 
 
 using namespace Kita;
 
-WriteResult::WriteResult(QString str) : m_str(str)
-{
-}
+WriteResult::WriteResult( QString str ) : m_str( str )
+{}
 
 K2chResultCode WriteResult::code() const
 {
-  QRegExp regexp("<!-- 2ch_X:(.*) -->");
-  int pos = regexp.search(m_str);
-
-  QString k2ch_X;
-  if(pos != -1) {
-    k2ch_X = regexp.cap(1);
-  } else {
-    return K2ch_Unknown;
-  }
-
-  if(k2ch_X == "true") {
-    return K2ch_True;
-  } else if(k2ch_X == "false") {
-    return K2ch_False;
-  } else if(k2ch_X == "error") {
-    return K2ch_Error;
-  } else if(k2ch_X == "check") {
-    return K2ch_Check;
-  } else if(k2ch_X == "cookie") {
-    return K2ch_Cookie;
-  } else {
-    kdWarning() << "unknown 2ch_X: " << k2ch_X << endl;
-    return K2ch_Unknown;
-  }
+    QRegExp regexp( "<!-- 2ch_X:(.*) -->" );
+    int pos = regexp.search( m_str );
+
+    QString k2ch_X;
+    if ( pos != -1 ) {
+        k2ch_X = regexp.cap( 1 );
+    } else {
+        return K2ch_Unknown;
+    }
+
+    if ( k2ch_X == "true" ) {
+        return K2ch_True;
+    } else if ( k2ch_X == "false" ) {
+        return K2ch_False;
+    } else if ( k2ch_X == "error" ) {
+        return K2ch_Error;
+    } else if ( k2ch_X == "check" ) {
+        return K2ch_Check;
+    } else if ( k2ch_X == "cookie" ) {
+        return K2ch_Cookie;
+    } else {
+        kdWarning() << "unknown 2ch_X: " << k2ch_X << endl;
+        return K2ch_Unknown;
+    }
 }
 
 QString WriteResult::message() const
 {
-  QRegExp regexp("<b>([^<]*)</b>");
-  int pos = regexp.search(m_str);
-  if(pos != -1) {
-    return regexp.cap(1);
-  } else {
-    return QString::null;
-  }
+    QRegExp regexp( "<b>([^<]*)</b>" );
+    int pos = regexp.search( m_str );
+    if ( pos != -1 ) {
+        return regexp.cap( 1 );
+    } else {
+        return QString::null;
+    }
 }
 
 QString WriteResult::title() const
 {
-  QRegExp regexp("<title>(.*)</title>");
-  int pos = regexp.search(m_str);
-  if(pos != -1) {
-    return regexp.cap(1);
-  } else {
-    return QString::null;
-  }
+    QRegExp regexp( "<title>(.*)</title>" );
+    int pos = regexp.search( m_str );
+    if ( pos != -1 ) {
+        return regexp.cap( 1 );
+    } else {
+        return QString::null;
+    }
 }
 
 bool PostInfo::check() const
 {
-  if ( host.isEmpty() || bbscgi.isEmpty()
-     || bbs.isEmpty() || key.isEmpty() )
-       return false;
+    if ( host.isEmpty() || bbscgi.isEmpty()
+            || bbs.isEmpty() || key.isEmpty() )
+        return false;
 
-  return true;
+    return true;
 }
 
 QString PostInfo::postStr()
 {
-  QCp932Codec codec;
-  int mib = codec.mibEnum();
-  QString ret;
-  (ret += "submit=") += submit;
-  (ret += "&subject=");
-  (ret += "&FROM=") += KURL::encode_string(name, mib);
-  (ret += "&mail=") += KURL::encode_string(mail, mib);
-  (ret += "&MESSAGE=") += KURL::encode_string(body, mib);
-  (ret += "&bbs=") += bbs;
-  (ret += "&key=") += key;
-  (ret += "&time=") += time;
-
-  return ret;
+    QCp932Codec codec;
+    int mib = codec.mibEnum();
+    QString ret;
+    ( ret += "submit=" ) += submit;
+    ( ret += "&subject=" );
+    ( ret += "&FROM=" ) += KURL::encode_string( name, mib );
+    ( ret += "&mail=" ) += KURL::encode_string( mail, mib );
+    ( ret += "&MESSAGE=" ) += KURL::encode_string( body, mib );
+    ( ret += "&bbs=" ) += bbs;
+    ( ret += "&key=" ) += key;
+    ( ret += "&time=" ) += time;
+
+    return ret;
 }
index 0cead7e..432c1ff 100644 (file)
@@ -76,9 +76,8 @@ KitaPreferences::KitaPreferences()
 
 void KitaPreferences::slotApply()
 {
-    qDebug("activePageIndex = %d", activePageIndex() );
-    switch( activePageIndex() )
-    {
+    qDebug( "activePageIndex = %d", activePageIndex() );
+    switch ( activePageIndex() ) {
         // TODO: refactoring.
     case 0:
         // face
@@ -109,8 +108,7 @@ void KitaPreferences::slotApply()
 
 void KitaPreferences::slotDefault()
 {
-    switch( activePageIndex() )
-    {
+    switch ( activePageIndex() ) {
     case 0:
         // face
         m_facePage->reset();
@@ -163,8 +161,7 @@ void DebugPrefPage::replace()
     QString fromURL = fromURLLine->text();
     QString toURL = toURLLine->text();
 
-    if ( toURL.find( fromURL ) == 0 )
-    {
+    if ( toURL.find( fromURL ) == 0 ) {
         QMessageBox::critical( this, i18n( "replace" ),
                                i18n( "'To' URL must not contain 'From' URL." ) );;
         return ;
@@ -175,8 +172,7 @@ void DebugPrefPage::replace()
                                      "Please create backups of '~/.kde/share/apps/kita/cache'\n"
                                      "and '~/.kde/share/apps/kita/favorites.xml' before performing.\n"
                                      "Are you ready?" ), QMessageBox::Ok,
-                               QMessageBox::Cancel | QMessageBox::Default | QMessageBox::Escape ) == QMessageBox::Ok )
-    {
+                               QMessageBox::Cancel | QMessageBox::Default | QMessageBox::Escape ) == QMessageBox::Ok ) {
         FavoriteThreads::replace( fromURL, toURL );
         Kita::Thread::replace( fromURL, toURL );
         KitaThreadInfo::replace( fromURL, toURL );
@@ -229,7 +225,7 @@ UIPrefPage::UIPrefPage( QWidget* parent )
     connect( showNumSpin, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
 #define NCC(ctl, signal) \
     connect( ctl, SIGNAL( signal ), SIGNAL( changed() ) )
-//    NCC( extPartGroup, toggled( bool ) );
+    //    NCC( extPartGroup, toggled( bool ) );
     NCC( useExtPartCheck, toggled( bool ) );
     NCC( partMimeList, textChanged( const QString& ) );
 
@@ -264,7 +260,7 @@ void UIPrefPage::slotOpenKControl()
 }
 
 FacePrefPage::FacePrefPage( QWidget* parent )
-  : FacePrefBase( parent )
+        : FacePrefBase( parent )
 {
     // font
     connect( fontButton, SIGNAL( clicked() ), SLOT( slotFontButtonClicked() ) );
@@ -274,7 +270,7 @@ FacePrefPage::FacePrefPage( QWidget* parent )
 
     Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
     connect( this, SIGNAL( setFontOfHTMLPart() ),
-             signalCollection, SIGNAL( setFontOfHTMLPart() ));
+             signalCollection, SIGNAL( setFontOfHTMLPart() ) );
 
     updateButtons();
 
@@ -305,8 +301,7 @@ void FacePrefPage::apply()
     KitaConfig::setFont( font );
     emit fontChanged( font );
 
-    if( m_threadFontchanged )
-    {
+    if ( m_threadFontchanged ) {
         QFont threadFont = threadFontButton->font();
         KitaConfig::setThreadFont( threadFont );
         emit setFontOfHTMLPart(); /* to all HTMLPart */
@@ -319,8 +314,7 @@ void FacePrefPage::apply()
 
     // stylesheet
     if ( KitaConfig::styleSheetText() != styleSheetText->text() ||
-         KitaConfig::useStyleSheet() != useStyleSheetCheckBox->isChecked() )
-    {
+            KitaConfig::useStyleSheet() != useStyleSheetCheckBox->isChecked() ) {
         KitaConfig::setStyleSheetText( styleSheetText->text() );
         KitaConfig::setUseStyleSheet( useStyleSheetCheckBox->isChecked() );
         emit setStyleSheetOfHTMLPart();
@@ -331,11 +325,11 @@ void FacePrefPage::reset()
 {
     // font
     QFont font;
-    font  = KitaConfig::defaultFont();
+    font = KitaConfig::defaultFont();
     fontButton->setText( font.family() + " " + QString::number( font.pointSize() ) );
     fontButton->setFont( font );
 
-    font  = KitaConfig::defaultThreadFont();
+    font = KitaConfig::defaultThreadFont();
     threadFontButton->setText( font.family() + " " + QString::number( font.pointSize() ) );
     threadFontButton->setFont( font );
     m_threadFontchanged = TRUE;
@@ -364,8 +358,7 @@ void FacePrefPage::slotThreadFontButtonClicked()
 {
     QFont threadFont = threadFontButton->font();
 
-    if ( KFontDialog::getFont( threadFont, false, this ) == QDialog::Accepted )
-    {
+    if ( KFontDialog::getFont( threadFont, false, this ) == QDialog::Accepted ) {
         threadFontButton->setText( threadFont.family() + " " + QString::number( threadFont.pointSize() ) );
         threadFontButton->setFont( threadFont );
         emit changed();
@@ -377,8 +370,7 @@ void FacePrefPage::slotFontButtonClicked()
 {
     QFont font = fontButton->font();
 
-    if ( KFontDialog::getFont( font, false, this ) == QDialog::Accepted )
-    {
+    if ( KFontDialog::getFont( font, false, this ) == QDialog::Accepted ) {
         fontButton->setText( font.family() + " " + QString::number( font.pointSize() ) );
         fontButton->setFont( font );
         emit changed();
index 909df97..f2bd4ec 100644 (file)
@@ -93,7 +93,7 @@ namespace Kita
     public:
         UIPrefPage( QWidget* parent = 0 );
         void apply();
-       void reset();
+        void reset();
 
     private slots:
         /// open 'KDE Control Center'
@@ -114,9 +114,9 @@ namespace Kita
         void apply();
         void reset();
 
-public slots:
-    void slotFontButtonClicked();
-    void slotThreadFontButtonClicked();
+    public slots:
+        void slotFontButtonClicked();
+        void slotThreadFontButtonClicked();
 
     private:
         void updateButtons();
@@ -126,7 +126,7 @@ public slots:
         void setFontOfHTMLPart();
         void changed();
         void setStyleSheetOfHTMLPart();
-   };
+    };
 }
 
 #endif // _KITAPREF_H_