There is a piece of code in this thing which works just fine in Qt land but CopperSpice land no likey.
Code: Select all
/**
* @brief Fills in a entry from a ini-file string.
*/
int Ini::decodeValueString( IniEntry *entry, QString specialKind, QByteArray dataArray )
{
int rc = 0;
if ( specialKind == "ByteArray" )
{
QByteArray byteArray;
char hexStr[3];
enum {IDLE, ESC, FIRST_HEX, SECOND_HEX} state = IDLE;
QString valueStr = dataArray;
for ( int i = 0; i < valueStr.length(); i++ )
{
QChar c = valueStr[i];
switch ( state )
{
case IDLE:
{
if ( c == '\\' )
{
state = ESC;
}
else
{
byteArray += c;
}
};
break;
But for now...
What is the approved hack/method of stuffing a QChar into a byte array in correct byte order?