Ejemplo n.º 1
1
QString TextShow::quoteText(const char *t, const char *charset)
{
    if (t == NULL)
        t = "";
    QString text;
    QTextCodec *codec = NULL;
    if (charset)
        codec = QTextCodec::codecForName(charset);
    if (codec){
        text = codec->makeDecoder()->toUnicode(t, strlen(t));
    }else{
        text = QString::fromLocal8Bit(t);
    }
    return quoteString(text);
}
Ejemplo n.º 2
0
bool Pack::CheckError(QProcess &pprocess)
{
	QTextCodec *gbk = QTextCodec::codecForName("GBK");
	QString error = gbk->toUnicode(pprocess.readAllStandardError());
	if (error.toLower().contains("error:") 
		|| error.toLower().contains("exception:")
		|| error.toLower().contains(" error")
		|| error.toLower().contains(" exception")
		|| error.toLower().contains("build failed")){
		QString standardOut = gbk->toUnicode(pprocess.readAllStandardOutput());
		emit GenerateError(error.append(standardOut));
		return false;
	}
	return true;
}
Ejemplo n.º 3
0
void EvaQunMemberPicker::updateBuddyListView()
{
	//if(!mQun) return;
	lvBuddyList->clear();
	
	QTextCodec *codec = QTextCodec::codecForName("GB18030");
	std::list<std::string> names = EvaMain::user->getGroupNames();
	std::list<std::string>::iterator groupIter;
	int i=0;
	for(groupIter = names.begin(); groupIter!= names.end(); ++groupIter){
		QString g = codec->toUnicode(groupIter->c_str());
		QCheckListItem *item = new QCheckListItem(lvBuddyList, g, QCheckListItem::CheckBox);
		item->setState(QCheckListItem::Off);
		groups[i++] = item;
	}
	
	//QunInfo info = mQun->getDetails();
	
	std::map<unsigned int, QQFriend>::iterator iter;
	std::map<unsigned int, QQFriend> list = (EvaMain::user->getFriendList()).getAllFriendsMap();
	for(iter = list.begin(); iter != list.end(); ++iter){
	
		int id = iter->second.getQQ();
		QString nick = EvaTextFilter::filter(codec->toUnicode(iter->second.getNick().c_str()));
		
		int groupIndex = iter->second.getGroupIndex();
		QCheckListItem *group = groups[groupIndex];
		if(!group) continue;
		
		short faceID = (iter->second.getFace())/3 + 1;
		if(faceID<1) faceID = 1;
		QCheckListItem *item = new QCheckListItem(group, nick + "(" + QString::number(id) + ")", QCheckListItem::CheckBox);

		QPixmap *pic = EvaMain::images->getFace(faceID, true);
		if(pic) {
			QImage img(pic->convertToImage().smoothScale(16, 16));
			item->setPixmap(0, QPixmap(img));
		}else{
			fprintf(stderr, "EvaQunMemberPicker::updateBuddyListView (id:%d, faceID:%d, %s) --  NULL QPixmap pointer, ignored!\n", id, faceID, nick.ascii());
		}
		if(mQun && mQun->hasMember(id))
			item->setState(QCheckListItem::On);
		else
			item->setState(QCheckListItem::Off);
			
		buddyList[id] = item;
	}
}
Ejemplo n.º 4
0
bool KviWinampInterface::playMrl(const QString & mrl)
{
	HWND hWinamp = find_winamp(this);
	if(hWinamp)
	{
		QTextCodec * c = mediaplayer_get_codec();
		KviCString szMrl = c ? c->fromUnicode(mrl) : mrl.toUtf8();
		COPYDATASTRUCT cds;
		cds.dwData = IPC_PLAYFILE;
		cds.lpData = (void *)szMrl.ptr();
		cds.cbData = szMrl.len() + 1; // include space for null char
		SendMessage(hWinamp, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&cds);
		return true;
	}
	return false;
}
Ejemplo n.º 5
0
void HistoryFileIterator::createMessage(unsigned id, const char *type, Buffer *cfg)
{
    Message m(MessageGeneric, cfg);
    QString text = m.data.Text.str();
    if (!m_filter.isEmpty())
    {
        if (text.isEmpty())
        {
            QByteArray serverText = m.getServerText();
            if (serverText.isEmpty())
                return;
            if (m_codec == NULL)
                m_codec = getContacts()->getCodec(getContacts()->contact(m_contact));
            text = m_codec->toUnicode(serverText);
        }
        if (text.isEmpty())
            return;
        text = text.toLower();
        if (m.getFlags() & MESSAGE_RICHTEXT)
            text = text.replace(QRegExp("<[^>]+>"), " ");
        text = text.replace(QRegExp("  +"), " ");
        if (text.indexOf(m_filter) < 0)
            return;
    }
    Message *msg = ::createMessage(id, type, cfg);
    if (msg)
    {
        msg->setClient(file.m_name);
        msg->setContact(file.m_contact);
        msgs.push_back(msg);
    }
}
Ejemplo n.º 6
0
void  ExcLoadDlg::on_openlib_clicked()
{
    if( m_libpath.isEmpty() ) {
        m_libpath   = m_curpath;
    }

    QTextCodec *codec = QTextCodec::codecForLocale();

    QString name = QFileDialog::getExistingDirectory(
                       this, codec->toUnicode("打开异常对应的elf文件和库路径"), m_libpath );
    if(!name.isEmpty()) {
        m_curpath   = name;
        m_libpath   = name;
        m_ui.LibPath->setText(name);
    }
}
Ejemplo n.º 7
0
QString TagSetData::decode(const Tag &tag) const
{
    if (tag.encoded)
        return QTextCodec::codecForName(ENC_CODEC)->toUnicode(tag.value);

    if (!mTextCodec)
    {
        // Auto detect codepage ...........................
        uchardet_t uc = uchardet_new();

        for(int i=0; i<mTrackCount; ++i)
        {
            const QByteArray &performer = mTags.value(key(i, TAG_PERFORMER)).value;
            const QByteArray &title = mTags.value(key(i, TAG_TITLE)).value;

            uchardet_handle_data(uc, performer.data(), performer.length());
            uchardet_handle_data(uc, title.data(),     title.length());
        }

        uchardet_data_end(uc);
        mTextCodec = QTextCodec::codecForName(uchardet_get_charset(uc));
        if (!mTextCodec)
            mTextCodec = QTextCodec::codecForName("UTF-8");

        uchardet_delete(uc);
    }

    return mTextCodec->toUnicode(tag.value);
}
Ejemplo n.º 8
0
	QString convertToUnicode(const char * chars, int len, ConverterState * state) const override
	{
		if(g_utf8_validate(chars, len, nullptr))
			return g_pUtf8TextCodec->toUnicode(chars, len, state);

		return m_pRecvCodec->toUnicode(chars, len, state);
	}
