Commit 78bf1a9b authored by Antoine Regimbeau's avatar Antoine Regimbeau

COMP: fix signature changes and comment some lines to allow compilation

parent 81eabd46
......@@ -448,7 +448,11 @@ private:
* \param type Type of caught message.
* \param message Content of caught message.
*/
static void HandleQtMessage( QtMsgType type, const char* message );
static void HandleQtMessage( QtMsgType type, const QMessageLogContext & , const QString & message );
/* Old function was
static void HandleQtMessage( QtMsgType type, const char * message );
Qstring has a constructor QString(const char *str) but I have no idea
of the perf impact */
/**
*/
......
......@@ -160,7 +160,7 @@ I18nCoreApplication
// get the md5 of the filename
QByteArray result =
QCryptographicHash::hash( fileInfo.absoluteFilePath().toAscii(),
QCryptographicHash::hash( fileInfo.absoluteFilePath().toLatin1(),
QCryptographicHash::Md5 );
// MD5 hash-code.
......@@ -256,9 +256,12 @@ I18nCoreApplication
}
/*****************************************************************************/
/*///////////////Warning signature modification for qt5//////////////////////*/
void
I18nCoreApplication
::HandleQtMessage( QtMsgType type, const char* message )
::HandleQtMessage( QtMsgType type ,
const QMessageLogContext & ,
const QString & message )
{
switch( type )
{
......@@ -378,7 +381,7 @@ I18nCoreApplication
);
}
qInstallMsgHandler( I18nCoreApplication::HandleQtMessage );
qInstallMessageHandler( I18nCoreApplication::HandleQtMessage );
m_Instance = this;
}
......@@ -558,17 +561,22 @@ I18nCoreApplication
// Literal strings to be translated are UTF-8 encoded because source
// files are UTF-8 encoded.
/*/////////////////////////////// Warning //////////////////////
we need to replace those lines with a function of Qt5
QTextCodec::setCodecForTr( QTextCodec::codecForName( "UTF-8" ) );
//////////////////////////////////////////////////////////////////*/
// QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") );
// QTextCodec::setCodecForCStrings( QTextCodec::codecForName("System") );
/*/////////////////////////////// Warning //////////////////////
we need to replace those lines with a function of Qt5
qDebug()
<< "Codec for C-strings:"
<< ( QTextCodec::codecForCStrings()!=NULL
? QTextCodec::codecForCStrings()->name()
: "none" );
? QTextCodec::codecForCStrings()->name()
: "none" );
//////////////////////////////////////////////////////////////////*/
qDebug()
<< "Codec for Locale:"
......@@ -576,11 +584,14 @@ I18nCoreApplication
? QTextCodec::codecForLocale()->name()
: "none" );
/*/////////////////////////////// Warning //////////////////////
we need to replace those lines with a function of Qt5
qDebug()
<< "Codec for Tr:"
<< ( QTextCodec::codecForTr()!=NULL
? QTextCodec::codecForTr()->name()
: "none" );
? QTextCodec::codecForTr()->name()
: "none" );
//////////////////////////////////////////////////////////////////*/
//
// 1. default UI language is english (no translation).
......
......@@ -36,9 +36,11 @@ int main(int argc, char* argv[])
{
// Handle UTF-8 filenames
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
/*/////////////////////////////// Warning //////////////////////
we need to replace those lines with a function of Qt5
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
// QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
//////////////////////////////////////////////////////////////////*/
QtApplication qtApp(argc, argv);
if (argc < 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment