Skip to content

Commit

Permalink
"Fix" QDebug() unicode escaping feature introduced in Qt5.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
greblus committed Oct 10, 2015
1 parent 1f910c9 commit 744eb42
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 54 deletions.
14 changes: 7 additions & 7 deletions autoboot.cpp
Expand Up @@ -34,7 +34,7 @@ void AutoBoot::handleCommand(quint8 command, quint16 aux)
QByteArray speed(1, 0);
speed[0] = sio->port()->speedByte();
sio->port()->writeDataFrame(speed);
qDebug() << "!n" << tr("[%1] Speed poll.").arg(deviceName());
qDebug().noquote() << "!n" << tr("[%1] Speed poll.").arg(deviceName());
break;
}
case 0x52:
Expand All @@ -55,7 +55,7 @@ void AutoBoot::handleCommand(quint8 command, quint16 aux)
if (readSector(aux, data)) {
sio->port()->writeComplete();
sio->port()->writeDataFrame(data);
qDebug() << "!n" << tr("[%1] Read sector %2 (%3 bytes).")
qDebug().noquote() << "!n" << tr("[%1] Read sector %2 (%3 bytes).")
.arg(deviceName())
.arg(aux)
.arg(data.size());
Expand Down Expand Up @@ -85,7 +85,7 @@ void AutoBoot::handleCommand(quint8 command, quint16 aux)
status[3] = 1;
sio->port()->writeComplete();
sio->port()->writeDataFrame(status);
qDebug() << "!n" << tr("[%1] Get status.")
qDebug().noquote() << "!n" << tr("[%1] Get status.")
.arg(deviceName());
break;
}
Expand All @@ -94,7 +94,7 @@ void AutoBoot::handleCommand(quint8 command, quint16 aux)
if (!sio->port()->writeCommandAck()) {
return;
}
qDebug() << "!n" << tr("[%1] Atari is jumping to %2.")
qDebug().noquote() << "!n" << tr("[%1] Atari is jumping to %2.")
.arg(deviceName())
.arg(aux);
emit loaderDone();
Expand All @@ -106,7 +106,7 @@ void AutoBoot::handleCommand(quint8 command, quint16 aux)
if (!sio->port()->writeCommandAck()) {
return;
}
qDebug() << "!n" << tr("[%1] Get chunk %2 (%3 bytes).")
qDebug().noquote() << "!n" << tr("[%1] Get chunk %2 (%3 bytes).")
.arg(deviceName())
.arg(aux)
.arg(chunks.at(aux).data.size());
Expand All @@ -131,7 +131,7 @@ void AutoBoot::handleCommand(quint8 command, quint16 aux)
data[3] = chunks.size() != aux + 1;
data[4] = chunks.at(aux).data.size() % 256;
data[5] = chunks.at(aux).data.size() / 256;
qDebug() << "!d" << tr("[%1] Get chunk info %2 (%3 bytes at %4).")
qDebug().noquote() << "!d" << tr("[%1] Get chunk info %2 (%3 bytes at %4).")
.arg(deviceName())
.arg(aux)
.arg(chunks.at(aux).data.size())
Expand Down Expand Up @@ -223,7 +223,7 @@ bool AutoBoot::readExecutable(const QString &fileName)
}
end = (quint8) data.at(0) + (quint8) data.at(1) * 256;

qDebug() << "!d" << "Exe segment" << start << ".." << end;
qDebug().noquote() << "!d" << "Exe segment" << start << ".." << end;

