Commit 1f62ac1d authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Fix some Clazy warnings in KDevPlatform

REVIEW: 126683
parent bccba690
......@@ -139,17 +139,17 @@ QVariant Breakpoint::data(int column, int role) const
{
if (role == Qt::DecorationRole) {
if (!errorText().isEmpty()) {
return QIcon::fromTheme("dialog-warning");
return QIcon::fromTheme(QStringLiteral("dialog-warning"));
}
switch (state()) {
case NotStartedState:
return QVariant();
case DirtyState:
return QIcon::fromTheme("system-switch-user");
return QIcon::fromTheme(QStringLiteral("system-switch-user"));
case PendingState:
return QIcon::fromTheme("help-contents");
return QIcon::fromTheme(QStringLiteral("help-contents"));
case CleanState:
return QIcon::fromTheme("dialog-ok-apply");
return QIcon::fromTheme(QStringLiteral("dialog-ok-apply"));
}
} else if (role == Qt::ToolTipRole) {
if (!errorText().isEmpty()) {
......
......@@ -153,9 +153,9 @@ void BreakpointModel::markContextMenuRequested(Document* document, Mark mark, co
}
QMenu menu;
QAction deleteAction(QIcon::fromTheme("edit-delete"), i18n("&Delete Breakpoint"), 0);
QAction disableAction(QIcon::fromTheme("dialog-cancel"), i18n("&Disable Breakpoint"), 0);
QAction enableAction(QIcon::fromTheme("dialog-ok-apply"), i18n("&Enable Breakpoint"), 0);
QAction deleteAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("&Delete Breakpoint"), 0);
QAction disableAction(QIcon::fromTheme(QStringLiteral("dialog-cancel")), i18n("&Disable Breakpoint"), 0);
QAction enableAction(QIcon::fromTheme(QStringLiteral("dialog-ok-apply")), i18n("&Enable Breakpoint"), 0);
menu.addAction(&deleteAction);
if (b->enabled()) {
menu.addAction(&disableAction);
......@@ -184,9 +184,9 @@ BreakpointModel::headerData(int section, Qt::Orientation orientation,
if (role == Qt::DecorationRole ) {
if (section == 0)
return QIcon::fromTheme("dialog-ok-apply");
return QIcon::fromTheme(QStringLiteral("dialog-ok-apply"));
else if (section == 1)
return QIcon::fromTheme("system-switch-user");
return QIcon::fromTheme(QStringLiteral("system-switch-user"));
}
if (role == Qt::DisplayRole) {
......@@ -366,25 +366,25 @@ void BreakpointModel::markChanged(
const QPixmap* BreakpointModel::breakpointPixmap()
{
static QPixmap pixmap=QIcon::fromTheme("script-error").pixmap(QSize(22,22), QIcon::Active, QIcon::Off);
static QPixmap pixmap=QIcon::fromTheme(QStringLiteral("script-error")).pixmap(QSize(22,22), QIcon::Active, QIcon::Off);
return &pixmap;
}
const QPixmap* BreakpointModel::pendingBreakpointPixmap()
{
static QPixmap pixmap=QIcon::fromTheme("script-error").pixmap(QSize(22,22), QIcon::Normal, QIcon::Off);
static QPixmap pixmap=QIcon::fromTheme(QStringLiteral("script-error")).pixmap(QSize(22,22), QIcon::Normal, QIcon::Off);
return &pixmap;
}
const QPixmap* BreakpointModel::reachedBreakpointPixmap()
{
static QPixmap pixmap=QIcon::fromTheme("script-error").pixmap(QSize(22,22), QIcon::Selected, QIcon::Off);
static QPixmap pixmap=QIcon::fromTheme(QStringLiteral("script-error")).pixmap(QSize(22,22), QIcon::Selected, QIcon::Off);
return &pixmap;
}
const QPixmap* BreakpointModel::disabledBreakpointPixmap()
{
static QPixmap pixmap=QIcon::fromTheme("script-error").pixmap(QSize(22,22), QIcon::Disabled, QIcon::Off);
static QPixmap pixmap=QIcon::fromTheme(QStringLiteral("script-error")).pixmap(QSize(22,22), QIcon::Disabled, QIcon::Off);
return &pixmap;
}
......
......@@ -57,7 +57,7 @@ BreakpointWidget::BreakpointWidget(IDebugController *controller, QWidget *parent
"breakpoint item allows you to change "
"the breakpoint and will take you "
"to the source in the editor window."));
setWindowIcon( QIcon::fromTheme("media-playback-pause") );
setWindowIcon( QIcon::fromTheme( QStringLiteral( "media-playback-pause") ) );
m_breakpointsView = new QTableView(this);
m_breakpointsView->setSelectionBehavior(QAbstractItemView::SelectRows);
......@@ -102,7 +102,7 @@ void BreakpointWidget::setupPopupMenu()
m_popup = new QMenu(this);
QMenu* newBreakpoint = m_popup->addMenu( i18nc("New breakpoint", "&New") );
newBreakpoint->setIcon(QIcon::fromTheme("list-add"));
newBreakpoint->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
QAction* action = newBreakpoint->addAction(
i18nc("Code breakpoint", "&Code"),
......@@ -124,7 +124,7 @@ void BreakpointWidget::setupPopupMenu()
this, SLOT(slotAddBlankAccessWatchpoint()));
QAction* breakpointDelete = m_popup->addAction(
QIcon::fromTheme("edit-delete"),
QIcon::fromTheme(QStringLiteral("edit-delete")),
i18n( "&Delete" ),
this,
SLOT(slotRemoveBreakpoint()));
......
......@@ -67,7 +67,7 @@ FramestackWidget::FramestackWidget(IDebugController* controller, QWidget* parent
"program. By clicking on an item you "
"can see the values in any of the "
"previous calling functions."));
setWindowIcon(QIcon::fromTheme("view-list-text"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("view-list-text")));
m_threadsWidget = new QWidget(this);
m_threads = new QListView(m_threadsWidget);
m_frames = new QTreeView(this);
......
......@@ -82,13 +82,13 @@ void IBreakpointController::notifyHit(int row, const QString& msg)
KNotification* ev = 0;
switch(breakpoint->kind()) {
case Breakpoint::CodeBreakpoint:
ev = new KNotification("BreakpointHit", ICore::self()->uiController()->activeMainWindow());
ev = new KNotification(QStringLiteral("BreakpointHit"), ICore::self()->uiController()->activeMainWindow());
ev->setText(i18n("Breakpoint hit: %1", breakpoint->location()) + msg);
break;
case Breakpoint::WriteBreakpoint:
case Breakpoint::ReadBreakpoint:
case Breakpoint::AccessBreakpoint:
ev = new KNotification("WatchpointHit", ICore::self()->uiController()->activeMainWindow());
ev = new KNotification(QStringLiteral("WatchpointHit"), ICore::self()->uiController()->activeMainWindow());
ev->setText(i18n("Watchpoint hit: %1", breakpoint->location()) + msg);
break;
default:
......@@ -96,7 +96,7 @@ void IBreakpointController::notifyHit(int row, const QString& msg)
break;
}
if (ev) {
ev->setPixmap(QIcon::fromTheme("script-error").pixmap(QSize(22,22)));
ev->setPixmap(QIcon::fromTheme(QStringLiteral("script-error")).pixmap(QSize(22,22)));
// TODO: Port
//ev->setComponentName(ICore::self()->aboutData().componentName());
ev->sendEvent();
......
......@@ -56,9 +56,9 @@ static QUrl rebaseMatchingUrl(const QUrl& toRebase, const KConfigGroup& config,
namespace KDevelop {
const QString PathMappings::pathMappingsEntry("Path Mappings");
const QString PathMappings::pathMappingRemoteEntry("Remote");
const QString PathMappings::pathMappingLocalEntry("Local");
const QString PathMappings::pathMappingsEntry(QStringLiteral("Path Mappings"));
const QString PathMappings::pathMappingRemoteEntry(QStringLiteral("Remote"));
const QString PathMappings::pathMappingLocalEntry(QStringLiteral("Local"));
QUrl PathMappings::convertToLocalUrl(const KConfigGroup& config, const QUrl& remoteUrl)
{
......@@ -225,7 +225,7 @@ PathMappingsWidget::PathMappingsWidget(QWidget* parent): QWidget(parent)
connect(m_pathMappingTable->model(), &QAbstractItemModel::rowsInserted, this, &PathMappingsWidget::changed);
QAction* deletePath = new QAction(
QIcon::fromTheme("edit-delete"),
QIcon::fromTheme(QStringLiteral("edit-delete")),
i18n( "Delete" ),
this
);
......
......@@ -129,7 +129,7 @@ void TreeItem::deleteChildren()
void TreeItem::clear()
{
if (childItems.size() || more_)
if (!childItems.isEmpty() || more_)
{
QModelIndex index = model_->indexForItem(this, 0);
model_->beginRemoveRows(index, 0, childItems.size()-1+more_);
......
......@@ -256,7 +256,7 @@ Variable *Watches::addFinishResult(const QString& convenienceVarible)
removeFinishResult();
}
finishResult_ = currentSession()->variableController()->createVariable(
model(), this, convenienceVarible, "$ret");
model(), this, convenienceVarible, QStringLiteral("$ret"));
appendChild(finishResult_);
finishResult_->attachMaybe();
if (childCount() == 1 && !isExpanded()) {
......
......@@ -144,9 +144,9 @@ VariableToolTip::VariableToolTip(QWidget* parent, QPoint position,
QSignalMapper* mapper = new QSignalMapper(this);
connect(watchThisButton, &QPushButton::clicked, mapper, static_cast<void(QSignalMapper::*)()>(&QSignalMapper::map));
mapper->setMapping(watchThisButton, "add_watch");
mapper->setMapping(watchThisButton, QStringLiteral("add_watch"));
connect(stopOnChangeButton, &QPushButton::clicked, mapper, static_cast<void(QSignalMapper::*)()>(&QSignalMapper::map));
mapper->setMapping(stopOnChangeButton, "add_watchpoint");
mapper->setMapping(stopOnChangeButton, QStringLiteral("add_watchpoint"));
connect(mapper, static_cast<void(QSignalMapper::*)(const QString&)>(&QSignalMapper::mapped), this, &VariableToolTip::slotLinkActivated);
QHBoxLayout* inner = new QHBoxLayout();
......
......@@ -74,7 +74,7 @@ VariableWidget::VariableWidget(IDebugController* controller, QWidget *parent)
: QWidget(parent), variablesRoot_(controller->variableCollection()->root())
{
//setWindowIcon(QIcon::fromTheme("math_brace"));
setWindowIcon(QIcon::fromTheme("debugger"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("debugger")));
setWindowTitle(i18n("Debugger Variables"));
m_proxy = new VariableSortProxyModel;
......@@ -239,7 +239,7 @@ void VariableTree::setupActions()
connect(m_signalMapper, static_cast<void(QSignalMapper::*)(int)>(&QSignalMapper::mapped), this, &VariableTree::changeVariableFormat);
m_watchDelete = new QAction(
QIcon::fromTheme("edit-delete"), i18n( "Remove Watch Variable" ), this);
QIcon::fromTheme(QStringLiteral("edit-delete")), i18n( "Remove Watch Variable" ), this);
m_watchDelete->setShortcut(Qt::Key_Delete);
m_watchDelete->setShortcutContext(Qt::WidgetWithChildrenShortcut);
......
......@@ -29,9 +29,9 @@ DocumentationFindWidget::DocumentationFindWidget(QWidget* parent)
m_ui = new Ui::FindWidget;
m_ui->setupUi(this);
m_ui->hideButton->setIcon(QIcon::fromTheme("dialog-close"));
m_ui->nextButton->setIcon(QIcon::fromTheme("go-down-search"));
m_ui->previousButton->setIcon(QIcon::fromTheme("go-up-search"));
m_ui->hideButton->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
m_ui->nextButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down-search")));
m_ui->previousButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up-search")));
connect(m_ui->findText, &QLineEdit::returnPressed,
this, &DocumentationFindWidget::searchNext);
......
......@@ -67,11 +67,11 @@ DocumentationView::DocumentationView(QWidget* parent, ProvidersModel* model)
mFindDoc = new DocumentationFindWidget;
mFindDoc->hide();
mBack = mActions->addAction(QIcon::fromTheme("go-previous"), i18n("Back"));
mForward = mActions->addAction(QIcon::fromTheme("go-next"), i18n("Forward"));
mFind = mActions->addAction(QIcon::fromTheme("edit-find"), i18n("Find"), mFindDoc, SLOT(startSearch()));
mBack = mActions->addAction(QIcon::fromTheme(QStringLiteral("go-previous")), i18n("Back"));
mForward = mActions->addAction(QIcon::fromTheme(QStringLiteral("go-next")), i18n("Forward"));
mFind = mActions->addAction(QIcon::fromTheme(QStringLiteral("edit-find")), i18n("Find"), mFindDoc, SLOT(startSearch()));
mActions->addSeparator();
mActions->addAction(QIcon::fromTheme("go-home"), i18n("Home"), this, SLOT(showHome()));
mActions->addAction(QIcon::fromTheme(QStringLiteral("go-home")), i18n("Home"), this, SLOT(showHome()));
mProviders = new QComboBox(mActions);
mIdentifiers = new QLineEdit(mActions);
......
......@@ -28,7 +28,7 @@
namespace KDevelop
{
static Identifier& conversionIdentifier() {
static Identifier conversionIdentifierObject("operator{...cast...}");
static Identifier conversionIdentifierObject(QStringLiteral("operator{...cast...}"));
return conversionIdentifierObject;
}
......@@ -91,7 +91,7 @@ QString ClassFunctionDeclaration::toString() const {
TypePtr<FunctionType> function = type<FunctionType>();
if(function) {
return QStringLiteral("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn )).arg(identifier().toString()).arg(function->partToString( FunctionType::SignatureArguments ));
return QStringLiteral("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn ), identifier().toString(), function->partToString( FunctionType::SignatureArguments ));
} else {
QString type = abstractType() ? abstractType()->toString() : QStringLiteral("<notype>");
qCDebug(LANGUAGE) << "A function has a bad type attached:" << type;
......
......@@ -155,7 +155,7 @@ class CodeModelRequestItem {
class CodeModelPrivate {
public:
CodeModelPrivate() : m_repository("Code Model") {
CodeModelPrivate() : m_repository(QStringLiteral("Code Model")) {
}
//Maps declaration-ids to items
ItemRepository<CodeModelRepositoryItem, CodeModelRequestItem> m_repository;
......
......@@ -86,7 +86,7 @@ m_isExplicitlyDeleted(rhs.m_isExplicitlyDeleted)
///@todo Use reference counting
static Repositories::StringRepository& commentRepository() {
static Repositories::StringRepository commentRepositoryObject("Comment Repository");
static Repositories::StringRepository commentRepositoryObject(QStringLiteral("Comment Repository"));
return commentRepositoryObject;
}
......
......@@ -297,7 +297,7 @@ class DUChainPrivate
DUChainPrivate* m_data;
};
public:
DUChainPrivate() : m_chainsMutex(QMutex::Recursive), m_cleanupMutex(QMutex::Recursive), instance(0), m_cleanupDisabled(false), m_destroyed(false), m_environmentListInfo("Environment Lists"), m_environmentInfo("Environment Information")
DUChainPrivate() : m_chainsMutex(QMutex::Recursive), m_cleanupMutex(QMutex::Recursive), instance(0), m_cleanupDisabled(false), m_destroyed(false), m_environmentListInfo(QStringLiteral("Environment Lists")), m_environmentInfo(QStringLiteral("Environment Information"))
{
#if defined(TEST_NO_CLEANUP)
m_cleanupDisabled = true;
......@@ -1605,7 +1605,7 @@ uint DUChain::newTopContextIndex() {
return ret;
}
}
static QAtomicInt& currentId( globalItemRepositoryRegistry().getCustomCounter("Top-Context Counter", 1) );
static QAtomicInt& currentId( globalItemRepositoryRegistry().getCustomCounter(QStringLiteral("Top-Context Counter"), 1) );
return currentId.fetchAndAddRelaxed(1);
}
......
......@@ -155,78 +155,78 @@ QIcon DUChainUtils::iconForProperties(KTextEditor::CodeCompletionModel::Completi
if( (p & CodeCompletionModel::Variable) )
if( (p & CodeCompletionModel::Protected) )
RETURN_CACHED_ICON("CVprotected_var")
RETURN_CACHED_ICON(QStringLiteral("CVprotected_var"))
else if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("CVprivate_var")
RETURN_CACHED_ICON(QStringLiteral("CVprivate_var"))
else
RETURN_CACHED_ICON("CVpublic_var")
RETURN_CACHED_ICON(QStringLiteral("CVpublic_var"))
else
if( (p & CodeCompletionModel::Union) && (p & CodeCompletionModel::Protected) )
RETURN_CACHED_ICON("protected_union")
RETURN_CACHED_ICON(QStringLiteral("protected_union"))
else if( p & CodeCompletionModel::Enum )
if( p & CodeCompletionModel::Protected )
RETURN_CACHED_ICON("protected_enum")
RETURN_CACHED_ICON(QStringLiteral("protected_enum"))
else if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("private_enum")
RETURN_CACHED_ICON(QStringLiteral("private_enum"))
else
RETURN_CACHED_ICON("enum")
RETURN_CACHED_ICON(QStringLiteral("enum"))
else if( p & CodeCompletionModel::Struct )
if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("private_struct")
RETURN_CACHED_ICON(QStringLiteral("private_struct"))
else
RETURN_CACHED_ICON("struct")
RETURN_CACHED_ICON(QStringLiteral("struct"))
else if( p & CodeCompletionModel::Slot )
if( p & CodeCompletionModel::Protected )
RETURN_CACHED_ICON("CVprotected_slot")
RETURN_CACHED_ICON(QStringLiteral("CVprotected_slot"))
else if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("CVprivate_slot")
RETURN_CACHED_ICON(QStringLiteral("CVprivate_slot"))
else if(p & CodeCompletionModel::Public )
RETURN_CACHED_ICON("CVpublic_slot")
else RETURN_CACHED_ICON("slot")
RETURN_CACHED_ICON(QStringLiteral("CVpublic_slot"))
else RETURN_CACHED_ICON(QStringLiteral("slot"))
else if( p & CodeCompletionModel::Signal )
if( p & CodeCompletionModel::Protected )
RETURN_CACHED_ICON("CVprotected_signal")
RETURN_CACHED_ICON(QStringLiteral("CVprotected_signal"))
else
RETURN_CACHED_ICON("signal")
RETURN_CACHED_ICON(QStringLiteral("signal"))
else if( p & CodeCompletionModel::Class )
if( (p & CodeCompletionModel::Class) && (p & CodeCompletionModel::Protected) )
RETURN_CACHED_ICON("protected_class")
RETURN_CACHED_ICON(QStringLiteral("protected_class"))
else if( (p & CodeCompletionModel::Class) && (p & CodeCompletionModel::Private) )
RETURN_CACHED_ICON("private_class")
RETURN_CACHED_ICON(QStringLiteral("private_class"))
else
RETURN_CACHED_ICON("code-class")
RETURN_CACHED_ICON(QStringLiteral("code-class"))
else if( p & CodeCompletionModel::Union )
if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("private_union")
RETURN_CACHED_ICON(QStringLiteral("private_union"))
else
RETURN_CACHED_ICON("union")
RETURN_CACHED_ICON(QStringLiteral("union"))
else if( p & CodeCompletionModel::TypeAlias )
if ((p & CodeCompletionModel::Const) /*|| (p & CodeCompletionModel::Volatile)*/)
RETURN_CACHED_ICON("CVtypedef")
RETURN_CACHED_ICON(QStringLiteral("CVtypedef"))
else
RETURN_CACHED_ICON("typedef")
RETURN_CACHED_ICON(QStringLiteral("typedef"))
else if( p & CodeCompletionModel::Function ) {
if( p & CodeCompletionModel::Protected )
RETURN_CACHED_ICON("protected_function")
RETURN_CACHED_ICON(QStringLiteral("protected_function"))
else if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("private_function")
RETURN_CACHED_ICON(QStringLiteral("private_function"))
else
RETURN_CACHED_ICON("code-function")
RETURN_CACHED_ICON(QStringLiteral("code-function"))
}
if( p & CodeCompletionModel::Protected )
RETURN_CACHED_ICON("protected_field")
RETURN_CACHED_ICON(QStringLiteral("protected_field"))
else if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("private_field")
RETURN_CACHED_ICON(QStringLiteral("private_field"))
else
RETURN_CACHED_ICON("field")
RETURN_CACHED_ICON(QStringLiteral("field"))
return QIcon();
}
......
......@@ -86,12 +86,12 @@ DUChainVisitor::~DUChainVisitor()
* of Identifier is not safe to be called after the duchain has been destroyed
*/
const Identifier& globalImportIdentifier() {
static const Identifier globalImportIdentifierObject(*new Identifier("{...import...}"));
static const Identifier globalImportIdentifierObject(*new Identifier(QStringLiteral("{...import...}")));
return globalImportIdentifierObject;
}
const Identifier& globalAliasIdentifier() {
static const Identifier globalAliasIdentifierObject(*new Identifier("{...alias...}"));
static const Identifier globalAliasIdentifierObject(*new Identifier(QStringLiteral("{...alias...}")));
return globalAliasIdentifierObject;
}
......
......@@ -76,7 +76,7 @@ QString FunctionDeclaration::toString() const {
TypePtr<FunctionType> function = type.cast<FunctionType>();
if(function) {
return QStringLiteral("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn )).arg(identifier().toString()).arg(function->partToString( FunctionType::SignatureArguments ));
return QStringLiteral("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn ), identifier().toString(), function->partToString( FunctionType::SignatureArguments ));
}else{
return Declaration::toString();
}
......
......@@ -164,7 +164,7 @@ struct IdentifierItemRequest
using IdentifierRepository = RepositoryManager< ItemRepository<ConstantIdentifierPrivate, IdentifierItemRequest>, false>;
static IdentifierRepository& identifierRepository()
{
static IdentifierRepository identifierRepositoryObject("Identifier Repository");
static IdentifierRepository identifierRepositoryObject(QStringLiteral("Identifier Repository"));
return identifierRepositoryObject;
}
......
......@@ -281,18 +281,18 @@ QString reverse( const QString& str ) {
///@todo this hackery sucks
QString escapeForBracketMatching(QString str) {
str.replace("<<", "$&");
str.replace(">>", "$$");
str.replace("\\\"", "$!");
str.replace("->", "$?");
str.replace(QStringLiteral("<<"), QStringLiteral("$&"));
str.replace(QStringLiteral(">>"), QStringLiteral("$$"));
str.replace(QStringLiteral("\\\""), QStringLiteral("$!"));
str.replace(QStringLiteral("->"), QStringLiteral("$?"));
return str;
}
QString escapeFromBracketMatching(QString str) {
str.replace("$&", "<<");
str.replace("$$", ">>");
str.replace("$!", "\\\"");
str.replace("$?", "->");
str.replace(QStringLiteral("$&"), QStringLiteral("<<"));
str.replace(QStringLiteral("$$"), QStringLiteral(">>"));
str.replace(QStringLiteral("$!"), QStringLiteral("\\\""));
str.replace(QStringLiteral("$?"), QStringLiteral("->"));
return str;
}
......@@ -385,7 +385,7 @@ QString clearComments( QString str, QChar replacement ) {
else if (withoutStrings[pos + 1] == '*')
{
//CPP style comment
endCommentPos = withoutStrings.indexOf("*/", pos + 2);
endCommentPos = withoutStrings.indexOf(QStringLiteral("*/"), pos + 2);
if (endCommentPos != -1)
endCommentPos += 2;
......
......@@ -48,7 +48,7 @@ namespace KDevelop
{
Utils::BasicSetRepository* RecursiveImportRepository::repository() {
static Utils::BasicSetRepository recursiveImportRepositoryObject("Recursive Imports", &KDevelop::globalItemRepositoryRegistry());
static Utils::BasicSetRepository recursiveImportRepositoryObject(QStringLiteral("Recursive Imports"), &KDevelop::globalItemRepositoryRegistry());
return &recursiveImportRepositoryObject;
}
......
......@@ -319,11 +319,11 @@ void OutputExecuteJob::childProcessError( QProcess::ProcessError processError )
QString errorValue;
switch( processError ) {
case QProcess::FailedToStart:
errorValue = i18n("%1 has failed to start", commandLine().first());
errorValue = i18n("%1 has failed to start", commandLine().at(0));
break;
case QProcess::Crashed:
errorValue = i18n("%1 has crashed", commandLine().first());
errorValue = i18n("%1 has crashed", commandLine().at(0));
break;
case QProcess::ReadError:
......@@ -488,8 +488,8 @@ QProcessEnvironment OutputExecuteJobPrivate::effectiveEnvironment() const
OutputExecuteJobPrivate::mergeEnvironment( environment, userEnv );
OutputExecuteJobPrivate::mergeEnvironment( environment, m_environmentOverrides );
if( m_properties.testFlag( OutputExecuteJob::PortableMessages ) ) {
environment.remove( "LC_ALL" );
environment.insert( "LC_MESSAGES", "C" );
environment.remove( QStringLiteral( "LC_ALL" ) );
environment.insert( QStringLiteral( "LC_MESSAGES" ), QStringLiteral( "C" ) );
}
return environment;
}
......@@ -505,7 +505,7 @@ QStringList OutputExecuteJobPrivate::effectiveCommandLine() const
// "helper -- our command line".
QStringList privilegedCommand = m_owner->privilegedExecutionCommand();
if( !privilegedCommand.isEmpty() ) {
return QStringList() << m_owner->privilegedExecutionCommand() << "--" << m_owner->commandLine();
return QStringList() << m_owner->privilegedExecutionCommand() << QStringLiteral("--") << m_owner->commandLine();
} else {
return m_owner->commandLine();
}
......
......@@ -221,7 +221,7 @@ FilteredItem CompilerFilterStrategy::actionInLine(const QString& line)
// They are later searched by pathForFile to find source files corresponding to
// compiler errors.
// Note: CMake objectfile has the format: "/path/to/four/CMakeFiles/file.o"
if ( curActFilter.fileGroup != -1 && curActFilter.tool == "cmake" && line.contains("Building")) {
if ( curActFilter.fileGroup != -1 && curActFilter.tool == "cmake" && line.contains(QStringLiteral("Building"))) {
const auto objectFile = match.captured(curActFilter.fileGroup);
const auto dir = objectFile.section(QStringLiteral("CMakeFiles/"), 0, 0);
d->putDirAtEnd(Path(d->m_buildDir, dir));
......
......@@ -42,7 +42,7 @@ OutputJob::OutputJob(QObject* parent, OutputJobVerbosity verbosity)
void OutputJob::startOutput()
{
IPlugin* i = ICore::self()->pluginController()->pluginForExtension("org.kdevelop.IOutputView");
IPlugin* i = ICore::self()->pluginController()->pluginForExtension(QStringLiteral("org.kdevelop.IOutputView"));
if( i )
{
KDevelop::IOutputView* view = i->extension<KDevelop::IOutputView>();
......@@ -101,7 +101,7 @@ void KDevelop::OutputJob::setTitle(const QString & title)
{
m_title = title;
if (m_outputId >= 0 && m_standardToolView >= 0) {
IPlugin* i = ICore::self()->pluginController()->pluginForExtension("org.kdevelop.IOutputView");
IPlugin* i = ICore::self()->pluginController()->pluginForExtension(QStringLiteral("org.kdevelop.IOutputView"));
if( i )
{
KDevelop::IOutputView* view = i->extension<KDevelop::IOutputView>();
......
......@@ -158,7 +158,7 @@ class ParsingThread
public:
ParsingThread()