Ejemplo n.º 9
0
bool Serializer::readWithEncoding(const QString& filename, const QString& encoding, 
								  QString &txt)
{
	QByteArray file;
	QTextCodec *codec;
	if (encoding.isEmpty())
		codec = QTextCodec::codecForLocale();
	else
		codec = QTextCodec::codecForName(encoding.toLocal8Bit());
	if (loadRawText(filename, file))
	{
		txt = codec->toUnicode( file.data() );
		return true;
	}
	return false;
}
Ejemplo n.º 10
0
/*!
    Returns the contents of the text record as a string.
*/
QString QNdefNfcTextRecord::text() const
{
    const QByteArray p = payload();

    if (p.isEmpty())
        return QString();

    quint8 status = p.at(0);

    bool utf16 = status & 0x80;
    quint8 codeLength = status & 0x3f;

    QTextCodec *codec = QTextCodec::codecForName(utf16 ? "UTF-16BE" : "UTF-8");

    return codec->toUnicode(p.constData() + 1 + codeLength, p.length() - 1 - codeLength);
}
doctorChangeDialog::doctorChangeDialog( QWidget *parent, doctor* doc )
    : doc(doc), QDialog(parent)
{
    ui.setupUi(this);

    QByteArray fio(doc->fio), dolgnost(doc->dolgnost), work(doc->priem);
    //QTextCodec *codec = QTextCodec::codecForName("Windows-1251");
    QTextCodec *codec = QTextCodec::codecForName("CP866");
    QString fioString = codec->toUnicode(fio);
    QString dolgnostString = codec->toUnicode(dolgnost);
    QString workString = codec->toUnicode(work);
    ui.fio->setText( fioString );
    ui.cabinet->setText( QString::number( doc->cabinet ) );
    ui.speciality->setText( dolgnostString );
    ui.workHours->setText( workString );
}
Ejemplo n.º 12
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainWindow w;
    if (argc > 1) {
        QTextCodec* textCodec = QTextCodec::codecForLocale();
        if (textCodec) {
            w.openFile(textCodec->toUnicode(argv[1]));
        }
    }

    w.show();

    return a.exec();
}
Ejemplo n.º 13
0
void ReportView::load()
{
	QFile file(reportFileName);
	if(!file.open(QFile::ReadOnly | QFile::Text))
		qDebug() << "not file open " << file.errorString() << endl;
	else
	{
		QByteArray data = file.readAll();
		QTextCodec *codec = Qt::codecForHtml(data);
		QString str = codec->toUnicode(data);
		if (Qt::mightBeRichText(str))
		{
			ui->textEdit->setHtml(str);
		}
	}
}
Ejemplo n.º 14
0
void MainWindow::actionCharacterEncoding(QAction *action)
{
	QString encoding;

	if (action && action->data().toInt() > 0)
	{
		QTextCodec *codec = QTextCodec::codecForMib(action->data().toInt());

		if (codec)
		{
			encoding = codec->name();
		}
	}

	m_windowsManager->setDefaultCharacterEncoding(encoding.toLower());
}
Ejemplo n.º 15
0
QString getAmipString(const char * var)
{
	QString szRet;
	QString szString = eval_str(var);
	QTextCodec * pCodec = mediaplayer_get_codec();
	if(pCodec) {
#if (QT_VERSION < 0x050000)
		szRet = pCodec->toUnicode(szString.toLatin1());
#else
		szRet = pCodec->toUnicode(szString.toUtf8());
#endif
	} else {
		szRet = szString;
	}
	return szRet;
}
Ejemplo n.º 16
0
	virtual QString convertToUnicode(const char * chars,int len,ConverterState * state) const
	{
		if(g_utf8_validate(chars,len,NULL))
			return g_pUtf8TextCodec->toUnicode(chars,len,state);

		return m_pRecvCodec->toUnicode(chars,len,state);
	}