if (end < start) {
qWarning() << tr("The executable '%1' is broken: The end address is less than the start address.")
Expand Down
14 changes: 7 additions & 7 deletions diskimage.cpp
Expand Up @@ -838,7 +838,7 @@ void SimpleDiskImage::handleCommand(quint8 command, quint16 aux)
data[0] = data[1] = 0xFF;
sio->port()->writeComplete();
sio->port()->writeDataFrame(data);
qDebug() << "!n" << tr("[%1] Format ED.").arg(deviceName());
qDebug().noquote() << "!n" << tr("[%1] Format ED.").arg(deviceName());
} else {
sio->port()->writeError();
qCritical() << "!e" << tr("[%1] Format ED failed.").arg(deviceName());
Expand All @@ -854,7 +854,7 @@ void SimpleDiskImage::handleCommand(quint8 command, quint16 aux)
QByteArray speed(1, 0);
speed[0] = sio->port()->speedByte();
sio->port()->writeDataFrame(speed);
qDebug() << "!n" << tr("[%1] Speed poll.").arg(deviceName());
qDebug().noquote() << "!n" << tr("[%1] Speed poll.").arg(deviceName());
break;
}
case 0x4e: // Get PERCOM block
Expand All @@ -865,7 +865,7 @@ void SimpleDiskImage::handleCommand(quint8 command, quint16 aux)
QByteArray percom = m_newGeometry.toPercomBlock();
sio->port()->writeComplete();
sio->port()->writeDataFrame(percom);
qDebug() << "!n" << tr("[%1] Get PERCOM block (%2).")
qDebug().noquote() << "!n" << tr("[%1] Get PERCOM block (%2).")
.arg(deviceName())
.arg(m_newGeometry.humanReadable());
break;
Expand All @@ -884,7 +884,7 @@ void SimpleDiskImage::handleCommand(quint8 command, quint16 aux)
m_newGeometry.initialize(percom);

sio->port()->writeComplete();
qDebug() << tr("[%1] Set PERCOM block (%2).")
qDebug().noquote() << tr("[%1] Set PERCOM block (%2).")
.arg(deviceName())
.arg(m_newGeometry.humanReadable());
break;
Expand Down Expand Up @@ -956,7 +956,7 @@ void SimpleDiskImage::handleCommand(quint8 command, quint16 aux)
}
if (writeSector(aux, data)) {
sio->port()->writeComplete();
qDebug() << "!n" << tr("[%1] Write sector %2 (%3 bytes).").arg(deviceName()).arg(aux).arg(data.size());
qDebug().noquote() << "!n" << tr("[%1] Write sector %2 (%3 bytes).").arg(deviceName()).arg(aux).arg(data.size());
} else {
sio->port()->writeError();
qCritical() << "!e" << tr("[%1] Write sector %2 failed.")
Expand Down Expand Up @@ -987,7 +987,7 @@ void SimpleDiskImage::handleCommand(quint8 command, quint16 aux)
if (readSector(aux, data)) {
sio->port()->writeComplete();
sio->port()->writeDataFrame(data);
qDebug() << "!n" << tr("[%1] Read sector %2 (%3 bytes).")
qDebug().noquote() << "!n" << tr("[%1] Read sector %2 (%3 bytes).")
.arg(deviceName())
.arg(aux)
.arg(data.size());
Expand Down Expand Up @@ -1016,7 +1016,7 @@ void SimpleDiskImage::handleCommand(quint8 command, quint16 aux)

sio->port()->writeComplete();
sio->port()->writeDataFrame(status);
qDebug() << "!n" << tr("[%1] Get status.").arg(deviceName());
qDebug().noquote() << "!n" << tr("[%1] Get status.").arg(deviceName());
break;
}
default: // Unknown command
Expand Down
6 changes: 3 additions & 3 deletions diskimagepro.cpp
Expand Up @@ -114,7 +114,7 @@ bool DiskImagePro::readSector(quint16 sector, QByteArray &data)
{
int dupnum = count[sector];

qDebug() << "!e" << tr("Duplicate sector: %1 dupnum: %2").arg(sector).arg(dupnum);
qDebug().noquote() << "!e" << tr("Duplicate sector: %1 dupnum: %2").arg(sector).arg(dupnum);

count[sector] = (count[sector]+1) % ((quint8)header[5]+1);
if (dupnum != 0) {
Expand All @@ -134,7 +134,7 @@ bool DiskImagePro::readSector(quint16 sector, QByteArray &data)
wd1772status = header[1];
if (wd1772status != 0xff)
{
qDebug() << "!e" << tr("Bad sector");
qDebug().noquote() << "!e" << tr("Bad sector");
return false;
}

Expand Down Expand Up @@ -162,4 +162,4 @@ void DiskImagePro::getStatus(QByteArray &status)
status[1] = wd1772status;
status[2] = 3;
status[3] = 0;
}
}
38 changes: 19 additions & 19 deletions mainwindow.cpp
Expand Up @@ -122,7 +122,7 @@ MainWindow::MainWindow(QWidget *parent)
logMutex = new QMutex();
connect(this, SIGNAL(logMessage(int,QString)), this, SLOT(uiMessage(int,QString)), Qt::QueuedConnection);
qInstallMessageHandler(logMessageOutput);
qDebug() << "!d" << tr("AspeQt started at %1.").arg(QDateTime::currentDateTime().toString());
qDebug().noquote() << "!d" << tr("AspeQt started at %1.").arg(QDateTime::currentDateTime().toString());

/* Remove old temporaries */
QDir tempDir = QDir::temp();
Expand Down Expand Up @@ -345,7 +345,7 @@ MainWindow::~MainWindow()

delete ui;

qDebug() << "!d" << tr("AspeQt stopped at %1.").arg(QDateTime::currentDateTime().toString());
qDebug().noquote() << "!d" << tr("AspeQt stopped at %1.").arg(QDateTime::currentDateTime().toString());
qInstallMessageHandler(0);
delete logMutex;
delete logFile;
Expand Down Expand Up @@ -445,7 +445,7 @@ void MainWindow::dropEvent(QDropEvent *event)

aspeqtSettings->swapImages(slot, source);

qDebug() << "!n" << tr("Swapped disk %1 with disk %2.").arg(slot + 1).arg(source + 1);
qDebug().noquote() << "!n" << tr("Swapped disk %1 with disk %2.").arg(slot + 1).arg(source + 1);

return;
}
Expand Down Expand Up @@ -590,7 +590,7 @@ void MainWindow::show()
ui->actionOptions->trigger();
}
}
qDebug() << "!d" << "Starting emulation";
qDebug().noquote() << "!d" << "Starting emulation";

