Commit eccc1198 authored by Christian Kandeler's avatar Christian Kandeler

Use double quotes instead of single quotes as per our guidelines.

Change-Id: Ib608bb49e26781aef1914085a5d801fcdcd5eb56
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@digia.com>
parent c20f40e1
......@@ -120,7 +120,7 @@ bool OptionsParser::checkForTestOption()
if (m_pmPrivate->containsTestSpec(spec)) {
if (m_errorString)
*m_errorString = QCoreApplication::translate("PluginManager",
"The plugin '%1' is specified twice for testing.").arg(pluginName);
"The plugin \"%1\" is specified twice for testing.").arg(pluginName);
m_hasError = true;
} else {
m_pmPrivate->testSpecs.append(PluginManagerPrivate::TestSpec(spec, args));
......@@ -128,7 +128,7 @@ bool OptionsParser::checkForTestOption()
} else {
if (m_errorString)
*m_errorString = QCoreApplication::translate("PluginManager",
"The plugin '%1' does not exist.").arg(pluginName);
"The plugin \"%1\" does not exist.").arg(pluginName);
m_hasError = true;
}
}
......@@ -145,7 +145,7 @@ bool OptionsParser::checkForLoadOption()
if (!spec) {
if (m_errorString)
*m_errorString = QCoreApplication::translate("PluginManager",
"The plugin '%1' does not exist.")
"The plugin \"%1\" does not exist.")
.arg(m_currentArg);
m_hasError = true;
} else {
......@@ -165,7 +165,7 @@ bool OptionsParser::checkForNoLoadOption()
if (!spec) {
if (m_errorString)
*m_errorString = QCoreApplication::translate("PluginManager",
"The plugin '%1' does not exist.").arg(m_currentArg);
"The plugin \"%1\" does not exist.").arg(m_currentArg);
m_hasError = true;
} else {
spec->setForceDisabled(true);
......
......@@ -588,22 +588,22 @@ bool PluginSpecPrivate::reportError(const QString &err)
static inline QString msgAttributeMissing(const char *elt, const char *attribute)
{
return QCoreApplication::translate("PluginSpec", "'%1' misses attribute '%2'").arg(QLatin1String(elt), QLatin1String(attribute));
return QCoreApplication::translate("PluginSpec", "\"%1\" misses attribute \"%2\"").arg(QLatin1String(elt), QLatin1String(attribute));
}
static inline QString msgInvalidFormat(const char *content)
{
return QCoreApplication::translate("PluginSpec", "'%1' has invalid format").arg(QLatin1String(content));
return QCoreApplication::translate("PluginSpec", "\"%1\" has invalid format").arg(QLatin1String(content));
}
static inline QString msgInvalidElement(const QString &name)
{
return QCoreApplication::translate("PluginSpec", "Invalid element '%1'").arg(name);
return QCoreApplication::translate("PluginSpec", "Invalid element \"%1\"").arg(name);
}
static inline QString msgUnexpectedClosing(const QString &name)
{
return QCoreApplication::translate("PluginSpec", "Unexpected closing element '%1'").arg(name);
return QCoreApplication::translate("PluginSpec", "Unexpected closing element \"%1\"").arg(name);
}
static inline QString msgUnexpectedToken()
......@@ -617,7 +617,7 @@ static inline QString msgUnexpectedToken()
void PluginSpecPrivate::readPluginSpec(QXmlStreamReader &reader)
{
if (reader.name() != QLatin1String(PLUGIN)) {
reader.raiseError(QCoreApplication::translate("PluginSpec", "Expected element '%1' as top level element")
reader.raiseError(QCoreApplication::translate("PluginSpec", "Expected element \"%1\" as top level element")
.arg(QLatin1String(PLUGIN)));
return;
}
......
......@@ -398,7 +398,7 @@ void PluginDumper::loadQmltypesFile(const QStringList &qmltypesFilePaths,
QList<ModuleApiInfo> newModuleApis;
CppQmlTypesLoader::parseQmlTypeDescriptions(reader.data(), &newObjects, &newModuleApis, &error, &warning, qmltypesFilePath);
if (!error.isEmpty()) {
errors += tr("Failed to parse '%1'.\nError: %2").arg(qmltypesFilePath, error);
errors += tr("Failed to parse \"%1\".\nError: %2").arg(qmltypesFilePath, error);
} else {
objects += newObjects.values();
moduleApis += newModuleApis;
......
......@@ -63,7 +63,7 @@ public:
static inline QString msgInvalidConstructor(const char *what)
{
return StaticAnalysisMessages::tr("Do not use '%1' as a constructor.").arg(QLatin1String(what));
return StaticAnalysisMessages::tr("Do not use \"%1\" as a constructor.").arg(QLatin1String(what));
}
StaticAnalysisMessages::StaticAnalysisMessages()
......@@ -97,11 +97,11 @@ StaticAnalysisMessages::StaticAnalysisMessages()
newMsg(ErrDuplicateId, Error,
tr("Duplicate id."));
newMsg(ErrInvalidPropertyName, Error,
tr("Invalid property name '%1'."), 1);
tr("Invalid property name \"%1\"."), 1);
newMsg(ErrDoesNotHaveMembers, Error,
tr("'%1' does not have members."), 1);
tr("\"%1\" does not have members."), 1);
newMsg(ErrInvalidMember, Error,
tr("'%1' is not a member of '%2'."), 2);
tr("\"%1\" is not a member of \"%2\"."), 2);
newMsg(WarnAssignmentInCondition, Warning,
tr("Assignment in condition."));
newMsg(WarnCaseWithoutFlowControl, Warning,
......@@ -115,19 +115,19 @@ StaticAnalysisMessages::StaticAnalysisMessages()
newMsg(WarnComma, Warning,
tr("Do not use comma expressions."));
newMsg(WarnAlreadyFormalParameter, Warning,
tr("'%1' already is a formal parameter."), 1);
tr("\"%1\" already is a formal parameter."), 1);
newMsg(WarnUnnecessaryMessageSuppression, Warning,
tr("Unnecessary message suppression."));
newMsg(WarnAlreadyFunction, Warning,
tr("'%1' already is a function."), 1);
tr("\"%1\" already is a function."), 1);
newMsg(WarnVarUsedBeforeDeclaration, Warning,
tr("var '%1' is used before its declaration."), 1);
tr("var \"%1\" is used before its declaration."), 1);
newMsg(WarnAlreadyVar, Warning,
tr("'%1' already is a var."), 1);
tr("\"%1\" already is a var."), 1);
newMsg(WarnDuplicateDeclaration, Warning,
tr("'%1' is declared more than once."), 1);
tr("\"%1\" is declared more than once."), 1);
newMsg(WarnFunctionUsedBeforeDeclaration, Warning,
tr("Function '%1' is used before its declaration."), 1);
tr("Function \"%1\" is used before its declaration."), 1);
newMsg(WarnBooleanConstructor, Warning,
msgInvalidConstructor("Boolean"));
newMsg(WarnStringConstructor, Warning,
......@@ -163,13 +163,13 @@ StaticAnalysisMessages::StaticAnalysisMessages()
newMsg(ErrUnknownComponent, Error,
tr("Unknown component."));
newMsg(ErrCouldNotResolvePrototypeOf, Error,
tr("Could not resolve the prototype '%1' of '%2'."), 2);
tr("Could not resolve the prototype \"%1\" of \"%2\"."), 2);
newMsg(ErrCouldNotResolvePrototype, Error,
tr("Could not resolve the prototype '%1'."), 1);
tr("Could not resolve the prototype \"%1\"."), 1);
newMsg(ErrPrototypeCycle, Error,
tr("Prototype cycle, the last non-repeated component is '%1'."), 1);
tr("Prototype cycle, the last non-repeated component is \"%1\"."), 1);
newMsg(ErrInvalidPropertyType, Error,
tr("Invalid property type '%1'."), 1);
tr("Invalid property type \"%1\"."), 1);
newMsg(WarnEqualityTypeCoercion, Error,
tr("== and != perform type coercion, use === or !== to avoid it."));
newMsg(WarnExpectedNewWithUppercaseFunction, Error,
......@@ -185,7 +185,7 @@ StaticAnalysisMessages::StaticAnalysisMessages()
newMsg(HintPreferNonVarPropertyType, Hint,
tr("Use %1 instead of 'var' or 'variant' to improve performance."), 1);
newMsg(ErrMissingRequiredProperty, Error,
tr("Missing property '%1'."), 1);
tr("Missing property \"%1\"."), 1);
newMsg(ErrObjectValueExpected, Error,
tr("Object value expected."));
newMsg(ErrArrayValueExpected, Error,
......
......@@ -197,7 +197,7 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast)
readEnum(component, fmo);
else
addWarning(component->firstSourceLocation(),
tr("Expected only Property, Method, Signal and Enum object definitions, not '%1'.")
tr("Expected only Property, Method, Signal and Enum object definitions, not \"%1\".")
.arg(name));
} else if (script) {
QString name = toString(script->qualifiedId);
......@@ -223,7 +223,7 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast)
addWarning(script->firstSourceLocation(),
tr("Expected only name, prototype, defaultProperty, attachedType, exports "
"isSingleton, isCreatable, isComposite and exportMetaObjectRevisions "
"script bindings, not '%1'.").arg(name));
"script bindings, not \"%1\".").arg(name));
}
} else {
addWarning(member->firstSourceLocation(), tr("Expected only script bindings and object definitions."));
......
......@@ -502,14 +502,14 @@ void SftpChannelPrivate::handleMkdirStatus(const JobMap::Iterator &it,
const QString &remoteDir = dirIt.value().remoteDir;
if (response.status == SSH_FX_OK) {
emit dataAvailable(op->parentJob->jobId,
tr("Created remote directory '%1'.").arg(remoteDir));
tr("Created remote directory \"%1\".").arg(remoteDir));
} else if (response.status == SSH_FX_FAILURE) {
emit dataAvailable(op->parentJob->jobId,
tr("Remote directory '%1' already exists.").arg(remoteDir));
tr("Remote directory \"%1\" already exists.").arg(remoteDir));
} else {
op->parentJob->setError();
emit finished(op->parentJob->jobId,
tr("Error creating directory '%1': %2")
tr("Error creating directory \"%1\": %2")
.arg(remoteDir, response.errorString));
m_jobs.erase(it);
return;
......@@ -533,7 +533,7 @@ void SftpChannelPrivate::handleMkdirStatus(const JobMap::Iterator &it,
if (!localFile->open(QIODevice::ReadOnly)) {
op->parentJob->setError();
emit finished(op->parentJob->jobId,
tr("Could not open local file '%1': %2")
tr("Could not open local file \"%1\": %2")
.arg(fileInfo.absoluteFilePath(), localFile->errorString()));
m_jobs.erase(it);
return;
......
......@@ -358,7 +358,7 @@ void SftpFileSystemModel::handleSftpJobFinished(SftpJobId jobId, const QString &
if (jobId == d->statJobId) {
d->statJobId = SftpInvalidJob;
if (!errorMessage.isEmpty())
emit sftpOperationFailed(tr("Error getting 'stat' info about '%1': %2")
emit sftpOperationFailed(tr("Error getting \"stat\" info about \"%1\": %2")
.arg(rootDirectory(), errorMessage));
return;
}
......@@ -368,7 +368,7 @@ void SftpFileSystemModel::handleSftpJobFinished(SftpJobId jobId, const QString &
QSSH_ASSERT(it.value()->lsState == SftpDirNode::LsRunning);
it.value()->lsState = SftpDirNode::LsFinished;
if (!errorMessage.isEmpty())
emit sftpOperationFailed(tr("Error listing contents of directory '%1': %2")
emit sftpOperationFailed(tr("Error listing contents of directory \"%1\": %2")
.arg(it.value()->path, errorMessage));
d->lsOps.erase(it);
return;
......
......@@ -384,14 +384,14 @@ void SshConnectionPrivate::handleServerId()
if (!versionIdpattern.exactMatch(QString::fromLatin1(m_serverId))) {
throw SshServerException(SSH_DISCONNECT_PROTOCOL_ERROR,
"Identification string is invalid.",
tr("Server Identification string '%1' is invalid.")
tr("Server Identification string \"%1\" is invalid.")
.arg(QString::fromLatin1(m_serverId)));
}
const QString serverProtoVersion = versionIdpattern.cap(1);
if (serverProtoVersion != QLatin1String("2.0") && serverProtoVersion != QLatin1String("1.99")) {
throw SshServerException(SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED,
"Invalid protocol version.",
tr("Server protocol version is '%1', but needs to be 2.0 or 1.99.")
tr("Server protocol version is \"%1\", but needs to be 2.0 or 1.99.")
.arg(serverProtoVersion));
}
......
......@@ -115,7 +115,7 @@ void SshKeyCreationDialog::saveKeys()
const QString parentDir = QFileInfo(privateKeyFilePath()).dir().path();
if (!QDir::root().mkpath(parentDir)) {
QMessageBox::critical(this, tr("Cannot Save Key File"),
tr("Failed to create directory: '%1'.").arg(parentDir));
tr("Failed to create directory: \"%1\".").arg(parentDir));
return;
}
......
......@@ -381,7 +381,7 @@ void SshRemoteProcessPrivate::handleExitSignal(const SshChannelExitSignal &signa
}
throw SshServerException(SSH_DISCONNECT_PROTOCOL_ERROR, "Invalid signal",
tr("Server sent invalid signal '%1'").arg(QString::fromUtf8(signal.signal)));
tr("Server sent invalid signal \"%1\"").arg(QString::fromUtf8(signal.signal)));
}
} // namespace Internal
......
......@@ -248,7 +248,7 @@ static bool runBuildProcess(QProcess &proc,
}
*errorMessage =
QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Error running '%1' in %2: %3").
"Error running \"%1\" in %2: %3").
arg(cmd, proc.workingDirectory(), *errorMessage);
qWarning("%s", qPrintable(*errorMessage));
}
......@@ -267,7 +267,7 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
proc.setProcessChannelMode(QProcess::MergedChannels);
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Building helper '%1' in %2\n").arg(arguments.helperName,
"Building helper \"%1\" in %2\n").arg(arguments.helperName,
arguments.directory));
log->append(newline);
......
......@@ -121,7 +121,7 @@ QString ConsoleProcess::msgCannotWriteTempFile()
QString ConsoleProcess::msgCannotCreateTempDir(const QString & dir, const QString &why)
{
return tr("Cannot create temporary directory '%1': %2").arg(dir, why);
return tr("Cannot create temporary directory \"%1\": %2").arg(dir, why);
}
QString ConsoleProcess::msgUnexpectedOutput(const QByteArray &what)
......@@ -131,12 +131,12 @@ QString ConsoleProcess::msgUnexpectedOutput(const QByteArray &what)
QString ConsoleProcess::msgCannotChangeToWorkDir(const QString & dir, const QString &why)
{
return tr("Cannot change to working directory '%1': %2").arg(dir, why);
return tr("Cannot change to working directory \"%1\": %2").arg(dir, why);
}
QString ConsoleProcess::msgCannotExecute(const QString & p, const QString &why)
{
return tr("Cannot execute '%1': %2").arg(p, why);
return tr("Cannot execute \"%1\": %2").arg(p, why);
}
QString ConsoleProcess::terminalEmulator(const QSettings *settings, bool nonEmpty)
......
......@@ -163,7 +163,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
d->m_process.start(xterm, allArgs);
if (!d->m_process.waitForStarted()) {
stubServerShutdown();
emit processError(tr("Cannot start the terminal emulator '%1', change the setting in the "
emit processError(tr("Cannot start the terminal emulator \"%1\", change the setting in the "
"Environment options.").arg(xterm));
delete d->m_tempFile;
d->m_tempFile = 0;
......@@ -247,7 +247,7 @@ QString ConsoleProcess::stubServerListen()
const QString stubServer = stubFifoDir + QLatin1String("/stub-socket");
if (!d->m_stubServer.listen(stubServer)) {
::rmdir(d->m_stubServerDir.constData());
return tr("Cannot create socket '%1': %2").arg(stubServer, d->m_stubServer.errorString());
return tr("Cannot create socket \"%1\": %2").arg(stubServer, d->m_stubServer.errorString());
}
return QString();
}
......
......@@ -146,7 +146,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
delete d->m_tempFile;
d->m_tempFile = 0;
stubServerShutdown();
emit processError(tr("The process '%1' could not be started: %2").arg(cmdLine, winErrorMessage(GetLastError())));
emit processError(tr("The process \"%1\" could not be started: %2").arg(cmdLine, winErrorMessage(GetLastError())));
return false;
}
......
......@@ -142,7 +142,7 @@ ElfData ElfReader::readHeaders()
static inline QString msgInvalidElfObject(const QString &binary, const QString &why)
{
return ElfReader::tr("'%1' is an invalid ELF object (%2)")
return ElfReader::tr("\"%1\" is an invalid ELF object (%2)")
.arg(QDir::toNativeSeparators(binary), why);
}
......@@ -160,12 +160,12 @@ ElfReader::Result ElfReader::readIt()
const quint64 fdlen = mapper.fdlen;
if (fdlen < 64) {
m_errorString = tr("'%1' is not an ELF object (file too small)").arg(QDir::toNativeSeparators(m_binary));
m_errorString = tr("\"%1\" is not an ELF object (file too small)").arg(QDir::toNativeSeparators(m_binary));
return NotElf;
}
if (strncmp(mapper.start, "\177ELF", 4) != 0) {
m_errorString = tr("'%1' is not an ELF object").arg(QDir::toNativeSeparators(m_binary));
m_errorString = tr("\"%1\" is not an ELF object").arg(QDir::toNativeSeparators(m_binary));
return NotElf;
}
......@@ -184,7 +184,7 @@ ElfReader::Result ElfReader::readIt()
// if ((sizeof(void*) == 4 && bits != 32)
// || (sizeof(void*) == 8 && bits != 64)) {
// if (errorString)
// *errorString = QLibrary::tr("'%1' is an invalid ELF object (%2)")
// *errorString = QLibrary::tr("\"%1\" is an invalid ELF object (%2)")
// .arg(m_binary).arg(QLatin1String("wrong cpu architecture"));
// return Corrupt;
// }
......@@ -238,7 +238,7 @@ ElfReader::Result ElfReader::readIt()
quint64 soff = e_shoff + e_shentsize * e_shtrndx;
// if ((soff + e_shentsize) > fdlen || soff % 4 || soff == 0) {
// m_errorString = QLibrary::tr("'%1' is an invalid ELF object (%2)")
// m_errorString = QLibrary::tr("\"%1\" is an invalid ELF object (%2)")
// .arg(m_binary)
// .arg(QLatin1String("shstrtab section header seems to be at %1"))
// .arg(QString::number(soff, 16));
......
......@@ -120,7 +120,7 @@ bool FileNameValidatingLineEdit::validateFileName(const QString &name,
if (qc.isSpace())
*errorMessage = tr("Name contains white space.");
else
*errorMessage = tr("Invalid character '%1'.").arg(qc);
*errorMessage = tr("Invalid character \"%1\".").arg(qc);
}
return false;
}
......@@ -130,7 +130,7 @@ bool FileNameValidatingLineEdit::validateFileName(const QString &name,
const QLatin1String notAllowedSubString(notAllowedSubStrings[s]);
if (name.contains(notAllowedSubString)) {
if (errorMessage)
*errorMessage = tr("Invalid characters '%1'.").arg(QString(notAllowedSubString));
*errorMessage = tr("Invalid characters \"%1\".").arg(QString(notAllowedSubString));
return false;
}
}
......
......@@ -99,7 +99,7 @@ bool FileUtils::removeRecursively(const FileName &filePath, QString *error)
}
if (!QDir::root().rmdir(dir.path())) {
if (error) {
*error = QCoreApplication::translate("Utils::FileUtils", "Failed to remove directory '%1'.")
*error = QCoreApplication::translate("Utils::FileUtils", "Failed to remove directory \"%1\".")
.arg(filePath.toUserOutput());
}
return false;
......@@ -107,7 +107,7 @@ bool FileUtils::removeRecursively(const FileName &filePath, QString *error)
} else {
if (!QFile::remove(filePath.toString())) {
if (error) {
*error = QCoreApplication::translate("Utils::FileUtils", "Failed to remove file '%1'.")
*error = QCoreApplication::translate("Utils::FileUtils", "Failed to remove file \"%1\".")
.arg(filePath.toUserOutput());
}
return false;
......@@ -142,7 +142,7 @@ bool FileUtils::copyRecursively(const FileName &srcFilePath, const FileName &tgt
targetDir.cdUp();
if (!targetDir.mkdir(tgtFilePath.toFileInfo().fileName())) {
if (error) {
*error = QCoreApplication::translate("Utils::FileUtils", "Failed to create directory '%1'.")
*error = QCoreApplication::translate("Utils::FileUtils", "Failed to create directory \"%1\".")
.arg(tgtFilePath.toUserOutput());
}
return false;
......@@ -161,7 +161,7 @@ bool FileUtils::copyRecursively(const FileName &srcFilePath, const FileName &tgt
} else {
if (!QFile::copy(srcFilePath.toString(), tgtFilePath.toString())) {
if (error) {
*error = QCoreApplication::translate("Utils::FileUtils", "Could not copy file '%1' to '%2'.")
*error = QCoreApplication::translate("Utils::FileUtils", "Could not copy file \"%1\" to \"%2\".")
.arg(srcFilePath.toUserOutput(), tgtFilePath.toUserOutput());
}
return false;
......
......@@ -502,13 +502,13 @@ bool NewClassWidget::isValid(QString *error) const
if (isHeaderInputVisible() && !d->m_ui.headerFileLineEdit->isValid()) {
if (error)
*error = tr("Invalid header file name: '%1'").arg(d->m_ui.headerFileLineEdit->errorMessage());
*error = tr("Invalid header file name: \"%1\"").arg(d->m_ui.headerFileLineEdit->errorMessage());
return false;
}
if (isSourceInputVisible() && !d->m_ui.sourceFileLineEdit->isValid()) {
if (error)
*error = tr("Invalid source file name: '%1'").arg(d->m_ui.sourceFileLineEdit->errorMessage());
*error = tr("Invalid source file name: \"%1\"").arg(d->m_ui.sourceFileLineEdit->errorMessage());
return false;
}
......@@ -516,7 +516,7 @@ bool NewClassWidget::isValid(QString *error) const
(!d->m_formInputCheckable || d->m_ui.generateFormCheckBox->isChecked())) {
if (!d->m_ui.formFileLineEdit->isValid()) {
if (error)
*error = tr("Invalid form file name: '%1'").arg(d->m_ui.formFileLineEdit->errorMessage());
*error = tr("Invalid form file name: \"%1\"").arg(d->m_ui.formFileLineEdit->errorMessage());
return false;
}
}
......
......@@ -472,7 +472,7 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
if (expandedPath.isEmpty()) {
if (errorMessage)
*errorMessage = tr("The path '%1' expanded to an empty string.").arg(QDir::toNativeSeparators(path));
*errorMessage = tr("The path \"%1\" expanded to an empty string.").arg(QDir::toNativeSeparators(path));
return false;
}
const QFileInfo fi(expandedPath);
......@@ -482,52 +482,52 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
case PathChooser::ExistingDirectory: // fall through
if (!fi.exists()) {
if (errorMessage)
*errorMessage = tr("The path '%1' does not exist.").arg(QDir::toNativeSeparators(expandedPath));
*errorMessage = tr("The path \"%1\" does not exist.").arg(QDir::toNativeSeparators(expandedPath));
return false;
}
if (!fi.isDir()) {
if (errorMessage)
*errorMessage = tr("The path '%1' is not a directory.").arg(QDir::toNativeSeparators(expandedPath));
*errorMessage = tr("The path \"%1\" is not a directory.").arg(QDir::toNativeSeparators(expandedPath));
return false;
}
break;
case PathChooser::File: // fall through
if (!fi.exists()) {
if (errorMessage)
*errorMessage = tr("The path '%1' does not exist.").arg(QDir::toNativeSeparators(expandedPath));
*errorMessage = tr("The path \"%1\" does not exist.").arg(QDir::toNativeSeparators(expandedPath));
return false;
}
break;
case PathChooser::SaveFile:
if (!fi.absoluteDir().exists()) {
if (errorMessage)
*errorMessage = tr("The directory '%1' does not exist.").arg(QDir::toNativeSeparators(fi.absolutePath()));
*errorMessage = tr("The directory \"%1\" does not exist.").arg(QDir::toNativeSeparators(fi.absolutePath()));
return false;
}
break;
case PathChooser::ExistingCommand:
if (!fi.exists()) {
if (errorMessage)
*errorMessage = tr("The path '%1' does not exist.").arg(QDir::toNativeSeparators(expandedPath));
*errorMessage = tr("The path \"%1\" does not exist.").arg(QDir::toNativeSeparators(expandedPath));
return false;
}
if (!fi.isExecutable()) {
if (errorMessage)
*errorMessage = tr("Cannot execute '%1'.").arg(QDir::toNativeSeparators(expandedPath));
*errorMessage = tr("Cannot execute \"%1\".").arg(QDir::toNativeSeparators(expandedPath));
return false;
}
break;
case PathChooser::Directory:
if (fi.exists() && !fi.isDir()) {
if (errorMessage)
*errorMessage = tr("The path '%1' is not a directory.").arg(QDir::toNativeSeparators(expandedPath));
*errorMessage = tr("The path \"%1\" is not a directory.").arg(QDir::toNativeSeparators(expandedPath));
return false;
}
break;
case PathChooser::Command: // fall through
if (fi.exists() && !fi.isExecutable()) {
if (errorMessage)
*errorMessage = tr("Cannot execute '%1'.").arg(QDir::toNativeSeparators(expandedPath));
*errorMessage = tr("Cannot execute \"%1\".").arg(QDir::toNativeSeparators(expandedPath));
return false;
}
break;
......
......@@ -48,7 +48,7 @@ bool ProjectNameValidatingLineEdit::validateProjectName(const QString &name, QSt
int pos = FileUtils::indexOfQmakeUnfriendly(name);
if (pos >= 0) {
if (errorMessage)
*errorMessage = tr("Invalid character '%1' found!").arg(name.at(pos));
*errorMessage = tr("Invalid character \"%1\" found!").arg(name.at(pos));
return false;
}
if (name.contains(QLatin1Char('.'))) {
......
......@@ -127,15 +127,15 @@ QString SynchronousProcessResponse::exitMessage(const QString &binary, int timeo
{
switch (result) {
case Finished:
return SynchronousProcess::tr("The command '%1' finished successfully.").arg(QDir::toNativeSeparators(binary));
return SynchronousProcess::tr("The command \"%1\" finished successfully.").arg(QDir::toNativeSeparators(binary));
case FinishedError:
return SynchronousProcess::tr("The command '%1' terminated with exit code %2.").arg(QDir::toNativeSeparators(binary)).arg(exitCode);
return SynchronousProcess::tr("The command \"%1\" terminated with exit code %2.").arg(QDir::toNativeSeparators(binary)).arg(exitCode);
case TerminatedAbnormally:
return SynchronousProcess::tr("The command '%1' terminated abnormally.").arg(QDir::toNativeSeparators(binary));
return SynchronousProcess::tr("The command \"%1\" terminated abnormally.").arg(QDir::toNativeSeparators(binary));
case StartFailed:
return SynchronousProcess::tr("The command '%1' could not be started.").arg(QDir::toNativeSeparators(binary));
return SynchronousProcess::tr("The command \"%1\" could not be started.").arg(QDir::toNativeSeparators(binary));
case Hang:
return SynchronousProcess::tr("The command '%1' did not respond within the timeout limit (%2 ms).").
return SynchronousProcess::tr("The command \"%1\" did not respond within the timeout limit (%2 ms).").
arg(QDir::toNativeSeparators(binary)).arg(timeoutMS);
}
return QString();
......@@ -432,7 +432,7 @@ static inline bool askToKill(const QString &binary = QString())
const QString title = SynchronousProcess::tr("Process not Responding");
QString msg = binary.isEmpty() ?
SynchronousProcess::tr("The process is not responding.") :
SynchronousProcess::tr("The process '%1' is not responding.").arg(QDir::toNativeSeparators(binary));
SynchronousProcess::tr("The process \"%1\" is not responding.").arg(QDir::toNativeSeparators(binary));
msg += QLatin1Char(' ');
msg += SynchronousProcess::tr("Would you like to terminate it?");
// Restore the cursor that is set to wait while running.
......