Commit 63e5a3a1 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Christian Kandeler

Madde: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: I1711c4286e6c1807e8e8e42732511cd70aa62b63
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent 9dfc4f8e
......@@ -58,11 +58,11 @@
namespace {
const QByteArray IconFieldName("XB-Maemo-Icon-26");
const QByteArray NameFieldName("Package");
const QByteArray ShortDescriptionFieldName("Description");
const char IconFieldName[] = "XB-Maemo-Icon-26";
const char NameFieldName[] = "Package";
const char ShortDescriptionFieldName[] = "Description";
const QLatin1String PackagingDirName("qtc_packaging");
const char PackagingDirName[] = "qtc_packaging";
// The QDateTime API can only deliver these in localized form...
QString shortMonthName(const QDateTime &dt)
......@@ -307,7 +307,7 @@ DebianManager::DebianManager(QObject *parent) :
{
m_instance = this;
m_watcher->setObjectName("Madde::DebianManager");
m_watcher->setObjectName(QLatin1String("Madde::DebianManager"));
connect(m_watcher, SIGNAL(directoryChanged(QString)),
this, SLOT(directoryWasChanged(QString)));
}
......@@ -441,7 +441,7 @@ bool DebianManager::setProjectVersion(const Utils::FileName &debianDir, const QS
QString DebianManager::packageName(const Utils::FileName &debianDir)
{
return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir), NameFieldName, false));
return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir), QLatin1String(NameFieldName), false));
}
bool DebianManager::setPackageName(const Utils::FileName &debianDir, const QString &newName)
......@@ -484,7 +484,8 @@ bool DebianManager::setPackageName(const Utils::FileName &debianDir, const QStri
QString DebianManager::shortDescription(const Utils::FileName &debianDir)
{
return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir), ShortDescriptionFieldName, false));
return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir),
QLatin1String(ShortDescriptionFieldName), false));
}
bool DebianManager::setShortDescription(const Utils::FileName &debianDir, const QString &description)
......@@ -495,7 +496,7 @@ bool DebianManager::setShortDescription(const Utils::FileName &debianDir, const
QString DebianManager::packageManagerName(const Utils::FileName &debianDir, Core::Id deviceType)
{
return QString::fromUtf8(controlFileFieldValue(controlFilePath(debianDir),
packageManagerNameFieldName(deviceType), false));
QLatin1String(packageManagerNameFieldName(deviceType)), false));
}
bool DebianManager::setPackageManagerName(const Utils::FileName &debianDir, Core::Id deviceType, const QString &name)
......@@ -507,7 +508,7 @@ bool DebianManager::setPackageManagerName(const Utils::FileName &debianDir, Core
QIcon DebianManager::packageManagerIcon(const Utils::FileName &debianDir, QString *error)
{
const QByteArray &base64Icon
= controlFileFieldValue(controlFilePath(debianDir), IconFieldName, true);
= controlFileFieldValue(controlFilePath(debianDir), QLatin1String(IconFieldName), true);
if (base64Icon.isEmpty())
return QIcon();
QPixmap pixmap;
......@@ -545,7 +546,7 @@ bool DebianManager::setPackageManagerIcon(const Utils::FileName &debianDir, Core
buffer.close();
iconAsBase64 = iconAsBase64.toBase64();
QByteArray contents = reader.data();
const QByteArray iconFieldNameWithColon = IconFieldName + ':';
const QByteArray iconFieldNameWithColon = QByteArray(IconFieldName) + ':';
const int iconFieldPos = contents.startsWith(iconFieldNameWithColon)
? 0 : contents.indexOf('\n' + iconFieldNameWithColon);
if (iconFieldPos == -1) {
......@@ -672,7 +673,7 @@ QStringList DebianManager::debianFiles(const Utils::FileName &debianDir)
Utils::FileName DebianManager::debianDirectory(ProjectExplorer::Target *target)
{
Utils::FileName path = Utils::FileName::fromString(target->project()->projectDirectory());
path.appendPath(PackagingDirName);
path.appendPath(QLatin1String(PackagingDirName));
Core::Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(target->kit());
if (deviceType == HarmattanOsType)
path.appendPath(QLatin1String("debian_harmattan"));
......@@ -709,19 +710,19 @@ void DebianManager::changelogWasChanged()
Utils::FileName DebianManager::changelogFilePath(const Utils::FileName &debianDir)
{
Utils::FileName result = debianDir;
return result.appendPath("changelog");
return result.appendPath(QLatin1String("changelog"));
}
Utils::FileName DebianManager::controlFilePath(const Utils::FileName &debianDir)
{
Utils::FileName result = debianDir;
return result.appendPath("control");
return result.appendPath(QLatin1String("control"));
}
Utils::FileName DebianManager::rulesFilePath(const Utils::FileName &debianDir)
{
Utils::FileName result = debianDir;
return result.appendPath("rules");
return result.appendPath(QLatin1String("rules"));
}
} // namespace Internal
......
......@@ -108,5 +108,4 @@ FORMS += \
maemodeviceconfigwizardkeydeploymentpage.ui
RESOURCES += qt-maemo.qrc
DEFINES += QT_NO_CAST_TO_ASCII
DEFINES += MADDE_LIBRARY
DEFINES += MADDE_LIBRARY QT_NO_CAST_FROM_ASCII
......@@ -13,7 +13,7 @@ QtcPlugin {
Depends { name: "Qt.gui" }
Depends { name: "cpp" }
cpp.defines: base.concat(['QT_NO_CAST_TO_ASCII'])
cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
files: [
"debianmanager.cpp",
......
......@@ -214,7 +214,7 @@ void MaddeDeviceTester::handleQmlToolingTestFinished(int exitStatus)
m_result = TestFailure;
} else if (m_processRunner->processExitCode() != 0) {
emit errorMessage(tr("Missing directory '%1'. You will not be able to do "
"QML debugging on this device.\n").arg(QmlToolingDirectory));
"QML debugging on this device.\n").arg(QLatin1String(QmlToolingDirectory)));
m_result = TestFailure;
} else {
emit progressMessage(tr("QML tooling support present.\n"));
......
......@@ -72,14 +72,14 @@ QList<Core::Id> MaemoDeployStepFactory::availableCreationIds(BuildStepList *pare
if (version)
platform = version->platformName();
if (platform == QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM) {
if (platform == QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) {
ids << MaemoMakeInstallToSysrootStep::Id
<< MaemoInstallDebianPackageToSysrootStep::Id
<< MaemoUploadAndInstallPackageStep::stepId()
<< MaemoInstallPackageViaMountStep::stepId()
<< MaemoCopyFilesViaMountStep::stepId()
<< MaddeQemuStartStep::stepId();
} else if (platform == QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM) {
} else if (platform == QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) {
ids << MaemoMakeInstallToSysrootStep::Id
<< MaemoInstallDebianPackageToSysrootStep::Id
<< MaemoUploadAndInstallPackageStep::stepId()
......
......@@ -378,7 +378,7 @@ bool MaemoDebianPackageCreationStep::copyDebianFiles(bool inSourceBuild)
return false;
}
QDir buildDir(cachedPackageDirectory());
if (!buildDir.mkdir("debian")) {
if (!buildDir.mkdir(QLatin1String("debian"))) {
raiseError(tr("Could not create Debian directory '%1'.").arg(debianDirPath));
return false;
}
......
......@@ -188,7 +188,7 @@ void MaemoPackageCreationWidget::setPackageManagerIcon()
QString imageFilter = tr("Images") + QLatin1String("( ");
const QList<QByteArray> &imageTypes = QImageReader::supportedImageFormats();
foreach (const QByteArray &imageType, imageTypes)
imageFilter += "*." + QString::fromLatin1(imageType) + QLatin1Char(' ');
imageFilter += QLatin1String("*.") + QLatin1String(imageType) + QLatin1Char(' ');
imageFilter += QLatin1Char(')');
const QSize iconSize = MaddeDevice::packageManagerIconSize(deviceType);
const QString iconFileName = QFileDialog::getOpenFileName(this,
......
......@@ -83,8 +83,8 @@ MaemoQemuManager::MaemoQemuManager(QObject *parent)
, m_runtimeRootWatcher(0)
, m_runtimeFolderWatcher(0)
{
m_qemuStarterIcon.addFile(":/qt-maemo/images/qemu-run.png", iconSize);
m_qemuStarterIcon.addFile(":/qt-maemo/images/qemu-stop.png", iconSize,
m_qemuStarterIcon.addFile(QLatin1String(":/qt-maemo/images/qemu-run.png"), iconSize);
m_qemuStarterIcon.addFile(QLatin1String(":/qt-maemo/images/qemu-stop.png"), iconSize,
QIcon::Normal, QIcon::On);
m_qemuAction = new QAction(tr("MeeGo Emulator"), this);
......
......@@ -95,7 +95,7 @@ MaemoQemuRuntime MaemoQemuRuntimeParser::parseRuntime(const QtSupport::BaseQtVer
return runtime;
if (!madProc.waitForStarted() || !madProc.waitForFinished())
return runtime;
const QByteArray &madInfoOutput = madProc.readAllStandardOutput();
QString madInfoOutput = QString::fromLocal8Bit(madProc.readAllStandardOutput());
const QString &targetName = MaemoGlobal::targetName(qtVersion->qmakeCommand().toString());
runtime = MaemoQemuRuntimeParserV2(madInfoOutput, targetName, maddeRootPath)
.parseRuntime();
......@@ -128,7 +128,7 @@ MaemoQemuRuntime MaemoQemuRuntimeParserV1::parseRuntime()
&& m_madInfoReader.name() == QLatin1String("target")) {
const QXmlStreamAttributes &attrs = m_madInfoReader.attributes();
if (attrs.value(QLatin1String("target_id")) == m_targetName)
targetRuntime = attrs.value("runtime_id").toString();
targetRuntime = attrs.value(QLatin1String("runtime_id")).toString();
} else if (m_madInfoReader.name() == QLatin1String("runtime")) {
const QXmlStreamAttributes attrs = m_madInfoReader.attributes();
while (!m_madInfoReader.atEnd()) {
......
......@@ -77,7 +77,7 @@ void MaemoQtVersion::fromMap(const QVariantMap &map)
QString MaemoQtVersion::type() const
{
return QtSupport::Constants::MAEMOQT;
return QLatin1String(QtSupport::Constants::MAEMOQT);
}
bool MaemoQtVersion::isValid() const
......@@ -168,15 +168,15 @@ void MaemoQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Envi
// Needed to make pkg-config stuff work.
Utils::FileName sysRoot = ProjectExplorer::SysRootKitInformation::sysRoot(k);
env.prependOrSet(QLatin1String("SYSROOT_DIR"), sysRoot.toUserOutput());
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/madbin")
.arg(maddeRoot)));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib")
env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/madlib")
.arg(maddeRoot)));
env.prependOrSet(QLatin1String("PERL5LIB"),
QDir::toNativeSeparators(QString("%1/madlib/perl5").arg(maddeRoot)));
QDir::toNativeSeparators(QString::fromLatin1("%1/madlib/perl5").arg(maddeRoot)));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin").arg(maddeRoot)));
env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/bin").arg(maddeRoot)));
env.prependOrSetPath(QDir::toNativeSeparators(QString::fromLatin1("%1/bin")
.arg(MaemoGlobal::targetRoot(qmakeCommand().toString()))));
// Actually this is tool chain related, but since we no longer have a tool chain...
......
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