ui->actionStartEmulation->trigger();
}
Expand Down Expand Up @@ -1108,7 +1108,7 @@ bool MainWindow::ejectImage(int no, bool ask)
aspeqtSettings->unmountImage(no);
updateRecentFileActions();
deviceStatusChanged(no + 0x31);
qDebug() << "!n" << tr("Unmounted disk %1").arg(no + 1);
qDebug().noquote() << "!n" << tr("Unmounted disk %1").arg(no + 1);
return true;
}

Expand Down Expand Up @@ -1264,7 +1264,7 @@ void MainWindow::mountFile(int no, const QString &fileName, bool /*prot*/)
filenamelabel = fileName.right(fileName.size() - i);
}

qDebug() << "!n" << tr("[%1] Mounted '%2' as '%3'.")
qDebug().noquote() << "!n" << tr("[%1] Mounted '%2' as '%3'.")
.arg(disk->deviceName())
.arg(filenamelabel)
.arg(disk->description());
Expand Down Expand Up @@ -1487,49 +1487,49 @@ void MainWindow::autoSaveDisk(int no)
switch (no) {
case 0 :
if (ui->autoSave_1->isChecked()) {
qDebug() << "!n" << tr("[Disk 1] Auto-commit ON.");
qDebug().noquote() << "!n" << tr("[Disk 1] Auto-commit ON.");
} else {
qDebug() << "!n" << tr("[Disk 1] Auto-commit OFF.");
qDebug().noquote() << "!n" << tr("[Disk 1] Auto-commit OFF.");
}
break;

case 1 :
if (ui->autoSave_2->isChecked()) {
qDebug() << "!n" << tr("[Disk 2] Auto-commit ON.");
qDebug().noquote() << "!n" << tr("[Disk 2] Auto-commit ON.");
} else {
qDebug() << "!n" << tr("[Disk 2] Auto-commit OFF.");
qDebug().noquote() << "!n" << tr("[Disk 2] Auto-commit OFF.");
}
break;

case 2 :
if (ui->autoSave_3->isChecked()) {
qDebug() << "!n" << tr("[Disk 3] Auto-commit ON.");
qDebug().noquote() << "!n" << tr("[Disk 3] Auto-commit ON.");
} else {
qDebug() << "!n" << tr("[Disk 3] Auto-commit OFF.");
qDebug().noquote() << "!n" << tr("[Disk 3] Auto-commit OFF.");
}
break;

case 3 :
if (ui->autoSave_4->isChecked()) {
qDebug() << "!n" << tr("[Disk 4] Auto-commit ON.");
qDebug().noquote() << "!n" << tr("[Disk 4] Auto-commit ON.");
} else {
qDebug() << "!n" << tr("[Disk 4] Auto-commit OFF.");
qDebug().noquote() << "!n" << tr("[Disk 4] Auto-commit OFF.");
}
break;

case 4 :
if (ui->autoSave_5->isChecked()) {
qDebug() << "!n" << tr("[Disk 5] Auto-commit ON.");
qDebug().noquote() << "!n" << tr("[Disk 5] Auto-commit ON.");
} else {
qDebug() << "!n" << tr("[Disk 5] Auto-commit OFF.");
qDebug().noquote() << "!n" << tr("[Disk 5] Auto-commit OFF.");
}
break;

case 5 :
if (ui->autoSave_6->isChecked()) {
qDebug() << "!n" << tr("[Disk 6] Auto-commit ON.");
qDebug().noquote() << "!n" << tr("[Disk 6] Auto-commit ON.");
} else {
qDebug() << "!n" << tr("[Disk 6] Auto-commit OFF.");
qDebug().noquote() << "!n" << tr("[Disk 6] Auto-commit OFF.");
}
break;
}
Expand Down Expand Up @@ -1797,7 +1797,7 @@ void MainWindow::on_actionNewImage_triggered()

