Commit 73d60a58 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

RemoteLinux: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: I10541e999d6210caf6b88ecb5c1010e831b2f4d4
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent cf7f778c
......@@ -56,7 +56,7 @@ EmbeddedLinuxQtVersion *EmbeddedLinuxQtVersion::clone() const
QString EmbeddedLinuxQtVersion::type() const
{
return RemoteLinux::Constants::EMBEDDED_LINUX_QT;
return QLatin1String(RemoteLinux::Constants::EMBEDDED_LINUX_QT);
}
QList<ProjectExplorer::Abi> EmbeddedLinuxQtVersion::detectQtAbis() const
......
......@@ -173,7 +173,7 @@ void GenericLinuxDeviceConfigurationWidget::initGui()
m_ui->machineTypeValueLabel->setText(tr("Physical Device"));
else
m_ui->machineTypeValueLabel->setText(tr("Emulator"));
m_ui->portsWarningLabel->setPixmap(QPixmap(":/projectexplorer/images/compile_error.png"));
m_ui->portsWarningLabel->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_error.png")));
m_ui->portsWarningLabel->setToolTip(QLatin1String("<font color=\"red\">")
+ tr("You will need at least one port.") + QLatin1String("</font>"));
m_ui->keyFileLineEdit->setExpectedKind(PathChooser::File);
......
......@@ -71,7 +71,7 @@ private:
"cat $dir/stat;"
"readlink $dir/exe;"
"printf '%1''%2';"
"done").arg(Delimiter0).arg(Delimiter1);
"done").arg(QLatin1String(Delimiter0)).arg(QLatin1String(Delimiter1));
}
QList<DeviceProcess> buildProcessList(const QString &listProcessesReply) const
......
......@@ -109,7 +109,7 @@ void PublicKeyDeploymentDialog::handleDeploymentFinished(const QString &errorMsg
buttonText = errorMsg;
textColor = "red";
}
setLabelText(QString::fromLatin1("<font color=\"%1\">%2</font>").arg(textColor, buttonText));
setLabelText(QString::fromLatin1("<font color=\"%1\">%2</font>").arg(QLatin1String(textColor), buttonText));
setCancelButtonText(tr("Close"));
}
......
......@@ -100,5 +100,6 @@ FORMS += \
RESOURCES += remotelinux.qrc
DEFINES += QT_NO_CAST_TO_ASCII
DEFINES += REMOTELINUX_LIBRARY
DEFINES += \
REMOTELINUX_LIBRARY \
QT_NO_CAST_FROM_ASCII
......@@ -5,12 +5,14 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "RemoteLinux"
Depends { name: "cpp" }
Depends { name: "Qt.widgets" }
Depends { name: "Core" }
Depends { name: "Debugger" }
Depends { name: "ProjectExplorer" }
Depends { name: "QtSupport" }
Depends { name: "QtcSsh" }
cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
files: [
"abstractpackagingstep.cpp",
......
......@@ -111,7 +111,7 @@ void RemoteLinuxEnvironmentReader::remoteProcessFinished(int exitCode)
} else {
QString errorMsg = tr("Error running remote process: %1")
.arg(m_remoteProcessRunner->processErrorString());
QString remoteStderr = m_remoteProcessRunner->readAllStandardError();
QString remoteStderr = QString::fromUtf8(m_remoteProcessRunner->readAllStandardError());
if (!remoteStderr.isEmpty())
errorMsg += tr("\nRemote stderr was: '%1'").arg(remoteStderr);
emit error(errorMsg);
......
......@@ -127,7 +127,7 @@ bool RemoteLinuxRunControl::isRunning() const
QIcon RemoteLinuxRunControl::icon() const
{
return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL);
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
}
void RemoteLinuxRunControl::setApplicationRunnerPreRunAction(DeviceApplicationHelperAction *action)
......
......@@ -231,7 +231,7 @@ bool TarPackageCreationStep::writeHeader(QFile &tarFile, const QFileInfo &fileIn
const int maxFilePathLength = sizeof header.fileNamePrefix + sizeof header.fileName;
if (filePath.count() > maxFilePathLength) {
raiseError(tr("Cannot add file '%1' to tar-archive: path too long.")
.arg(QDir::toNativeSeparators(filePath)));
.arg(QDir::toNativeSeparators(remoteFilePath)));
return false;
}
......@@ -249,19 +249,19 @@ bool TarPackageCreationStep::writeHeader(QFile &tarFile, const QFileInfo &fileIn
| (04 * fileInfo.permission(QFile::ReadOther))
| (02 * fileInfo.permission(QFile::WriteOther))
| (01 * fileInfo.permission(QFile::ExeOther));
const QByteArray permissionString = QString("%1").arg(permissions,
const QByteArray permissionString = QString::fromLatin1("%1").arg(permissions,
sizeof header.fileMode - 1, 8, QLatin1Char('0')).toLatin1();
std::memcpy(&header.fileMode, permissionString.data(), permissionString.length());
const QByteArray uidString = QString("%1").arg(fileInfo.ownerId(),
const QByteArray uidString = QString::fromLatin1("%1").arg(fileInfo.ownerId(),
sizeof header.uid - 1, 8, QLatin1Char('0')).toLatin1();
std::memcpy(&header.uid, uidString.data(), uidString.length());
const QByteArray gidString = QString("%1").arg(fileInfo.groupId(),
const QByteArray gidString = QString::fromLatin1("%1").arg(fileInfo.groupId(),
sizeof header.gid - 1, 8, QLatin1Char('0')).toLatin1();
std::memcpy(&header.gid, gidString.data(), gidString.length());
const QByteArray sizeString = QString("%1").arg(fileInfo.size(),
const QByteArray sizeString = QString::fromLatin1("%1").arg(fileInfo.size(),
sizeof header.length - 1, 8, QLatin1Char('0')).toLatin1();
std::memcpy(&header.length, sizeString.data(), sizeString.length());
const QByteArray mtimeString = QString("%1").arg(fileInfo.lastModified().toTime_t(),
const QByteArray mtimeString = QString::fromLatin1("%1").arg(fileInfo.lastModified().toTime_t(),
sizeof header.mtime - 1, 8, QLatin1Char('0')).toLatin1();
std::memcpy(&header.mtime, mtimeString.data(), mtimeString.length());
if (fileInfo.isDir())
......@@ -276,7 +276,7 @@ bool TarPackageCreationStep::writeHeader(QFile &tarFile, const QFileInfo &fileIn
quint64 checksum = 0;
for (size_t i = 0; i < sizeof header; ++i)
checksum += reinterpret_cast<char *>(&header)[i];
const QByteArray checksumString = QString("%1").arg(checksum,
const QByteArray checksumString = QString::fromLatin1("%1").arg(checksum,
sizeof header.chksum - 1, 8, QLatin1Char('0')).toLatin1();
std::memcpy(&header.chksum, checksumString.data(), checksumString.length());
header.chksum[sizeof header.chksum-1] = 0;
......
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