Ejemplo n.º 17
0
//************************************************************************************************
void tGuiError::ExeCommand(QDataStream& _in)
{
    int num_error=-9999;
    QString error="";
    QString detail="";
    QString client_detail="";

    _in >> num_error;
    _in >> error;
    _in >> detail;
    _in >> client_detail;

    //Отмена транзакции из-за ошибки
    QByteArray block;
    QDataStream out(&block, QIODevice::WriteOnly);

    block.clear();

    QString command="CancelTransaction";

    out << command;
    emit SendCommand(block);

/*
         QTextCodec *codec =QTextCodec::codecForName("Windows-1251");
//        QTextCodec *codec =QTextCodec::codecForName("UTF-8");
        QTextCodec::setCodecForTr(codec);
        QTextCodec::setCodecForCStrings(codec);

    QString before="\\";
    QString after="/";
    QString ret=codec->toUnicode(_path.replace(before, after).toAscii());
    */

   QTextCodec *codec =QTextCodec::codecForName("Windows-1251");

   QTextCodec::setCodecForTr(codec);
   QTextCodec::setCodecForCStrings(codec);

    QMessageBox MB;
    QString S=QString::fromUtf8("Ошибка в команде ")+QString::number(num_error)+"\n"+client_detail;
    QString S1=codec->toUnicode(S.toAscii())+"\n"+detail;
    MB.setText(S1);
    MB.setWindowTitle(error);
    MB.exec();

}
Ejemplo n.º 18
0
bool pEditor::saveFile( const QString& s )
{
    if ( !isModified() )
        return true;

    // get filename
    QString fn = s;
    if ( s.isEmpty() )
        fn = property( "fileName" ).toString();
    // get path
    QString fp = QFileInfo( fn ).path();

    // filename
    QFile f( fn );
    // filename dir
    QDir d;
    // create bak folder
    if ( !d.exists( fp ) )
        if ( !d.mkpath( fp ) )
            return false;

    // set correct path
    d.setPath( fp );
    // try open file to write in
    if ( !f.open( QFile::WriteOnly ) )
    {
        MonkeyCore::messageManager()->appendMessage( tr( "Cannot write file %1:\n%2." ).arg( fn ).arg( f.errorString() ) );
        return false;
    }

    // writing file
    QApplication::setOverrideCursor( Qt::WaitCursor );
    
    f.resize( 0 );
    QTextCodec* c = QTextCodec::codecForName( property( "codec" ).toString().toUtf8() );
    bool ok = f.write( c->fromUnicode( text() ) ) != -1;

    if ( ok )
    {
        setModified( false );
        setProperty( "fileName", fn );
    }
    
    QApplication::restoreOverrideCursor();

    return ok;
}
Ejemplo n.º 19
0
/*!
  Internal function that initializes the font system.

  \internal
  The font cache and font dict do not alloc the keys. The key is a QString
  which is shared between QFontPrivate and QXFontName.
*/
void QFont::initialize()
{
    extern int qt_encoding_id_for_mib(int mib); // from qfontdatabase_x11.cpp
    QTextCodec *codec = QTextCodec::codecForLocale();
    // determine the default encoding id using the locale, otherwise
    // fallback to latin1 (mib == 4)
    int mib = codec ? codec->mibEnum() : 4;

    // for asian locales, use the mib for the font codec instead of the locale codec
    switch (mib) {
    case 38: // eucKR
        mib = 36;
        break;

    case 2025: // GB2312
        mib = 57;
        break;

    case 113: // GBK
        mib = -113;
        break;

    case 114: // GB18030
        mib = -114;
        break;

    case 2026: // Big5
        mib = -2026;
        break;

    case 2101: // Big5-HKSCS
        mib = -2101;
        break;

    case 16: // JIS7
        mib = 15;
        break;

    case 17: // SJIS
    case 18: // eucJP
        mib = 63;
        break;
    }

    // get the default encoding id for the locale encoding...
    QFontPrivate::defaultEncodingID = qt_encoding_id_for_mib(mib);
}
Ejemplo n.º 20
0
void MainWindow::menuCharacterEncodingAboutToShow()
{
	if (!m_characterEncodingGroup)
	{
		QList<int> textCodecs;
		textCodecs << 106 << 1015 << 1017 << 4 << 5 << 6 << 7 << 8 << 82 << 10 << 85 << 12 << 13 << 109 << 110 << 112 << 2250 << 2251 << 2252 << 2253 << 2254 << 2255 << 2256 << 2257 << 2258 << 18 << 39 << 17 << 38 << 2026;

		m_characterEncodingGroup = new QActionGroup(this);
		m_characterEncodingGroup->setExclusive(true);

		QAction *defaultAction = m_ui->menuCharacterEncoding->addAction(tr("Auto Detect"));
		defaultAction->setData(-1);
		defaultAction->setCheckable(true);

		m_characterEncodingGroup->addAction(defaultAction);

		m_ui->menuCharacterEncoding->addSeparator();

		for (int i = 0; i < textCodecs.count(); ++i)
		{
			QTextCodec *codec = QTextCodec::codecForMib(textCodecs.at(i));

			if (!codec)
			{
				continue;
			}

			QAction *textCodecAction = m_ui->menuCharacterEncoding->addAction(Utils::elideText(codec->name(), m_ui->menuCharacterEncoding));
			textCodecAction->setData(textCodecs.at(i));
			textCodecAction->setCheckable(true);

			m_characterEncodingGroup->addAction(textCodecAction);
		}
	}

	const QString encoding = m_windowsManager->getDefaultCharacterEncoding().toLower();

	for (int i = 2; i < m_ui->menuCharacterEncoding->actions().count(); ++i)
	{
		QAction *action = m_ui->menuCharacterEncoding->actions().at(i);

		if (!action)
		{
			continue;
		}

		action->setChecked(encoding == action->text().toLower());

		if (action->isChecked())
		{
			break;
		}
	}

	if (!m_characterEncodingGroup->checkedAction())
	{
		m_ui->menuCharacterEncoding->actions().first()->setChecked(true);
	}
}
Ejemplo n.º 21
0
void ResultForm::encodingChanged(const QString &encoding)
{
    QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1());
    QComboBox *comboBox = qobject_cast<QComboBox *>(sender());

    if (codec) {
        if (comboBox)
            comboBox->setStyleSheet("");

        if (ui->requestRadio->isChecked()) {
            ui->bodyText->setPlainText(codec->toUnicode(m_request->body));
        } else if (ui->responseRadio->isChecked()) {
            ui->bodyText->setPlainText(codec->toUnicode(m_response->body));
        }
    } else if (comboBox)
       comboBox->setStyleSheet("QComboBox:editable:!on { background: #FF7777; color: white }");
}
Ejemplo n.º 22
0
void Process::slotFinished(int, QProcess::ExitStatus exitc){
	/*
	 * This piece of code try to catch error messages.
	 * In fact exitCode() not always can return error code
	 * (for example kdesu\gksu)
	 * So the beast way is to inform user about troubles is to show to him any STDERR messages.
	 */

		QTextStream stdErr(stderr);
		QString lang = this->getLocale();

		// Read STDERR with locale support
		QTextCodec *codec = QTextCodec::codecForName(lang.toLatin1());
		if (!codec){
			stdErr<<"[ee] Cannot setup codec for \""<<lang<<"\""<<endl;
			stdErr<<"[ee] Aborting current operation!"<<endl;
			reject();
			return;
		}

		QString string = codec->toUnicode(myProcess->readAllStandardError());

#ifdef DEBUG
		qDebug()<<"[ii] Process::slotFinished exitstatus:"<<exitc<<"exitcode:"<<myProcess->exitCode();
		qDebug()<<"[ii] Process::slotFinished STDERR:"<<codec->toUnicode(myProcess->readAllStandardError());
		qDebug()<<"[ii] Process::slotFinished STDOUT:"<<codec->toUnicode(myProcess->readAllStandardOutput());
#endif

		if (!string.isEmpty()){
			if ((exitc == 0) && (myProcess->exitCode() == 0)){
				if (showErr){
					QMessageBox::warning(this, tr("Output"), tr("It seems that the process exited normally.<br><br>STDERR log:<br>%1").arg(string));
				}
				accept();
                return;
			} else {
				QMessageBox::warning(this, tr("Output"), tr("It seems that the process crashed.<br><br>STDERR log:<br>%1").arg(string));
				reject();
                return;
			}
		}

	accept();

	return;
}
Ejemplo n.º 23
0
/*!
  \reimp
*/
QByteArray QTextDrag::encodedData(const char* mime) const
{
    QCString r;
    if ( 0==qstrnicmp(mime,"text/",5) ) {
	QCString m(mime);
	m = m.lower();
	QTextCodec *codec = findcharset(m);
	if ( !codec )
	    return r;
	r = codec->fromUnicode(d->txt);
	if (!codec || codec->mibEnum() != 1000) {
	    // Don't include NUL in size (QCString::resize() adds NUL)
	    ((QByteArray&)r).resize(r.length());
	}
    }
    return r;
}
Ejemplo n.º 24
0
void FLDiskCache::init(FLApplication *app)
{
  QTextCodec *codec = QTextCodec::codecForLocale();
  QString localEncode(codec ? codec->mimeName() : "");
  if (!app) {
    aqSetAndCreateDirPath(AQ_USRHOME + "/.eneboocache");
    if (!localEncode.isEmpty())
      aqSetAndCreateDirPath(AQ_DISKCACHE_DIRPATH + '/' + localEncode);
  } else {
    aqSetAndCreateDirPath(
      AQ_USRHOME + "/.eneboocache/" +
      app->db()->database()
    );
    if (!localEncode.isEmpty())
      aqSetAndCreateDirPath(AQ_DISKCACHE_DIRPATH + '/' + localEncode);
  }
}
QString QMessageContentContainer::textContent() const
{
    if (d_ptr->_textContent.isEmpty() && d_ptr->_attachmentId != 0) {
        CMTMEngine* mtmEngine = CMTMEngine::instance();
        const_cast<QString&>(d_ptr->_textContent) = mtmEngine->attachmentTextContent(d_ptr->_containingMessageId, d_ptr->_attachmentId, d_ptr->_charset);
    }
    if (!d_ptr->_textContent.isEmpty()) {
        return d_ptr->_textContent;
    }
    
    QTextCodec *codec = QTextCodec::codecForName(d_ptr->_charset.data());
    if (codec) {
        return codec->toUnicode(d_ptr->_content);
    } else {
        return QString::fromLatin1(d_ptr->_content);
    }
}
Ejemplo n.º 26
0
QTextCodec *LyricsParser::detectEncoding(const QByteArray &data, LyricsLoader::Properties &properties )
{
    // Now detect encoding
    QTextCodec * enc = 0;

    //qDebug("Supplied text: %s", data.constData() );

    if ( m_callback )
        enc = m_callback->detectTextCodec(data);

    if ( !enc )
        enc = QTextCodec::codecForName( "utf-8" );
    else
        properties[ LyricsLoader::PROP_DETECTED_ENCODING ] = enc->name();

    return enc;
}
Ejemplo n.º 27
0
    ManualSkill(const Skill *skill)
        : skill(skill),
          baseName(skill->objectName().split("_").last())
    {
        static const QString prefixes[] = { "boss", "gd", "jg", "jsp", "kof", "neo", "nos", "ol", "sp", "tw", "vs", "yt", "diy" };

        for (int i = 0; i < sizeof(prefixes) / sizeof(QString); ++i) {
            QString prefix = prefixes[i];
            if (baseName.startsWith(prefix))
                baseName.remove(0, prefix.length());
        }

        QTextCodec *codec = QTextCodec::codecForName("GBK");
        translatedBytes = codec->fromUnicode(Sanguosha->translate(skill->objectName()));

        printf("%s:%d", skill->objectName().toLocal8Bit().constData(), translatedBytes.length());
    }