sio->installDevice(0x31 + no, disk);
deviceStatusChanged(0x31 + no);
qDebug() << "!n" << tr("[%1] Mounted '%2' as '%3'.")
qDebug().noquote() << "!n" << tr("[%1] Mounted '%2' as '%3'.")
.arg(disk->deviceName())
.arg(disk->originalFileName())
.arg(disk->description());
Expand Down
28 changes: 14 additions & 14 deletions miscdevices.cpp
Expand Up @@ -35,7 +35,7 @@ void Printer::handleCommand(quint8 command, quint16 aux)
status[3] = 0;
sio->port()->writeComplete();
sio->port()->writeDataFrame(status);
qDebug() << "!n" << tr("[%1] Get status.").arg(deviceName());
qDebug().noquote() << "!n" << tr("[%1] Get status.").arg(deviceName());
break;
}
case 0x57:
Expand Down Expand Up @@ -66,7 +66,7 @@ void Printer::handleCommand(quint8 command, quint16 aux)
}
// Display Info message once //
if (!conversionMsgdisplayedOnce) {
qDebug() << "!n" << tr("[%1] Converting Inverse Video Characters for ASCII viewing").arg(deviceName()).arg(len);
qDebug().noquote() << "!n" << tr("[%1] Converting Inverse Video Characters for ASCII viewing").arg(deviceName()).arg(len);
conversionMsgdisplayedOnce = true;
}
sio->port()->writeCommandAck();
Expand All @@ -79,7 +79,7 @@ void Printer::handleCommand(quint8 command, quint16 aux)
return;
}
sio->port()->writeDataAck();
qDebug() << "!n" << tr("[%1] Print (%2 chars)").arg(deviceName()).arg(len);
qDebug().noquote() << "!n" << tr("[%1] Print (%2 chars)").arg(deviceName()).arg(len);
int n = data.indexOf('\x9b');
if (n == -1) {
n = len;
Expand All @@ -101,7 +101,7 @@ void Printer::handleCommand(quint8 command, quint16 aux)
.arg(aux, 4, 16, QChar('0'));
}
} else {
qDebug() << "!u" << tr("[%1] ignored").arg(deviceName());
qDebug().noquote() << "!u" << tr("[%1] ignored").arg(deviceName());
}
}

