Use const QString, not static const QString with QStringLiteral in methods

GIT_SILENT
parent 6a8d0d08
......@@ -106,8 +106,8 @@ QString ProblemNavigationContext::name() const
QString ProblemNavigationContext::escapedHtml(const QString& text) const
{
static const QString htmlStart = QStringLiteral("<html>");
static const QString htmlEnd = QStringLiteral("</html>");
const QString htmlStart = QStringLiteral("<html>");
const QString htmlEnd = QStringLiteral("</html>");
QString result = text.trimmed();
......
......@@ -186,7 +186,7 @@ ClangCodeCompletionModel::~ClangCodeCompletionModel()
bool ClangCodeCompletionModel::shouldStartCompletion(KTextEditor::View* view, const QString& inserted,
bool userInsertion, const KTextEditor::Cursor& position)
{
static const QString noCompletionAfter = QStringLiteral(";{}]) ");
const QString noCompletionAfter = QStringLiteral(";{}]) ");
if (inserted.isEmpty() || isSpaceOnly(inserted)) {
return false;
......
......@@ -62,7 +62,7 @@ bool isPathChar(QChar c)
QString escapePath(QString path)
{
// see https://cmake.org/Wiki/CMake/Language_Syntax#Escapes
static const QString toBeEscaped = QStringLiteral("\"()#$^");
const QString toBeEscaped = QStringLiteral("\"()#$^");
for(const QChar &ch : toBeEscaped) {
path.replace(ch, QLatin1Char('\\') + ch);
......
......@@ -71,9 +71,9 @@ CMakeFilesCompilationData importCommands(const Path& commandsFile)
}
MakeFileResolver resolver;
static const QString KEY_COMMAND = QStringLiteral("command");
static const QString KEY_DIRECTORY = QStringLiteral("directory");
static const QString KEY_FILE = QStringLiteral("file");
const QString KEY_COMMAND = QStringLiteral("command");
const QString KEY_DIRECTORY = QStringLiteral("directory");
const QString KEY_FILE = QStringLiteral("file");
auto rt = ICore::self()->runtimeController()->currentRuntime();
const auto values = document.array();
for (const QJsonValue& value : values) {
......
......@@ -82,7 +82,7 @@ QDir dotGitDirectory(const QUrl& dirPath)
const QFileInfo finfo(dirPath.toLocalFile());
QDir dir = finfo.isDir() ? QDir(finfo.filePath()): finfo.absoluteDir();
static const QString gitDir = QStringLiteral(".git");
const QString gitDir = QStringLiteral(".git");
while (!dir.exists(gitDir) && dir.cdUp()) {} // cdUp, until there is a sub-directory called .git
if (dir.isRoot()) {
......
......@@ -188,7 +188,7 @@ bool PerforcePlugin::parseP4fstat(const QFileInfo& curFile, OutputJob::OutputJob
QString PerforcePlugin::getRepositoryName(const QFileInfo& curFile)
{
static const QString DEPOT_FILE_STR(QStringLiteral("... depotFile "));
const QString DEPOT_FILE_STR(QStringLiteral("... depotFile "));
QString ret;
QScopedPointer<DVcsJob> job(p4fstatJob(curFile, KDevelop::OutputJob::Silent));
if (job->exec() && job->status() == KDevelop::VcsJob::JobSucceeded) {
......@@ -500,8 +500,8 @@ void PerforcePlugin::setEnvironmentForJob(DVcsJob* job, const QFileInfo& curFile
QList<QVariant> PerforcePlugin::getQvariantFromLogOutput(QStringList const& outputLines)
{
static const QString LOGENTRY_START(QStringLiteral("... #"));
static const QString DEPOTMESSAGE_START(QStringLiteral("... ."));
const QString LOGENTRY_START(QStringLiteral("... #"));
const QString DEPOTMESSAGE_START(QStringLiteral("... ."));
QMap<int, VcsEvent> changes;
QList<QVariant> commits;
QString currentFileName;
......@@ -553,8 +553,8 @@ void PerforcePlugin::parseP4StatusOutput(DVcsJob* job)
{
const QStringList outputLines = job->output().split('\n', QString::SkipEmptyParts);
QVariantList statuses;
static const QString ACTION_STR(QStringLiteral("... action "));
static const QString CLIENT_FILE_STR(QStringLiteral("... clientFile "));
const QString ACTION_STR(QStringLiteral("... action "));
const QString CLIENT_FILE_STR(QStringLiteral("... clientFile "));
......
......@@ -392,7 +392,7 @@ void ProblemsView::addModel(const ModelData& newData)
//
// 2) Other tabs are alphabetically ordered.
static const QString parserId = QStringLiteral("Parser");
const QString parserId = QStringLiteral("Parser");
auto model = newData.model;
auto view = new ProblemTreeView(nullptr, model);
......
......@@ -116,7 +116,7 @@ void VcsOverlayProxyModel::repositoryBranchChanged(const QUrl& url)
void VcsOverlayProxyModel::branchNameReady(KDevelop::VcsJob* job)
{
static const QString noBranchStr = i18nc("Version control: Currently not on a branch", "(no branch)");
const QString noBranchStr = i18nc("Version control: Currently not on a branch", "(no branch)");
if(job->status()==VcsJob::JobSucceeded) {
SafeProjectPointer p = job->property("project").value<SafeProjectPointer>();
......
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