m_showAA( KitaConfig::defaultShowAA() ),
m_showNum( KitaConfig::defaultShowNum() ),
m_usePart( KitaConfig::defaultUsePart() ),
- m_useImageViewer( KitaConfig::defaultUseImageViewer() ),
- m_useImagePopup( KitaConfig::defaultUseImagePopup() ),
- m_useKitaNavi( KitaConfig::defaultUseKitaNavi() ),
+ m_useImageViewer( KitaConfig::defaultUseImageViewer() ),
+ m_useImagePopup( KitaConfig::defaultUseImagePopup() ),
+ m_useKitaNavi( KitaConfig::defaultUseKitaNavi() ),
m_partMimeList( KitaConfig::defaultPartMimeList() ),
m_userID( KitaConfig::defaultUserID() ),
m_password( KitaConfig::defaultPassword() ),
config->writeEntry( "UsePart", KitaConfig::usePart() );
config->writeEntry( "UseImageViewer", KitaConfig::useImageViewer() );
config->writeEntry( "UseImagePopup", KitaConfig::useImagePopup() );
- config->writeEntry( "UseKitaNavi", KitaConfig::useKitaNavi() );
+ config->writeEntry( "UseKitaNavi", KitaConfig::useKitaNavi() );
config->writeEntry( "UseStyleSheet", KitaConfig::useStyleSheet() );
config->writeEntry( "PartMimeList", KitaConfig::partMimeList() );
{
config->setGroup( "Global" );
- if ( config->hasKey( "Font" ) )
- {
+ if ( config->hasKey( "Font" ) ) {
KitaConfig::setFont( config->readFontEntry( "Font" ) );
- }
- else {
+ } else {
KitaConfig::setFont( KitaConfig::defaultFont() );
}
- if ( config->hasKey( "ThreadFont" ) )
- {
+ if ( config->hasKey( "ThreadFont" ) ) {
KitaConfig::setThreadFont( config->readFontEntry( "ThreadFont" ) );
- }
- else {
+ } else {
KitaConfig::setThreadFont( KitaConfig::defaultThreadFont() );
}
config->setGroup( "Color" );
QColor popupColor = config->readColorEntry( "Popup" );
- if ( popupColor.isValid() )
- {
+ if ( popupColor.isValid() ) {
KitaConfig::setPopupColor( popupColor );
- }
- else
- {
+ } else {
KitaConfig::setPopupColor( KitaConfig::defaultPopupColor() );
}
QColor popupBackgroundColor = config->readColorEntry( "PopupBackground" );
- if ( popupBackgroundColor.isValid() )
- {
+ if ( popupBackgroundColor.isValid() ) {
KitaConfig::setPopupBackgroundColor( popupBackgroundColor );
- }
- else
- {
+ } else {
KitaConfig::setPopupBackgroundColor( KitaConfig::defaultPopupBackgroundColor() );
}
QString KitaConfig::encryptStr( const QString& aStr )
{
QString result;
- for (uint i = 0; i < aStr.length(); i++)
- result += (aStr[i].unicode() < 0x20) ? aStr[i] :
- QChar(0x1001F - aStr[i].unicode());
+ for ( uint i = 0; i < aStr.length(); i++ )
+ result += ( aStr[ i ].unicode() < 0x20 ) ? aStr[ i ] :
+ QChar( 0x1001F - aStr[ i ].unicode() );
return result;
}
QString KitaConfig::defaultStyleSheetText()
{
return QString(
- "body,\n"
- "body.pop {\n"
- "}\n"
- "table.res_title,\n"
- "table.pop_res_title {\n"
- " white-space: nowrap;\n"
- "}\n"
- "td.res_title_number,\n"
- "td.pop_res_title_number {\n"
- "}\n"
- "td.res_title_name,\n"
- "td.pop_res_title_name {\n"
- "}\n"
- "td.res_title_date,\n"
- "td.pop_res_title_date {\n"
- "}\n"
- "td.res_title_id,\n"
- "td.pop_res_title_id {\n"
- "}\n"
- "div.res_body,\n"
- "div.pop_res_body {\n"
- " margin-left: 3.5em;\n"
- "}\n"
- "div.res_block,\n"
- "div.pop_res_block {\n"
- " padding-bottom: 1.8em;\n"
- "}\n"
- "div.kokoyon {\n"
- " background-color: #CCCCCC;\n"
- " text-align: center;\n"
- "}\n"
- "\n"
- );
+ "body,\n"
+ "body.pop {\n"
+ "}\n"
+ "table.res_title,\n"
+ "table.pop_res_title {\n"
+ " white-space: nowrap;\n"
+ "}\n"
+ "td.res_title_number,\n"
+ "td.pop_res_title_number {\n"
+ "}\n"
+ "td.res_title_name,\n"
+ "td.pop_res_title_name {\n"
+ "}\n"
+ "td.res_title_date,\n"
+ "td.pop_res_title_date {\n"
+ "}\n"
+ "td.res_title_id,\n"
+ "td.pop_res_title_id {\n"
+ "}\n"
+ "div.res_body,\n"
+ "div.pop_res_body {\n"
+ " margin-left: 3.5em;\n"
+ "}\n"
+ "div.res_block,\n"
+ "div.pop_res_block {\n"
+ " padding-bottom: 1.8em;\n"
+ "}\n"
+ "div.kokoyon {\n"
+ " background-color: #CCCCCC;\n"
+ " text-align: center;\n"
+ "}\n"
+ "\n"
+ );
}
QStringList KitaConfig::defaultPartMimeList()
QString m_userID;
QString m_password;
bool m_autoLogin;
-
+
KitaConfig();
virtual ~KitaConfig();
-
+
static QString encryptStr( const QString& str );
static QString decryptStr( const QString& str );
public:
static void writeConfig( KConfig* config );
static void readConfig( KConfig* config );
-
+
static KitaConfig* getInstance();
static QFont& font() { return getInstance() ->m_font; }
static void setFont( QFont font ) { getInstance() ->m_font = font; }
static void setAboneNameList( QStringList list ) { getInstance() ->m_aboneNameList = list; }
static QStringList defaultAboneNameList() { return QStringList(); }
- static void addAboneName( QString name ) { getInstance() ->m_aboneNameList.append( name ); }
+ static void addAboneName( QString name ) { getInstance() ->m_aboneNameList.append( name ); }
static QStringList& aboneIDList() { return getInstance() ->m_aboneIDList; }
static QStringList defaultAboneIDList() { return QStringList(); }
static void setShowNum( int num ) { getInstance() ->m_showNum = num; }
static int defaultShowNum() { return 100; }
- static bool usePart() { return getInstance()->m_usePart; }
- static void setUsePart( bool value ) { getInstance()->m_usePart = value; }
+ static bool usePart() { return getInstance() ->m_usePart; }
+ static void setUsePart( bool value ) { getInstance() ->m_usePart = value; }
static bool defaultUsePart() { return true; }
- static bool useImageViewer() { return getInstance()->m_useImageViewer; }
- static void setUseImageViewer( bool value ) { getInstance()->m_useImageViewer = value; }
+ static bool useImageViewer() { return getInstance() ->m_useImageViewer; }
+ static void setUseImageViewer( bool value ) { getInstance() ->m_useImageViewer = value; }
static bool defaultUseImageViewer() { return true; }
- static bool useImagePopup() { return getInstance()->m_useImagePopup; }
- static void setUseImagePopup( bool value ) { getInstance()->m_useImagePopup = value; }
+ static bool useImagePopup() { return getInstance() ->m_useImagePopup; }
+ static void setUseImagePopup( bool value ) { getInstance() ->m_useImagePopup = value; }
static bool defaultUseImagePopup() { return true; }
- static bool useKitaNavi() { return getInstance()->m_useKitaNavi; }
- static void setUseKitaNavi( bool value ) { getInstance()->m_useKitaNavi = value; }
+ static bool useKitaNavi() { return getInstance() ->m_useKitaNavi; }
+ static void setUseKitaNavi( bool value ) { getInstance() ->m_useKitaNavi = value; }
static bool defaultUseKitaNavi() { return true; }
-
- static QStringList& partMimeList() { return getInstance()->m_partMimeList; }
- static void setPartMimeList( const QStringList value ) { getInstance()->m_partMimeList = value; }
+
+ static QStringList& partMimeList() { return getInstance() ->m_partMimeList; }
+ static void setPartMimeList( const QStringList value ) { getInstance() ->m_partMimeList = value; }
static void setPartMimeList( const QString& value )
- { getInstance()->m_partMimeList = QStringList::split( ',', value ); }
+ { getInstance() ->m_partMimeList = QStringList::split( ',', value ); }
static QStringList defaultPartMimeList();
- static QString userID() { return getInstance()->m_userID; }
- static void setUserID( const QString id ) { getInstance()->m_userID = id; }
+ static QString userID() { return getInstance() ->m_userID; }
+ static void setUserID( const QString id ) { getInstance() ->m_userID = id; }
static QString defaultUserID() { return ""; }
- static QString password() { return getInstance()->m_password; }
- static void setPassword( const QString pass ) { getInstance()->m_password = pass; }
+ static QString password() { return getInstance() ->m_password; }
+ static void setPassword( const QString pass ) { getInstance() ->m_password = pass; }
static QString defaultPassword() { return ""; }
- static bool autoLogin() { return getInstance()->m_autoLogin; }
- static void setAutoLogin( bool value ) { getInstance()->m_autoLogin = value; }
+ static bool autoLogin() { return getInstance() ->m_autoLogin; }
+ static void setAutoLogin( bool value ) { getInstance() ->m_autoLogin = value; }
static bool defaultAutoLogin() { return false; }
};