Commit ac9a3bc9 authored by Friedemann Kleint's avatar Friedemann Kleint

tr()-fixes for 2.3.

Change-Id: I38345500156ce6fa4eb747562a3f9434040615ff
Reviewed-on: http://codereview.qt.nokia.com/473Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 140eaaab
......@@ -51,7 +51,7 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT FileReader
{
Q_DECLARE_TR_FUNCTIONS(FileUtils) // sic!
Q_DECLARE_TR_FUNCTIONS(Utils::FileUtils) // sic!
public:
static QByteArray fetchQrc(const QString &fileName); // Only for internal resources
bool fetch(const QString &fileName, QIODevice::OpenMode mode = QIODevice::NotOpen); // QIODevice::ReadOnly is implicit
......@@ -70,7 +70,7 @@ private:
class QTCREATOR_UTILS_EXPORT FileSaverBase
{
Q_DECLARE_TR_FUNCTIONS(FileUtils) // sic!
Q_DECLARE_TR_FUNCTIONS(Utils::FileUtils) // sic!
public:
FileSaverBase();
virtual ~FileSaverBase();
......@@ -101,6 +101,7 @@ private:
class QTCREATOR_UTILS_EXPORT FileSaver : public FileSaverBase
{
Q_DECLARE_TR_FUNCTIONS(Utils::FileUtils) // sic!
public:
explicit FileSaver(const QString &filename, QIODevice::OpenMode mode = QIODevice::NotOpen); // QIODevice::WriteOnly is implicit
......@@ -115,6 +116,7 @@ private:
class QTCREATOR_UTILS_EXPORT TempFileSaver : public FileSaverBase
{
Q_DECLARE_TR_FUNCTIONS(Utils::FileUtils) // sic!
public:
explicit TempFileSaver(const QString &templ = QString());
~TempFileSaver();
......
......@@ -41,6 +41,7 @@
#include <QtCore/QStringList>
#include <QtCore/QVector>
#include <QtCore/QHash>
#include <QtCore/QCoreApplication>
namespace Valgrind {
namespace Callgrind {
......@@ -48,6 +49,7 @@ namespace Callgrind {
//BEGIN ParseData::Private
class ParseData::Private {
Q_DECLARE_TR_FUNCTIONS(Valgrind::Callgrind::ParseData)
public:
Private(ParseData *q)
: m_lineNumberPositionIndex(-1)
......@@ -177,37 +179,36 @@ QString ParseData::prettyStringForEvent(const QString &event)
QTC_ASSERT(event.size() >= 2, return event) // should not happen
bool isMiss = event.contains("m"); // else hit
bool isRead = event.contains("r"); // else write
const bool isMiss = event.contains(QLatin1Char('m')); // else hit
const bool isRead = event.contains(QLatin1Char('r')); // else write
QString type;
if (event.contains("L"))
type = QT_TR_NOOP("Last-level"); // first, "L" overwrites the others
if (event.contains(QLatin1Char('L')))
type = ParseData::Private::tr("Last-level"); // first, "L" overwrites the others
else if (event.at(0) == 'I')
type = QT_TR_NOOP("Instruction");
type = ParseData::Private::tr("Instruction");
else if (event.at(0) == 'D')
type = QT_TR_NOOP("Cache");
type = ParseData::Private::tr("Cache");
else if (event.leftRef(2) == "Bc")
type = QT_TR_NOOP("Conditional branches");
type = ParseData::Private::tr("Conditional branches");
else if (event.leftRef(2) == "Bi")
type = QT_TR_NOOP("Indirect branches");
type = ParseData::Private::tr("Indirect branches");
QStringList prettyString;
prettyString << type;
if (event.at(1).isNumber())
prettyString << QString("level %1").arg(event.at(1));
prettyString << (isRead ? QT_TR_NOOP("read") : QT_TR_NOOP("write"));
prettyString << ParseData::Private::tr("level %1").arg(event.at(1));
prettyString << (isRead ? ParseData::Private::tr("read") : ParseData::Private::tr("write"));
if (event.at(0) == 'B')
prettyString << (isMiss ? QT_TR_NOOP("mispredicted") : QT_TR_NOOP("executed"));
prettyString << (isMiss ? ParseData::Private::tr("mispredicted") : ParseData::Private::tr("executed"));
else
prettyString << (isMiss ? QT_TR_NOOP("miss") : QT_TR_NOOP("access"));
prettyString << (isMiss ? ParseData::Private::tr("miss") : ParseData::Private::tr("access"));
// add original abbreviation
prettyString << QString("(%1)").arg(event);
return prettyString.join(" ");
prettyString << QLatin1Char('(') + event + QLatin1Char(')');
return prettyString.join(QString(QLatin1Char(' ')));
}
QStringList ParseData::events() const
......@@ -224,10 +225,10 @@ void ParseData::setEvents(const QStringList &events)
QString ParseData::prettyStringForPosition(const QString &position)
{
if (position == "line")
return QT_TR_NOOP("Line:"); // as in: "line number"
return ParseData::Private::tr("Line:"); // as in: "line number"
else if (position == "instr")
return QT_TR_NOOP("Instruction"); // as in: "instruction address"
return QT_TR_NOOP("Position:"); // never reached, in theory
return ParseData::Private::tr("Instruction"); // as in: "instruction address"
return ParseData::Private::tr("Position:"); // never reached, in theory
}
QStringList ParseData::positions() const
......
......@@ -460,6 +460,7 @@ void FakeVimExCommandsPage::defaultAction()
class FakeVimUserCommandsModel : public QAbstractTableModel
{
Q_OBJECT
public:
FakeVimUserCommandsModel(FakeVimPluginPrivate *q) : m_q(q) {}
~FakeVimUserCommandsModel() {}
......
......@@ -210,8 +210,8 @@ MaemoMountAndInstallDeployStep::MaemoMountAndInstallDeployStep(BuildStepList *bc
void MaemoMountAndInstallDeployStep::ctor()
{
//: MaemoMountAndInstallDeployStep default display name
setDefaultDisplayName(DisplayName);
// MaemoMountAndInstallDeployStep default display name
setDefaultDisplayName(displayName());
if (qobject_cast<AbstractDebBasedQt4MaemoTarget *>(target()))
m_installer = new MaemoDebianPackageInstaller(this);
......@@ -276,9 +276,10 @@ void MaemoMountAndInstallDeployStep::handleInstallationSuccess()
}
const QString MaemoMountAndInstallDeployStep::Id("MaemoMountAndInstallDeployStep");
const QString MaemoMountAndInstallDeployStep::DisplayName
= tr("Deploy package via UTFS mount");
QString MaemoMountAndInstallDeployStep::displayName()
{
return tr("Deploy package via UTFS mount");
}
MaemoMountAndCopyDeployStep::MaemoMountAndCopyDeployStep(BuildStepList *bc)
: AbstractMaemoDeployByMountStep(bc, Id)
......@@ -295,8 +296,8 @@ MaemoMountAndCopyDeployStep::MaemoMountAndCopyDeployStep(BuildStepList *bc,
void MaemoMountAndCopyDeployStep::ctor()
{
//: MaemoMountAndCopyDeployStep default display name
setDefaultDisplayName(DisplayName);
// MaemoMountAndCopyDeployStep default display name
setDefaultDisplayName(displayName());
m_copyFacility = new MaemoRemoteCopyFacility(this);
connect(m_copyFacility, SIGNAL(stdoutData(QString)),
......@@ -386,8 +387,11 @@ void MaemoMountAndCopyDeployStep::handleInstallationSuccess()
}
const QString MaemoMountAndCopyDeployStep::Id("MaemoMountAndCopyDeployStep");
const QString MaemoMountAndCopyDeployStep::DisplayName
= tr("Deploy files via UTFS mount");
QString MaemoMountAndCopyDeployStep::displayName()
{
return tr("Deploy files via UTFS mount");
}
} // namespace Internal
} // namespace RemoteLinux
......@@ -94,7 +94,7 @@ public:
MaemoMountAndInstallDeployStep *other);
static const QString Id;
static const QString DisplayName;
static QString displayName();
private:
virtual const AbstractMaemoPackageCreationStep *packagingStep() const;
virtual bool isDeploymentPossibleInternal(QString &whynot) const;
......@@ -120,7 +120,7 @@ public:
MaemoMountAndCopyDeployStep *other);
static const QString Id;
static const QString DisplayName;
static QString displayName();
private:
virtual const AbstractMaemoPackageCreationStep *packagingStep() const { return 0; }
virtual bool isDeploymentPossibleInternal(QString &whynot) const;
......
......@@ -89,25 +89,25 @@ QStringList MaemoDeployStepFactory::availableCreationIds(BuildStepList *parent)
QString MaemoDeployStepFactory::displayNameForId(const QString &id) const
{
if (id == MaemoMountAndInstallDeployStep::Id)
return MaemoMountAndInstallDeployStep::DisplayName;
return MaemoMountAndInstallDeployStep::displayName();
else if (id == MaemoMountAndCopyDeployStep::Id)
return MaemoMountAndCopyDeployStep::DisplayName;
return MaemoMountAndCopyDeployStep::displayName();
else if (id == MaemoUploadAndInstallDpkgPackageStep::Id)
return MaemoUploadAndInstallDpkgPackageStep::DisplayName;
return MaemoUploadAndInstallDpkgPackageStep::displayName();
else if (id == MaemoUploadAndInstallRpmPackageStep::Id)
return MaemoUploadAndInstallRpmPackageStep::DisplayName;
return MaemoUploadAndInstallRpmPackageStep::displayName();
else if (id == MaemoUploadAndInstallTarPackageStep::Id)
return MaemoUploadAndInstallTarPackageStep::DisplayName;
return MaemoUploadAndInstallTarPackageStep::displayName();
else if (id == MaemoInstallDebianPackageToSysrootStep::Id)
return MaemoInstallDebianPackageToSysrootStep::DisplayName;
return MaemoInstallDebianPackageToSysrootStep::displayName();
else if (id == MaemoInstallRpmPackageToSysrootStep::Id)
return MaemoInstallRpmPackageToSysrootStep::DisplayName;
return MaemoInstallRpmPackageToSysrootStep::displayName();
else if (id == MaemoCopyToSysrootStep::Id)
return MaemoCopyToSysrootStep::DisplayName;
return MaemoCopyToSysrootStep::displayName();
else if (id == MaemoMakeInstallToSysrootStep::Id)
return MaemoMakeInstallToSysrootStep::DisplayName;
return MaemoMakeInstallToSysrootStep::displayName();
else if (id == MaemoDirectDeviceUploadStep::Id)
return MaemoDirectDeviceUploadStep::DisplayName;
return MaemoDirectDeviceUploadStep::displayName();
return QString();
}
......
......@@ -69,7 +69,7 @@ MaemoDirectDeviceUploadStep::~MaemoDirectDeviceUploadStep() {}
void MaemoDirectDeviceUploadStep::ctor()
{
setDefaultDisplayName(DisplayName);
setDefaultDisplayName(displayName());
m_extendedState = Inactive;
}
......@@ -242,8 +242,11 @@ void MaemoDirectDeviceUploadStep::setFinished()
}
const QString MaemoDirectDeviceUploadStep::Id("MaemoDirectDeviceUploadStep");
const QString MaemoDirectDeviceUploadStep::DisplayName
= tr("Upload files via SFTP");
QString MaemoDirectDeviceUploadStep::displayName()
{
return tr("Upload files via SFTP");
}
} // namespace Internal
} // namespace RemoteLinux
......@@ -59,7 +59,7 @@ public:
~MaemoDirectDeviceUploadStep();
static const QString Id;
static const QString DisplayName;
static QString displayName();
private slots:
void handleSftpInitialized();
......
......@@ -97,7 +97,7 @@ public:
MaemoInstallDebianPackageToSysrootWidget(AbstractMaemoInstallPackageToSysrootStep *step)
: AbstractMaemoInstallPackageToSysrootWidget(step) {}
virtual QString displayName() const { return MaemoInstallDebianPackageToSysrootStep::DisplayName; }
virtual QString displayName() const { return MaemoInstallDebianPackageToSysrootStep::displayName(); }
};
class MaemoInstallRpmPackageToSysrootWidget : public AbstractMaemoInstallPackageToSysrootWidget
......@@ -107,7 +107,7 @@ public:
MaemoInstallRpmPackageToSysrootWidget(AbstractMaemoInstallPackageToSysrootStep *step)
: AbstractMaemoInstallPackageToSysrootWidget(step) {}
virtual QString displayName() const { return MaemoInstallRpmPackageToSysrootStep::DisplayName; }
virtual QString displayName() const { return MaemoInstallRpmPackageToSysrootStep::displayName(); }
};
class MaemoCopyFilesToSysrootWidget : public BuildStepConfigWidget
......@@ -218,14 +218,14 @@ void AbstractMaemoInstallPackageToSysrootStep::handleInstallerStderr()
MaemoInstallDebianPackageToSysrootStep::MaemoInstallDebianPackageToSysrootStep(BuildStepList *bsl)
: AbstractMaemoInstallPackageToSysrootStep(bsl, Id)
{
setDisplayName(DisplayName);
setDisplayName(displayName());
}
MaemoInstallDebianPackageToSysrootStep::MaemoInstallDebianPackageToSysrootStep(BuildStepList *bsl,
MaemoInstallDebianPackageToSysrootStep *other)
: AbstractMaemoInstallPackageToSysrootStep(bsl, other)
{
setDisplayName(DisplayName);
setDisplayName(displayName());
}
BuildStepConfigWidget *MaemoInstallDebianPackageToSysrootStep::createConfigWidget()
......@@ -242,20 +242,23 @@ QStringList MaemoInstallDebianPackageToSysrootStep::madArguments() const
const QString MaemoInstallDebianPackageToSysrootStep::Id
= QLatin1String("MaemoInstallDebianPackageToSysrootStep");
const QString MaemoInstallDebianPackageToSysrootStep::DisplayName
= tr("Install Debian package to sysroot");
QString MaemoInstallDebianPackageToSysrootStep::displayName()
{
return tr("Install Debian package to sysroot");
}
MaemoInstallRpmPackageToSysrootStep::MaemoInstallRpmPackageToSysrootStep(BuildStepList *bsl)
: AbstractMaemoInstallPackageToSysrootStep(bsl, Id)
{
setDisplayName(DisplayName);
setDisplayName(displayName());
}
MaemoInstallRpmPackageToSysrootStep::MaemoInstallRpmPackageToSysrootStep(BuildStepList *bsl,
MaemoInstallRpmPackageToSysrootStep *other)
: AbstractMaemoInstallPackageToSysrootStep(bsl, other)
{
setDisplayName(DisplayName);
setDisplayName(displayName());
}
BuildStepConfigWidget *MaemoInstallRpmPackageToSysrootStep::createConfigWidget()
......@@ -270,21 +273,23 @@ QStringList MaemoInstallRpmPackageToSysrootStep::madArguments() const
const QString MaemoInstallRpmPackageToSysrootStep::Id
= QLatin1String("MaemoInstallRpmPackageToSysrootStep");
const QString MaemoInstallRpmPackageToSysrootStep::DisplayName
= tr("Install RPM package to sysroot");
QString MaemoInstallRpmPackageToSysrootStep::displayName()
{
return tr("Install RPM package to sysroot");
}
MaemoCopyToSysrootStep::MaemoCopyToSysrootStep(BuildStepList *bsl)
: BuildStep(bsl, Id)
{
setDisplayName(DisplayName);
setDisplayName(displayName());
}
MaemoCopyToSysrootStep::MaemoCopyToSysrootStep(BuildStepList *bsl,
MaemoCopyToSysrootStep *other)
: BuildStep(bsl, other)
{
setDisplayName(DisplayName);
setDisplayName(displayName());
}
void MaemoCopyToSysrootStep::run(QFutureInterface<bool> &fi)
......@@ -340,21 +345,22 @@ BuildStepConfigWidget *MaemoCopyToSysrootStep::createConfigWidget()
const QString MaemoCopyToSysrootStep::Id
= QLatin1String("MaemoCopyToSysrootStep");
const QString MaemoCopyToSysrootStep::DisplayName
= tr("Copy files to sysroot");
QString MaemoCopyToSysrootStep::displayName()
{
return tr("Copy files to sysroot");
}
MaemoMakeInstallToSysrootStep::MaemoMakeInstallToSysrootStep(BuildStepList *bsl)
: AbstractProcessStep(bsl, Id)
{
setDefaultDisplayName(DisplayName);
setDefaultDisplayName(displayName());
}
MaemoMakeInstallToSysrootStep::MaemoMakeInstallToSysrootStep(BuildStepList *bsl,
MaemoMakeInstallToSysrootStep *other)
: AbstractProcessStep(bsl, other)
{
setDefaultDisplayName(DisplayName);
setDefaultDisplayName(displayName());
}
bool MaemoMakeInstallToSysrootStep::init()
......@@ -394,8 +400,10 @@ BuildStepConfigWidget *MaemoMakeInstallToSysrootStep::createConfigWidget()
const QString MaemoMakeInstallToSysrootStep::Id
= QLatin1String("MaemoMakeInstallToSysrootStep");
const QString MaemoMakeInstallToSysrootStep::DisplayName
= tr("Copy files to sysroot");
QString MaemoMakeInstallToSysrootStep::displayName()
{
return tr("Copy files to sysroot");
}
} // namespace Internal
} // namespace RemoteLinux
......
......@@ -77,7 +77,7 @@ public:
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
static const QString Id;
static const QString DisplayName;
static QString displayName();
private:
virtual QStringList madArguments() const;
};
......@@ -93,7 +93,7 @@ public:
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
static const QString Id;
static const QString DisplayName;
static QString displayName();
private:
virtual QStringList madArguments() const;
};
......@@ -111,7 +111,7 @@ public:
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
static const QString Id;
static const QString DisplayName;
static QString displayName();
};
class MaemoMakeInstallToSysrootStep : public ProjectExplorer::AbstractProcessStep
......@@ -127,7 +127,7 @@ public:
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
static const QString Id;
static const QString DisplayName;
static QString displayName();
};
} // namespace Internal
......
......@@ -204,7 +204,7 @@ MaemoUploadAndInstallDpkgPackageStep::MaemoUploadAndInstallDpkgPackageStep(Proje
void MaemoUploadAndInstallDpkgPackageStep::ctor()
{
finishInitialization(DisplayName, new MaemoDebianPackageInstaller(this));
finishInitialization(displayName(), new MaemoDebianPackageInstaller(this));
}
......@@ -214,9 +214,11 @@ const AbstractMaemoPackageCreationStep *MaemoUploadAndInstallDpkgPackageStep::pa
}
const QString MaemoUploadAndInstallDpkgPackageStep::Id("MaemoUploadAndInstallDpkgPackageStep");
const QString MaemoUploadAndInstallDpkgPackageStep::DisplayName
= tr("Deploy Debian package via SFTP upload");
QString MaemoUploadAndInstallDpkgPackageStep::displayName()
{
return tr("Deploy Debian package via SFTP upload");
}
MaemoUploadAndInstallRpmPackageStep::MaemoUploadAndInstallRpmPackageStep(ProjectExplorer::BuildStepList *bc)
: AbstractMaemoUploadAndInstallStep(bc, Id)
......@@ -233,7 +235,7 @@ MaemoUploadAndInstallRpmPackageStep::MaemoUploadAndInstallRpmPackageStep(Project
void MaemoUploadAndInstallRpmPackageStep::ctor()
{
finishInitialization(DisplayName, new MaemoRpmPackageInstaller(this));
finishInitialization(displayName(), new MaemoRpmPackageInstaller(this));
}
const AbstractMaemoPackageCreationStep *MaemoUploadAndInstallRpmPackageStep::packagingStep() const
......@@ -242,9 +244,11 @@ const AbstractMaemoPackageCreationStep *MaemoUploadAndInstallRpmPackageStep::pac
}
const QString MaemoUploadAndInstallRpmPackageStep::Id("MaemoUploadAndInstallRpmPackageStep");
const QString MaemoUploadAndInstallRpmPackageStep::DisplayName
= tr("Deploy RPM package via SFTP upload");
QString MaemoUploadAndInstallRpmPackageStep::displayName()
{
return tr("Deploy RPM package via SFTP upload");
}
MaemoUploadAndInstallTarPackageStep::MaemoUploadAndInstallTarPackageStep(ProjectExplorer::BuildStepList *bc)
: AbstractMaemoUploadAndInstallStep(bc, Id)
......@@ -266,13 +270,15 @@ const AbstractMaemoPackageCreationStep *MaemoUploadAndInstallTarPackageStep::pac
void MaemoUploadAndInstallTarPackageStep::ctor()
{
finishInitialization(DisplayName, new MaemoTarPackageInstaller(this));
finishInitialization(displayName(), new MaemoTarPackageInstaller(this));
}
const QString MaemoUploadAndInstallTarPackageStep::Id("MaemoUploadAndInstallTarPackageStep");
const QString MaemoUploadAndInstallTarPackageStep::DisplayName
= tr("Deploy tar package via SFTP upload");
QString MaemoUploadAndInstallTarPackageStep::displayName()
{
return tr("Deploy tar package via SFTP upload");
}
} // namespace Internal
} // namespace RemoteLinux
......@@ -83,7 +83,7 @@ public:
MaemoUploadAndInstallDpkgPackageStep *other);
static const QString Id;
static const QString DisplayName;
static QString displayName();
private:
void ctor();
......@@ -100,7 +100,7 @@ public:
MaemoUploadAndInstallRpmPackageStep *other);
static const QString Id;
static const QString DisplayName;
static QString displayName();
private:
void ctor();
......@@ -117,7 +117,7 @@ public:
MaemoUploadAndInstallTarPackageStep *other);
static const QString Id;
static const QString DisplayName;
static QString displayName();
private:
void ctor();
......
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