Expand All @@ -125,7 +125,7 @@ void AspeCl::handleCommand(quint8 command, quint16 aux)
data[3] = dateTime.time().hour();
data[4] = dateTime.time().minute();
data[5] = dateTime.time().second();
qDebug() << "!n" << tr("[%1] Date/time sent to client (%2).")
qDebug().noquote() << "!n" << tr("[%1] Date/time sent to client (%2).")
.arg(deviceName())
.arg(dateTime.toString(Qt::SystemLocaleShortDate));

Expand All @@ -147,13 +147,13 @@ void AspeCl::handleCommand(quint8 command, quint16 aux)
if (swapDisk1 >= 0 and swapDisk1 < 15 and swapDisk2 >=0 and swapDisk2 < 15 and swapDisk1 != swapDisk2) {
sio->swapDevices(swapDisk1 + 0x31, swapDisk2 + 0x31);
aspeqtSettings->swapImages(swapDisk1, swapDisk2);
qDebug() << "!n" << tr("[%1] Swapped disk %2 with disk %3.")
qDebug().noquote() << "!n" << tr("[%1] Swapped disk %2 with disk %3.")
.arg(deviceName())
.arg(swapDisk2 + 1)
.arg(swapDisk1 + 1);
} else {
sio->port()->writeCommandNak();
qDebug() << "!e" << tr("[%1] Invalid swap request for drives: (%2)-(%3).")
qDebug().noquote() << "!e" << tr("[%1] Invalid swap request for drives: (%2)-(%3).")
.arg(deviceName())
.arg(swapDisk2 + 1)
.arg(swapDisk1 + 1);
Expand Down Expand Up @@ -187,15 +187,15 @@ void AspeCl::handleCommand(quint8 command, quint16 aux)
sio->uninstallDevice(i + 0x31);
delete img;
aspeqtSettings->unmountImage(i);
qDebug() << "!n" << tr("[%1] Unmounted disk %2")
qDebug().noquote() << "!n" << tr("[%1] Unmounted disk %2")
.arg(deviceName())
.arg(i + 1);
}
qDebug() << "!n" << tr("[%1] ALL images were remotely unmounted")
qDebug().noquote() << "!n" << tr("[%1] ALL images were remotely unmounted")
.arg(deviceName());
} else {
sio->port()->writeCommandNak();
qDebug() << "!e" << tr("[%1] Can not remotely unmount ALL images due to pending changes.")
qDebug().noquote() << "!e" << tr("[%1] Can not remotely unmount ALL images due to pending changes.")
.arg(deviceName());
}
} else {
Expand All @@ -204,22 +204,22 @@ void AspeCl::handleCommand(quint8 command, quint16 aux)

if (img && img->isModified()) {
sio->port()->writeCommandNak();
qDebug() << "!e" << tr("[%1] Can not remotely unmount disk %2 due to pending changes.")
qDebug().noquote() << "!e" << tr("[%1] Can not remotely unmount disk %2 due to pending changes.")
.arg(deviceName())
.arg(unmountDisk);
} else {
sio->uninstallDevice(unmountDisk - 1 + 0x31);
delete img;
aspeqtSettings->unmountImage(unmountDisk - 1);
qDebug() << "!n" << tr("[%1] Remotely unmounted disk %2")
qDebug().noquote() << "!n" << tr("[%1] Remotely unmounted disk %2")
.arg(deviceName())
.arg(unmountDisk);
}
}

} else {
sio->port()->writeCommandNak();
qDebug() << "!e" << tr("[%1] Invalid drive number: %2 for remote unmount")
qDebug().noquote() << "!e" << tr("[%1] Invalid drive number: %2 for remote unmount")
.arg(deviceName())
.arg(unmountDisk);
}
Expand Down Expand Up @@ -434,7 +434,7 @@ void AspeCl::fileMounted(bool mounted)
{
if (mounted) {
sio->port()->writeComplete();
qDebug() << "!n" << tr("[%1] Image %2 mounted")
qDebug().noquote() << "!n" << tr("[%1] Image %2 mounted")
.arg(deviceName())
.arg(imageFileName.mid(1,imageFileName.size()-1));
} else {
Expand Down

0 comments on commit 744eb42

Please sign in to comment.