/***************************************************************************
- * 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;
}
void KitaPreferences::slotApply()
{
- qDebug("activePageIndex = %d", activePageIndex() );
- switch( activePageIndex() )
- {
+ qDebug( "activePageIndex = %d", activePageIndex() );
+ switch ( activePageIndex() ) {
// TODO: refactoring.
case 0:
// face
void KitaPreferences::slotDefault()
{
- switch( activePageIndex() )
- {
+ switch ( activePageIndex() ) {
case 0:
// face
m_facePage->reset();
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 ;
"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 );
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& ) );
}
FacePrefPage::FacePrefPage( QWidget* parent )
- : FacePrefBase( parent )
+ : FacePrefBase( parent )
{
// font
connect( fontButton, SIGNAL( clicked() ), SLOT( slotFontButtonClicked() ) );
Kita::SignalCollection* signalCollection = Kita::SignalCollection::getInstance();
connect( this, SIGNAL( setFontOfHTMLPart() ),
- signalCollection, SIGNAL( setFontOfHTMLPart() ));
+ signalCollection, SIGNAL( setFontOfHTMLPart() ) );
updateButtons();
KitaConfig::setFont( font );
emit fontChanged( font );
- if( m_threadFontchanged )
- {
+ if ( m_threadFontchanged ) {
QFont threadFont = threadFontButton->font();
KitaConfig::setThreadFont( threadFont );
emit setFontOfHTMLPart(); /* to all HTMLPart */
// stylesheet
if ( KitaConfig::styleSheetText() != styleSheetText->text() ||
- KitaConfig::useStyleSheet() != useStyleSheetCheckBox->isChecked() )
- {
+ KitaConfig::useStyleSheet() != useStyleSheetCheckBox->isChecked() ) {
KitaConfig::setStyleSheetText( styleSheetText->text() );
KitaConfig::setUseStyleSheet( useStyleSheetCheckBox->isChecked() );
emit setStyleSheetOfHTMLPart();
{
// 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;
{
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();
{
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();