Ejemplo n.º 28
0
bool pEditor::saveBackup( const QString& s )
{
    // if not filename, cancel
    if ( s.isEmpty() )
    {
        return false;
    }
    
    // get path
    QString fp = QFileInfo( s ).path();

    // file
    QFile f( s );
    
    // filename dir
    QDir d;
    // create bak folder
    if ( !d.exists( fp ) )
    {
        if ( !d.mkpath( fp ) )
        {
            return false;
        }
    }
    
    QApplication::setOverrideCursor( Qt::WaitCursor );
    
    // set correct path
    d.setPath( fp );
    
    // try open file to write in
    if ( !f.open( QFile::WriteOnly ) )
    {
        MonkeyCore::messageManager()->appendMessage( tr( "Cannot write file %1:\n%2." ).arg( s ).arg( f.errorString() ) );
        QApplication::restoreOverrideCursor();
        return false;
    }
    
    f.resize( 0 );
    QTextCodec* c = QTextCodec::codecForName( property( "codec" ).toString().toUtf8() );
    bool ok = f.write( c->fromUnicode( text() ) ) != -1;
    
    QApplication::restoreOverrideCursor();

    return ok;
}
Ejemplo n.º 29
0
DictInfoWidget::DictInfoWidget(QWidget* parent, Qt::WindowFlags f, struct DictInfo info) : QWidget(parent, f), mInfo(info)
{
	QString count;
	QString uni_str;
	const char* utf8_cstr;
	QTextCodec* codec = QTextCodec::codecForName("UTF-8");

	mLayout = new QGridLayout(this);

	mLabelCount = new QLabel(tr("<qt><b>Word count:</qt></b>"), this);
	count.sprintf("%d", mInfo.wordcount);
	mLabelCountResult = new QLabel(count, this);

	mLabelAuthor = new QLabel(tr("<qt><b>Author:</qt></b>"), this);
	utf8_cstr = mInfo.author.data();
	uni_str = codec->toUnicode(utf8_cstr);
	mLabelAuthorResult = new QLabel(uni_str, this);

	mLabelEmail = new QLabel(tr("<qt><b>Email:</qt></b>"), this);
	mLabelEmailResult = new QLabel(mInfo.email.c_str(), this);

	mLabelWebsite = new QLabel(tr("<qt><b>Website:</qt></b>"), this);
	mLabelWebsiteResult = new QLabel(mInfo.website.c_str(), this);

	mLabelDescription = new QLabel(tr("<qt><b>Description:</qt></b>"), this);
	utf8_cstr = mInfo.description.data();
	uni_str = codec->toUnicode(utf8_cstr);
	mLabelDescriptionResult = new QLabel(uni_str, this);
	
	mLabelDate = new QLabel(tr("<qt><b>Date:</qt></b>"), this);
	mLabelDateResult = new QLabel(mInfo.date.c_str(), this);

	mLayout->addWidget(mLabelCount, 0, 0);
	mLayout->addWidget(mLabelCountResult, 0, 1);
	mLayout->addWidget(mLabelAuthor, 1, 0);
	mLayout->addWidget(mLabelAuthorResult, 1, 1);
	mLayout->addWidget(mLabelEmail, 2, 0);
	mLayout->addWidget(mLabelEmailResult, 2, 1);
	mLayout->addWidget(mLabelWebsite, 3, 0);
	mLayout->addWidget(mLabelWebsiteResult, 3, 1);
	mLayout->addWidget(mLabelDescription, 4, 0);
	mLayout->addWidget(mLabelDescriptionResult, 4, 1);
	mLayout->addWidget(mLabelDate, 5, 0);
	mLayout->addWidget(mLabelDateResult, 5, 1);
}
//------------------------------------------------------------------------------
bool MainWindow::CheckMeCabHome(QSettings *ini_settings)
{
    bool stat = true;
    QString meCabStdDir, meCabStdDir_x86;

    QTextCodec *codec = QTextCodec::codecForName("Shift-JIS");
    QTextEncoder *encoder = codec->makeEncoder();

    QDir dir(meCabHome);
    if(! dir.exists()){
        meCabStdDir_x86 = "c:/Program Files (x86)/MeCab/bin/";
        QDir dir_x86(meCabStdDir_x86);
        meCabStdDir = "c:/Program Files/MeCab/bin/";
        QDir dir(meCabStdDir);
        if(dir_x86.exists()){
            meCabHome = meCabStdDir_x86;
        }
        else if(dir.exists()){
            meCabHome = meCabStdDir;
        }
        else{
            QMessageBox::StandardButton reply;
            reply = QMessageBox::critical(this, tr("ERROR"),
                tr("MeCab is not installed in the folder below.") + "\n" +
                " " + meCabStdDir + "\n" +
                " " + tr("nor") + "\n" +
                " " + meCabStdDir_x86 + "\n\n" +
                tr("Install MeCab.") + "\n" +
                tr("If MeCab is installed in another folder, Change ini file.") + "\n" +
                " " + tr("ini file name") + ": " + programName + ".ini\n" +
                " " + tr("section") + ": [MeCab]\n" +
                " " + tr("name") + ": MeCab_HOME\n" +
                " " + tr("ex.") + " MeCab_HOME=C:/Program Files (x86)/MeCab/bin/\n"
                ,QMessageBox::Abort);
            meCabHome = "";
        }
        if(meCabHome != ""){
            ini_settings->setValue("MeCab/MeCab_HOME", QString(encoder->fromUnicode(meCabHome)));
        }
        else{
            stat = false;
        }
    }
    return stat;
}