forked from qt-creator/qt-creator
Fix warnings/messages in QmlApp.
Do not translate warnings, use qWarning().nospace() consistently. Fix message. Change-Id: I4f278b4e3b5fdfadf81cdae45520a132da83aa86 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -208,7 +208,7 @@ QList<TemplateInfo> QmlApp::templateInfos()
|
|||||||
const QString templatePath = templateRootDirectory() + templateName;
|
const QString templatePath = templateRootDirectory() + templateName;
|
||||||
QFile xmlFile(templatePath + QLatin1String("/template.xml"));
|
QFile xmlFile(templatePath + QLatin1String("/template.xml"));
|
||||||
if (!xmlFile.open(QIODevice::ReadOnly)) {
|
if (!xmlFile.open(QIODevice::ReadOnly)) {
|
||||||
qDebug() << "Cannot open" << QFileInfo(xmlFile.fileName()).absoluteFilePath();
|
qWarning().nospace() << QString::fromLatin1("Cannot open %1").arg(QDir::toNativeSeparators(QFileInfo(xmlFile.fileName()).absoluteFilePath());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
TemplateInfo info;
|
TemplateInfo info;
|
||||||
@@ -271,7 +271,7 @@ QString QmlApp::readAndAdaptTemplateFile(const QString &filePath, bool &ok) cons
|
|||||||
replaceXWithYString.replace(QRegExp(QLatin1String(" -->$")), QString());
|
replaceXWithYString.replace(QRegExp(QLatin1String(" -->$")), QString());
|
||||||
const QStringList replaceXWithY = replaceXWithYString.split(markerWith);
|
const QStringList replaceXWithY = replaceXWithYString.split(markerWith);
|
||||||
if (replaceXWithY.count() != 2) {
|
if (replaceXWithY.count() != 2) {
|
||||||
qWarning() << QCoreApplication::translate("QmlApplicationWizard", "Error in %1:%2. Invalid %3 options.")
|
qWarning().nospace() << QString::fromLatin1("QmlApplicationWizard", "Error in %1:%2. Invalid %3 options.")
|
||||||
.arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(markerQtcReplace);
|
.arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(markerQtcReplace);
|
||||||
ok = false;
|
ok = false;
|
||||||
return QString();
|
return QString();
|
||||||
@@ -279,7 +279,7 @@ QString QmlApp::readAndAdaptTemplateFile(const QString &filePath, bool &ok) cons
|
|||||||
const QString replaceWhat = replaceXWithY.at(0).trimmed();
|
const QString replaceWhat = replaceXWithY.at(0).trimmed();
|
||||||
const QString replaceWith = replaceXWithY.at(1).trimmed();
|
const QString replaceWith = replaceXWithY.at(1).trimmed();
|
||||||
if (!m_replacementVariables.contains(replaceWith)) {
|
if (!m_replacementVariables.contains(replaceWith)) {
|
||||||
qWarning() << QCoreApplication::translate("QmlApplicationWizard", "Error in %1:%2. Unknown %3 option '%4'.")
|
qWarning().nospace() << QString::fromLatin1("QmlApplicationWizard", "Error in %1:%2. Unknown %3 option '%4'.")
|
||||||
.arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(markerQtcReplace).arg(replaceWith);
|
.arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(markerQtcReplace).arg(replaceWith);
|
||||||
ok = false;
|
ok = false;
|
||||||
return QString();
|
return QString();
|
||||||
@@ -287,7 +287,7 @@ QString QmlApp::readAndAdaptTemplateFile(const QString &filePath, bool &ok) cons
|
|||||||
line = tsIn.readLine(); // Following line which is to be patched.
|
line = tsIn.readLine(); // Following line which is to be patched.
|
||||||
lineNr++;
|
lineNr++;
|
||||||
if (line.indexOf(replaceWhat) < 0) {
|
if (line.indexOf(replaceWhat) < 0) {
|
||||||
qWarning() << QCoreApplication::translate("QmlApplicationWizard", "Error in %1:%2. Replacement '%3' not found.")
|
qWarning().nospace() << QString::fromLatin1("QmlApplicationWizard", "Error in %1:%2. Replacement '%3' not found.")
|
||||||
.arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(replaceWhat);
|
.arg(QDir::toNativeSeparators(filePath)).arg(lineNr).arg(replaceWhat);
|
||||||
ok = false;
|
ok = false;
|
||||||
return QString();
|
return QString();
|
||||||
@@ -343,7 +343,7 @@ bool QmlApp::addBinaryFile(const QString &sourceDirectory,
|
|||||||
|
|
||||||
if (!fileIsReadable) {
|
if (!fileIsReadable) {
|
||||||
if (errorMessage)
|
if (errorMessage)
|
||||||
*errorMessage = QCoreApplication::translate("QmlApplicationWizard", "Failed to file %1.").arg(templateFileName);
|
*errorMessage = QCoreApplication::translate("QmlApplicationWizard", "Failed to read file %1.").arg(templateFileName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user