Commit d75c5fa2 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

sanitize some tr() calls

parent bbaf7893
......@@ -615,13 +615,13 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
// check for circular dependencies
if (circularityCheckQueue.contains(spec)) {
spec->d->hasError = true;
spec->d->errorString = q->tr("Circular dependency detected:\n");
spec->d->errorString = PluginManager::tr("Circular dependency detected:\n");
int index = circularityCheckQueue.indexOf(spec);
for (int i = index; i < circularityCheckQueue.size(); ++i) {
spec->d->errorString.append(q->tr("%1(%2) depends on\n")
spec->d->errorString.append(PluginManager::tr("%1(%2) depends on\n")
.arg(circularityCheckQueue.at(i)->name()).arg(circularityCheckQueue.at(i)->version()));
}
spec->d->errorString.append(q->tr("%1(%2)").arg(spec->name()).arg(spec->version()));
spec->d->errorString.append(PluginManager::tr("%1(%2)").arg(spec->name()).arg(spec->version()));
return false;
}
circularityCheckQueue.append(spec);
......@@ -629,7 +629,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
if (spec->state() == PluginSpec::Invalid || spec->state() == PluginSpec::Read) {
spec->d->hasError = true;
spec->d->errorString += "\n";
spec->d->errorString += q->tr("Cannot load plugin because dependencies are not resolved");
spec->d->errorString += PluginManager::tr("Cannot load plugin because dependencies are not resolved");
return false;
}
// add dependencies
......@@ -637,7 +637,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec, QList<PluginSpec *> &queu
if (!loadQueue(depSpec, queue, circularityCheckQueue)) {
spec->d->hasError = true;
spec->d->errorString =
q->tr("Cannot load plugin because dependency failed to load: %1(%2)\nReason: %3")
PluginManager::tr("Cannot load plugin because dependency failed to load: %1(%2)\nReason: %3")
.arg(depSpec->name()).arg(depSpec->version()).arg(depSpec->errorString());
return false;
}
......@@ -666,7 +666,7 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
if (depSpec->state() != destState) {
spec->d->hasError = true;
spec->d->errorString =
q->tr("Cannot load plugin because dependency failed to load: %1(%2)\nReason: %3")
PluginManager::tr("Cannot load plugin because dependency failed to load: %1(%2)\nReason: %3")
.arg(depSpec->name()).arg(depSpec->version()).arg(depSpec->errorString());
return;
}
......
......@@ -128,7 +128,7 @@ void CommandPrivate::setCategory(const QString &name)
QString CommandPrivate::category() const
{
if (m_category.isEmpty())
return QObject::tr("Other");
return tr("Other");
return m_category;
}
......
......@@ -301,8 +301,8 @@ QList<IFile *> FileManager::saveModifiedFiles(const QList<IFile *> &files,
static QMessageBox::StandardButton skipFailedPrompt(QWidget *parent, const QString &fileName)
{
return QMessageBox::question(parent,
QObject::tr("Can't save file"),
QObject::tr("Can't save changes to '%1'. Do you want to continue and loose your changes?").arg(fileName),
FileManager::tr("Can't save file"),
FileManager::tr("Can't save changes to '%1'. Do you want to continue and loose your changes?").arg(fileName),
QMessageBox::YesToAll| QMessageBox::Yes|QMessageBox::No,
QMessageBox::No);
}
......
......@@ -234,7 +234,7 @@ bool ScriptManagerPrivate::runScript(const QString &script, QString *errorMessag
const QStringList backTrace = m_engine.uncaughtExceptionBacktrace();
parseBackTrace(backTrace, *stack);
const QString backtrace = backTrace.join(QString(QLatin1Char('\n')));
*errorMessage = QObject::tr("Exception at line %1: %2\n%3").arg(errorLineNumber).arg(engineError(m_engine)).arg(backtrace);
*errorMessage = ScriptManager::tr("Exception at line %1: %2\n%3").arg(errorLineNumber).arg(engineError(m_engine)).arg(backtrace);
}
m_engine.popContext();
return !failed;
......@@ -301,7 +301,7 @@ QString ScriptManagerPrivate::engineError(QScriptEngine &scriptEngine)
QScriptValue error = scriptEngine.evaluate(QLatin1String("Error"));
if (error.isValid())
return error.toString();
return QObject::tr("Unknown error");
return ScriptManager::tr("Unknown error");
}
} // namespace Internal
......
......@@ -69,7 +69,7 @@ bool DebuggerRunner::canRun(RunConfigurationPtr runConfiguration, const QString
QString DebuggerRunner::displayName() const
{
return QObject::tr("Debug");
return tr("Debug");
}
RunControl* DebuggerRunner::run(RunConfigurationPtr runConfiguration, const QString &mode)
......
......@@ -85,7 +85,7 @@ bool ApplicationRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration>
QString ApplicationRunConfigurationRunner::displayName() const
{
return QObject::tr("Run");
return tr("Run");
}
RunControl* ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
......
......@@ -616,8 +616,8 @@ BookmarkManager::BookmarkManager(QHelpEngineCore* _helpEngine)
, helpEngine(_helpEngine)
{
folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon);
treeModel->setHeaderData(0, Qt::Horizontal, QObject::tr("Bookmark"));
listModel->setHeaderData(0, Qt::Horizontal, QObject::tr("Bookmark"));
treeModel->setHeaderData(0, Qt::Horizontal, tr("Bookmark"));
listModel->setHeaderData(0, Qt::Horizontal, tr("Bookmark"));
connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this,
SLOT(itemChanged(QStandardItem*)));
......
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