Commit c0af3c65 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent 03f01d59
......@@ -46,7 +46,7 @@ void KateBtBrowserTest::testParser()
// 4) #5 0xffffe410 in __kernel_vsyscall ()
QString bt = QLatin1String("#24 0xb688ff8e in QApplication::notify (this=0xbf997e8c, receiver=0x82607e8, e=0xbf997074) at kernel/qapplication.cpp:3115");
QString bt = QStringLiteral("#24 0xb688ff8e in QApplication::notify (this=0xbf997e8c, receiver=0x82607e8, e=0xbf997074) at kernel/qapplication.cpp:3115");
QList<BtInfo> info = KateBtParser::parseBacktrace(bt);
QVERIFY(info.size() == 1);
......@@ -58,7 +58,7 @@ void KateBtBrowserTest::testParser()
QCOMPARE(info[0].line, 3115);
QCOMPARE(info[0].step, 24);
bt = QLatin1String("#39 0xb634211c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0");
bt = QStringLiteral("#39 0xb634211c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0");
info = KateBtParser::parseBacktrace(bt);
QVERIFY(info.size() == 1);
QCOMPARE(info[0].type, BtInfo::Lib);
......@@ -69,7 +69,7 @@ void KateBtBrowserTest::testParser()
QCOMPARE(info[0].line, -1);
QCOMPARE(info[0].step, 39);
bt = QLatin1String("#41 0x0805e690 in ?? ()");
bt = QStringLiteral("#41 0x0805e690 in ?? ()");
info = KateBtParser::parseBacktrace(bt);
QVERIFY(info.size() == 1);
QCOMPARE(info[0].type, BtInfo::Unknown);
......@@ -80,7 +80,7 @@ void KateBtBrowserTest::testParser()
QCOMPARE(info[0].line, -1);
QCOMPARE(info[0].step, 41);
bt = QLatin1String("#5 0xffffe410 in __kernel_vsyscall ()");
bt = QStringLiteral("#5 0xffffe410 in __kernel_vsyscall ()");
info = KateBtParser::parseBacktrace(bt);
QVERIFY(info.size() == 1);
QCOMPARE(info[0].type, BtInfo::Unknown);
......@@ -91,7 +91,7 @@ void KateBtBrowserTest::testParser()
QCOMPARE(info[0].line, -1);
QCOMPARE(info[0].step, 5);
bt = QLatin1String(" Thread 1 (Thread 0x7fb6ba260780 (LWP 16447)):\n[KCrash Handler]");
bt = QStringLiteral(" Thread 1 (Thread 0x7fb6ba260780 (LWP 16447)):\n[KCrash Handler]");
info = KateBtParser::parseBacktrace(bt);
QVERIFY(info.size() == 0);
}
......
......@@ -200,7 +200,7 @@ bool kateFileSelectorIsReadable (const QUrl& url)
return dir.exists ();
}
void KateFileBrowser::setDir(QUrl u)
void KateFileBrowser::setDir(const QUrl &u)
{
QUrl newurl;
......
......@@ -71,7 +71,7 @@ class KateFileBrowser : public QWidget
public Q_SLOTS:
void slotFilterChange(const QString&);
void setDir(QUrl);
void setDir(const QUrl &);
void setDir( const QString &url ) { setDir( QUrl( url ) ); }
void selectorViewChanged( QAbstractItemView * );
......
......@@ -31,7 +31,7 @@ class DummyDocument : public KTextEditor::Document
public:
DummyDocument (const QString &url = QString())
: KTextEditor::Document(nullptr, nullptr)
, m_name(QLatin1String("foo"))
, m_name(QStringLiteral("foo"))
, m_encoding()
, m_views()
{
......
......@@ -50,7 +50,7 @@ class ResultNode
s += QLatin1String(" ");
}
const QString name = rootNode.name.isEmpty() ? QLatin1String("ROOT") : rootNode.name;
const QString name = rootNode.name.isEmpty() ? QStringLiteral("ROOT") : rootNode.name;
s += QLatin1String("( ") + name;
if (rootNode.dir) {
......@@ -860,7 +860,7 @@ void FileTreeModelTest::rename_data()
QTest::newRow("empty") << ( QList<DummyDocument *>()
<< new DummyDocument()
) << 0 << QString::fromLatin1("file:///a/foo.txt")
) << 0 << QStringLiteral("file:///a/foo.txt")
<< (
ResultNode()
<< (ResultNode("a", true)
......@@ -869,7 +869,7 @@ void FileTreeModelTest::rename_data()
QTest::newRow("moving") << ( QList<DummyDocument *>()
<< new DummyDocument("file:///a/foo.txt")
) << 0 << QString::fromLatin1("file:///b/foo.txt")
) << 0 << QStringLiteral("file:///b/foo.txt")
<< (
ResultNode()
<< (ResultNode("b", true)
......@@ -879,7 +879,7 @@ void FileTreeModelTest::rename_data()
QTest::newRow("splitting") << ( QList<DummyDocument *>()
<< new DummyDocument("file:///a/foo.txt")
<< new DummyDocument("file:///a/bar.txt")
) << 0 << QString::fromLatin1("file:///b/foo.txt")
) << 0 << QStringLiteral("file:///b/foo.txt")
<< (
ResultNode()
<< (ResultNode("a", true)
......
......@@ -63,31 +63,31 @@ KateFileTree::KateFileTree(QWidget *parent): QTreeView(parent)
connect(this, &KateFileTree::activated, this, &KateFileTree::mouseClicked);
connect(this, &KateFileTree::clicked, this, &KateFileTree::mouseClicked);
m_filelistReloadDocument = new QAction(QIcon::fromTheme(QLatin1String("view-refresh")), i18nc("@action:inmenu", "Reloa&d"), this);
m_filelistReloadDocument = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18nc("@action:inmenu", "Reloa&d"), this);
connect(m_filelistReloadDocument, &QAction::triggered, this, &KateFileTree::slotDocumentReload);
m_filelistReloadDocument->setWhatsThis(i18n("Reload selected document(s) from disk."));
m_filelistCloseDocument = new QAction(QIcon::fromTheme(QLatin1String("document-close")), i18nc("@action:inmenu", "Close"), this);
m_filelistCloseDocument = new QAction(QIcon::fromTheme(QStringLiteral("document-close")), i18nc("@action:inmenu", "Close"), this);
connect(m_filelistCloseDocument, &QAction::triggered, this, &KateFileTree::slotDocumentClose);
m_filelistCloseDocument->setWhatsThis(i18n("Close the current document."));
m_filelistExpandRecursive = new QAction(QIcon::fromTheme(QLatin1String("view-list-tree")), i18nc("@action:inmenu", "Expand recursively"), this);
m_filelistExpandRecursive = new QAction(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18nc("@action:inmenu", "Expand recursively"), this);
connect(m_filelistExpandRecursive, &QAction::triggered, this, &KateFileTree::slotExpandRecursive);
m_filelistExpandRecursive->setWhatsThis(i18n("Expand the file list sub tree recursively."));
m_filelistCollapseRecursive = new QAction(QIcon::fromTheme(QLatin1String("view-list-tree")), i18nc("@action:inmenu", "Collapse recursively"), this);
m_filelistCollapseRecursive = new QAction(QIcon::fromTheme(QStringLiteral("view-list-tree")), i18nc("@action:inmenu", "Collapse recursively"), this);
connect(m_filelistCollapseRecursive, &QAction::triggered, this, &KateFileTree::slotCollapseRecursive);
m_filelistCollapseRecursive->setWhatsThis(i18n("Collapse the file list sub tree recursively."));
m_filelistCloseOtherDocument = new QAction(QIcon::fromTheme(QLatin1String("document-close")), i18nc("@action:inmenu", "Close Other"), this);
m_filelistCloseOtherDocument = new QAction(QIcon::fromTheme(QStringLiteral("document-close")), i18nc("@action:inmenu", "Close Other"), this);
connect(m_filelistCloseOtherDocument, &QAction::triggered, this, &KateFileTree::slotDocumentCloseOther);
m_filelistCloseOtherDocument->setWhatsThis(i18n("Close other documents in this folder."));
m_filelistCopyFilename = new QAction(QIcon::fromTheme(QLatin1String("edit-copy")), i18nc("@action:inmenu", "Copy File Path"), this);
m_filelistCopyFilename = new QAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18nc("@action:inmenu", "Copy File Path"), this);
connect(m_filelistCopyFilename, &QAction::triggered, this, &KateFileTree::slotCopyFilename);
m_filelistCopyFilename->setWhatsThis(i18n("Copy path and filename to the clipboard."));
m_filelistRenameFile = new QAction(QIcon::fromTheme(QLatin1String("edit-rename")), i18nc("@action:inmenu", "Rename File"), this);
m_filelistRenameFile = new QAction(QIcon::fromTheme(QStringLiteral("edit-rename")), i18nc("@action:inmenu", "Rename File"), this);
connect(m_filelistRenameFile, &QAction::triggered, this, &KateFileTree::slotRenameFile);
m_filelistRenameFile->setWhatsThis(i18n("Rename the selected file."));
......@@ -97,17 +97,17 @@ KateFileTree::KateFileTree(QWidget *parent): QTreeView(parent)
m_filelistPrintDocumentPreview = KStandardAction::printPreview(this, SLOT(slotPrintDocumentPreview()), this);
m_filelistPrintDocumentPreview->setWhatsThis(i18n("Show print preview of current document"));
m_filelistDeleteDocument = new QAction(QIcon::fromTheme(QLatin1String("edit-delete-shred")), i18nc("@action:inmenu", "Delete Document"), this);
m_filelistDeleteDocument = new QAction(QIcon::fromTheme(QStringLiteral("edit-delete-shred")), i18nc("@action:inmenu", "Delete Document"), this);
connect(m_filelistDeleteDocument, &QAction::triggered, this, &KateFileTree::slotDocumentDelete);
m_filelistDeleteDocument->setWhatsThis(i18n("Close and delete selected file from storage."));
QActionGroup *modeGroup = new QActionGroup(this);
m_treeModeAction = setupOption(modeGroup, QIcon::fromTheme(QLatin1String("view-list-tree")), i18nc("@action:inmenu", "Tree Mode"),
m_treeModeAction = setupOption(modeGroup, QIcon::fromTheme(QStringLiteral("view-list-tree")), i18nc("@action:inmenu", "Tree Mode"),
i18n("Set view style to Tree Mode"),
SLOT(slotTreeMode()), true);
m_listModeAction = setupOption(modeGroup, QIcon::fromTheme(QLatin1String("view-list-text")), i18nc("@action:inmenu", "List Mode"),
m_listModeAction = setupOption(modeGroup, QIcon::fromTheme(QStringLiteral("view-list-text")), i18nc("@action:inmenu", "List Mode"),
i18n("Set view style to List Mode"),
SLOT(slotListMode()), false);
......@@ -125,7 +125,7 @@ KateFileTree::KateFileTree(QWidget *parent): QTreeView(parent)
i18n("Sort by Opening Order"),
SLOT(slotSortOpeningOrder()), false);
m_resetHistory = new QAction(QIcon::fromTheme(QLatin1String("edit-clear-history")), i18nc("@action:inmenu", "Clear History"), this);
m_resetHistory = new QAction(QIcon::fromTheme(QStringLiteral("edit-clear-history")), i18nc("@action:inmenu", "Clear History"), this);
connect(m_resetHistory, &QAction::triggered, this, &KateFileTree::slotResetHistory);
m_resetHistory->setWhatsThis(i18n("Clear edit/view history."));
......@@ -257,7 +257,7 @@ void KateFileTree::contextMenuEvent(QContextMenuEvent *event)
view_menu->addAction(m_treeModeAction);
view_menu->addAction(m_listModeAction);
QMenu *sort_menu = menu.addMenu(QIcon::fromTheme(QLatin1String("view-sort-ascending")), i18nc("@action:inmenu", "Sort By"));
QMenu *sort_menu = menu.addMenu(QIcon::fromTheme(QStringLiteral("view-sort-ascending")), i18nc("@action:inmenu", "Sort By"));
sort_menu->addAction(m_sortByFile);
sort_menu->addAction(m_sortByPath);
sort_menu->addAction(m_sortByOpeningOrder);
......@@ -288,7 +288,7 @@ void KateFileTree::slotFixOpenWithMenu()
QMimeType mime = db.mimeTypeForName(doc->mimeType());
QAction *a = nullptr;
KService::List offers = KMimeTypeTrader::self()->query(mime.name(), QLatin1String("Application"));
KService::List offers = KMimeTypeTrader::self()->query(mime.name(), QStringLiteral("Application"));
// for each one, insert a menu item...
for (KService::List::Iterator it = offers.begin(); it != offers.end(); ++it) {
KService::Ptr service = *it;
......@@ -694,7 +694,7 @@ void KateFileTree::slotDocumentDelete()
bool go = (KMessageBox::warningContinueCancel(this,
i18n("Do you really want to delete file \"%1\" from storage?", url.toDisplayString()),
i18n("Delete file?"),
KStandardGuiItem::yes(), KStandardGuiItem::no(), QLatin1String("filetreedeletefile")
KStandardGuiItem::yes(), KStandardGuiItem::no(), QStringLiteral("filetreedeletefile")
) == KMessageBox::Continue);
if (!go) {
......
......@@ -125,11 +125,11 @@ QDebug operator<<(QDebug dbg, ProxyItem *item)
class ProxyItemDir : public ProxyItem
{
public:
ProxyItemDir(QString n, ProxyItemDir *p = nullptr) : ProxyItem(n, p) {
ProxyItemDir(const QString &n, ProxyItemDir *p = nullptr) : ProxyItem(n, p) {
setFlag(ProxyItem::Dir);
updateDisplay();
setIcon(QIcon::fromTheme(QLatin1String("folder")));
setIcon(QIcon::fromTheme(QStringLiteral("folder")));
}
};
......@@ -177,12 +177,12 @@ void ProxyItem::updateDisplay()
if (flag(ProxyItem::Dir) && m_parent && !m_parent->m_parent && m_parent->flag(ProxyItem::ShowFullPath)) {
m_display = m_path;
if (m_display.startsWith(QDir::homePath())) {
m_display.replace(0, QDir::homePath().length(), QLatin1String("~"));
m_display.replace(0, QDir::homePath().length(), QStringLiteral("~"));
}
} else {
m_display = m_path.section(QLatin1Char('/'), -1, -1);
if (flag(ProxyItem::Host) && (!m_parent || (m_parent && !m_parent->m_parent))) {
const QString hostPrefix = QString::fromLatin1("[%1]").arg(host());
const QString hostPrefix = QStringLiteral("[%1]").arg(host());
if (hostPrefix != m_display) {
m_display = hostPrefix + m_display;
}
......@@ -354,7 +354,7 @@ void ProxyItem::updateDocumentName()
const QString docName = m_doc ? m_doc->documentName() : QString();
if (flag(ProxyItem::Host)) {
m_documentName = QString::fromLatin1("[%1]%2").arg(m_host).arg(docName);
m_documentName = QStringLiteral("[%1]%2").arg(m_host, docName);
} else {
m_documentName = docName;
}
......@@ -364,7 +364,7 @@ void ProxyItem::updateDocumentName()
KateFileTreeModel::KateFileTreeModel(QObject *p)
: QAbstractItemModel(p)
, m_root(new ProxyItemDir(QLatin1String("m_root"), nullptr))
, m_root(new ProxyItemDir(QStringLiteral("m_root"), nullptr))
{
// setup default settings
// session init will set these all soon
......@@ -450,7 +450,7 @@ void KateFileTreeModel::clearModel()
beginRemoveRows(QModelIndex(), 0, qMax(m_root->childCount() - 1, 0));
delete m_root;
m_root = new ProxyItemDir(QLatin1String("m_root"), nullptr);
m_root = new ProxyItemDir(QStringLiteral("m_root"), nullptr);
m_docmap.clear();
m_viewHistory.clear();
......@@ -1285,7 +1285,7 @@ void KateFileTreeModel::updateItemPathAndHost(ProxyItem *item) const
item->clearFlag(ProxyItem::Empty);
host = doc->url().host();
if (!host.isEmpty()) {
path = QString::fromLatin1("[%1]%2").arg(host).arg(path);
path = QStringLiteral("[%1]%2").arg(host, path);
}
}
......@@ -1305,7 +1305,7 @@ void KateFileTreeModel::setupIcon(ProxyItem *item) const
QString icon_name;
if (item->flag(ProxyItem::Modified)) {
icon_name = QLatin1String("document-save");
icon_name = QStringLiteral("document-save");
} else {
const QUrl url(item->path());
icon_name = QMimeDatabase().mimeTypeForFile(url.path(), QMimeDatabase::MatchExtension).iconName();
......
......@@ -128,10 +128,10 @@ KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWind
, m_plug(plug)
, m_mainWindow(mainWindow)
{
KXMLGUIClient::setComponentName(QLatin1String("katefiletree"), i18n("Kate File Tree"));
setXMLFile(QLatin1String("ui.rc"));
KXMLGUIClient::setComponentName(QStringLiteral("katefiletree"), i18n("Kate File Tree"));
setXMLFile(QStringLiteral("ui.rc"));
m_toolView = mainWindow->createToolView(plug, QLatin1String("kate_private_plugin_katefiletreeplugin"), KTextEditor::MainWindow::Left, QIcon::fromTheme(QLatin1String("document-open")), i18n("Documents"));
m_toolView = mainWindow->createToolView(plug, QStringLiteral("kate_private_plugin_katefiletreeplugin"), KTextEditor::MainWindow::Left, QIcon::fromTheme(QStringLiteral("document-open")), i18n("Documents"));
Q_ASSERT(m_toolView->layout());
m_toolView->layout()->setMargin(0);
......@@ -224,32 +224,32 @@ KateFileTreePluginView::~KateFileTreePluginView()
void KateFileTreePluginView::setupActions()
{
auto aPrev = actionCollection()->addAction(QLatin1String("filetree_prev_document"));
auto aPrev = actionCollection()->addAction(QStringLiteral("filetree_prev_document"));
aPrev->setText(i18n("Previous Document"));
aPrev->setIcon(QIcon::fromTheme(QLatin1String("go-up")));
aPrev->setIcon(QIcon::fromTheme(QStringLiteral("go-up")));
actionCollection()->setDefaultShortcut(aPrev, Qt::ALT + Qt::Key_Up);
connect(aPrev, &QAction::triggered, m_fileTree, &KateFileTree::slotDocumentPrev);
auto aNext = actionCollection()->addAction(QLatin1String("filetree_next_document"));
auto aNext = actionCollection()->addAction(QStringLiteral("filetree_next_document"));
aNext->setText(i18n("Next Document"));
aNext->setIcon(QIcon::fromTheme(QLatin1String("go-down")));
aNext->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
actionCollection()->setDefaultShortcut(aNext, Qt::ALT + Qt::Key_Down);
connect(aNext, &QAction::triggered, m_fileTree, &KateFileTree::slotDocumentNext);
auto aShowActive = actionCollection()->addAction(QLatin1String("filetree_show_active_document"));
auto aShowActive = actionCollection()->addAction(QStringLiteral("filetree_show_active_document"));
aShowActive->setText(i18n("&Show Active"));
aShowActive->setIcon(QIcon::fromTheme(QLatin1String("folder-sync")));
aShowActive->setIcon(QIcon::fromTheme(QStringLiteral("folder-sync")));
connect(aShowActive, &QAction::triggered, this, &KateFileTreePluginView::showActiveDocument);
auto aSave = actionCollection()->addAction(QLatin1String("filetree_save"), this, SLOT(slotDocumentSave()));
auto aSave = actionCollection()->addAction(QStringLiteral("filetree_save"), this, SLOT(slotDocumentSave()));
aSave->setText(i18n("Save Current Document"));
aSave->setToolTip(i18n("Save the current document"));
aSave->setIcon(QIcon::fromTheme(QLatin1String("document-save")));
aSave->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
auto aSaveAs = actionCollection()->addAction(QLatin1String("filetree_save_as"), this, SLOT(slotDocumentSaveAs()));
auto aSaveAs = actionCollection()->addAction(QStringLiteral("filetree_save_as"), this, SLOT(slotDocumentSaveAs()));
aSaveAs->setText(i18n("Save Current Document As"));
aSaveAs->setToolTip(i18n("Save current document under new name"));
aSaveAs->setIcon(QIcon::fromTheme(QLatin1String("document-save-as")));
aSaveAs->setIcon(QIcon::fromTheme(QStringLiteral("document-save-as")));
/**
* add new & open, if hosting application has it
......
......@@ -63,7 +63,7 @@ const QStringList AdvancedGDBSettings::configs() const
tmp << u_gdbCmd->text();
switch(u_localRemote->currentIndex()) {
case 1:
tmp << QStringLiteral("target remote %1:%2").arg(u_tcpHost->text()).arg(u_tcpPort->text());
tmp << QStringLiteral("target remote %1:%2").arg(u_tcpHost->text(), u_tcpPort->text());
tmp << QString();
break;
case 2:
......
......@@ -99,7 +99,7 @@ void DebugView::runDebugger(const GDBTargetConf &conf, const QStringList &ioFifo
{
// On startup the gdb prompt will trigger the "nextCommands",
// here we have to trigger it manually.
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
m_nextCommands << QStringLiteral("file %1").arg(m_targetConf.executable);
m_nextCommands << QStringLiteral("set args %1 %2").arg(m_targetConf.arguments).arg(m_ioPipeString);
......@@ -303,7 +303,7 @@ void DebugView::processLine(QString line)
if(PromptStr == line)
{
// we get here after initialization
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
break;
......@@ -420,7 +420,7 @@ void DebugView::processLine(QString line)
m_state = ready;
// Give the error a possibility get noticed since stderr and stdout are not in sync
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
break;
......@@ -437,14 +437,14 @@ void DebugView::processLine(QString line)
else if(PromptStr == line)
{
m_state = ready;
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
break;
case infoArgs:
if(PromptStr == line)
{
m_state = ready;
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
else {
emit infoLocal(line);
......@@ -454,7 +454,7 @@ void DebugView::processLine(QString line)
if(PromptStr == line)
{
m_state = ready;
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
else {
emit infoLocal(line);
......@@ -465,7 +465,7 @@ void DebugView::processLine(QString line)
{
m_state = ready;
emit infoLocal(QString());
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
else {
emit infoLocal(line);
......@@ -476,7 +476,7 @@ void DebugView::processLine(QString line)
{
m_state = ready;
emit stackFrameInfo(QString(), QString());
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
else if (stackFrameAny.exactMatch(line))
{
......@@ -487,7 +487,7 @@ void DebugView::processLine(QString line)
if(PromptStr == line)
{
m_state = ready;
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
else if (threadLine.exactMatch(line))
{
......@@ -513,7 +513,7 @@ void DebugView::processErrors()
m_nextCommands << QStringLiteral("run");
m_nextCommands << QStringLiteral("p setvbuf(stdout, 0, %1, 1024)").arg(_IOLBF);
m_nextCommands << QStringLiteral("continue");
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
else if ((m_lastCommand == QLatin1String("step")) ||
(m_lastCommand == QLatin1String("next")) ||
......@@ -523,7 +523,7 @@ void DebugView::processErrors()
m_nextCommands << QStringLiteral("tbreak main");
m_nextCommands << QStringLiteral("run");
m_nextCommands << QStringLiteral("p setvbuf(stdout, 0, %1, 1024)").arg(_IOLBF);
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
else if ((m_lastCommand == QLatin1String("kill")))
{
......@@ -541,7 +541,7 @@ void DebugView::processErrors()
m_nextCommands << QStringLiteral("quit");
}
m_state = ready;
QTimer::singleShot(0, this, SLOT(issueNextCommand()));
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
}
// else do nothing
}
......
......@@ -109,7 +109,7 @@ void LocalsView::addLocal(const QString &vString)
symbolAndValue << isValue.cap(1);
// check out for "print *this"
if (isThisValue.exactMatch(symbolAndValue[0])) {
symbolAndValue[0] = QLatin1String("*this");
symbolAndValue[0] = QStringLiteral("*this");
}
value = isValue.cap(2);
}
......
......@@ -79,8 +79,8 @@ KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin *plugin, KTextEditor::M
m_focusOnInput = true;
m_activeThread = -1;
KXMLGUIClient::setComponentName (QLatin1String("kategdb"), i18n ("Kate GDB"));
setXMLFile(QLatin1String("ui.rc"));
KXMLGUIClient::setComponentName (QStringLiteral("kategdb"), i18n ("Kate GDB"));
setXMLFile(QStringLiteral("ui.rc"));
m_toolView = m_mainWin->createToolView(plugin, i18n("Debug View"),
KTextEditor::MainWindow::Bottom,
......@@ -257,13 +257,13 @@ KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin *plugin, KTextEditor::M
connect(m_menu->menu(), &QMenu::aboutToShow, this, &KatePluginGDBView::aboutToShowMenu);
m_breakpoint = m_menu->menu()->addAction(i18n("popup_breakpoint"),
this, SLOT(slotToggleBreakpoint()));
this, &KatePluginGDBView::slotToggleBreakpoint);
QAction* popupAction = m_menu->menu()->addAction(i18n("popup_run_to_cursor"),
this, SLOT(slotRunToCursor()));
this, &KatePluginGDBView::slotRunToCursor);
popupAction->setText(i18n("Run To Cursor"));
popupAction = m_menu->menu()->addAction(QStringLiteral("move_pc"),
this, SLOT(slotMovePC()));
this, &KatePluginGDBView::slotMovePC);
popupAction->setText(i18nc("Move Program Counter (next execution)", "Move PC"));
enableDebugActions(false);
......
......@@ -228,7 +228,7 @@ void KateCTagsConfigPage::updateGlobalDB()
return;
}
QString command = QStringLiteral("%1 -f %2 %3").arg(m_confUi.cmdEdit->text()).arg(file).arg(targets) ;
QString command = QStringLiteral("%1 -f %2 %3").arg(m_confUi.cmdEdit->text(), file, targets) ;
m_proc.start(command);
if(!m_proc.waitForStarted(500)) {
......
......@@ -42,32 +42,32 @@ KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
: QObject(mainWin)
, m_proc(nullptr)
{
KXMLGUIClient::setComponentName (QLatin1String("katectags"), i18n ("Kate CTag"));
setXMLFile( QLatin1String("ui.rc") );
KXMLGUIClient::setComponentName (QStringLiteral("katectags"), i18n ("Kate CTag"));
setXMLFile( QStringLiteral("ui.rc") );
m_toolView = mainWin->createToolView(plugin, QLatin1String("kate_plugin_katectagsplugin"),
m_toolView = mainWin->createToolView(plugin, QStringLiteral("kate_plugin_katectagsplugin"),
KTextEditor::MainWindow::Bottom,
QIcon::fromTheme(QStringLiteral("application-x-ms-dos-executable")),
i18n("CTags"));
m_mWin = mainWin;
QAction *back = actionCollection()->addAction(QLatin1String("ctags_return_step"));
QAction *back = actionCollection()->addAction(QStringLiteral("ctags_return_step"));
back->setText(i18n("Jump back one step"));
connect(back, &QAction::triggered, this, &KateCTagsView::stepBack);
QAction *decl = actionCollection()->addAction(QLatin1String("ctags_lookup_current_as_declaration"));
QAction *decl = actionCollection()->addAction(QStringLiteral("ctags_lookup_current_as_declaration"));
decl->setText(i18n("Go to Declaration"));
connect(decl, &QAction::triggered, this, &KateCTagsView::gotoDeclaration);
QAction *defin = actionCollection()->addAction(QLatin1String("ctags_lookup_current_as_definition"));
QAction *defin = actionCollection()->addAction(QStringLiteral("ctags_lookup_current_as_definition"));
defin->setText(i18n("Go to Definition"));
connect(defin, &QAction::triggered, this, &KateCTagsView::gotoDefinition);
QAction *lookup = actionCollection()->addAction(QLatin1String("ctags_lookup_current"));
QAction *lookup = actionCollection()->addAction(QStringLiteral("ctags_lookup_current"));
lookup->setText(i18n("Lookup Current Text"));
connect(lookup, &QAction::triggered, this, &KateCTagsView::lookupTag);
QAction *updateDB = actionCollection()->addAction(QLatin1String("ctags_update_global_db"));
QAction *updateDB = actionCollection()->addAction(QStringLiteral("ctags_update_global_db"));
updateDB->setText(i18n("Configure ..."));
connect(updateDB, &QAction::triggered, this, [this, plugin] (bool) {
if (m_mWin) {
......@@ -92,11 +92,11 @@ KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
// popup menu
m_menu = new KActionMenu(i18n("CTags"), this);
actionCollection()->addAction(QLatin1String("popup_ctags"), m_menu);
actionCollection()->addAction(QStringLiteral("popup_ctags"), m_menu);
m_gotoDec=m_menu->menu()->addAction(i18n("Go to Declaration: %1",QString()), this, SLOT(gotoDeclaration()));
m_gotoDef=m_menu->menu()->addAction(i18n("Go to Definition: %1",QString()), this, SLOT(gotoDefinition()));
m_lookup=m_menu->menu()->addAction(i18n("Lookup: %1",QString()), this, SLOT(lookupTag()));
m_gotoDec=m_menu->menu()->addAction(i18n("Go to Declaration: %1",QString()), this, &KateCTagsView::gotoDeclaration);
m_gotoDef=m_menu->menu()->addAction(i18n("Go to Definition: %1",QString()), this, &KateCTagsView::gotoDefinition);
m_lookup=m_menu->menu()->addAction(i18n("Lookup: %1",QString()), this, &KateCTagsView::lookupTag);
connect(m_menu->menu(), &QMenu::aboutToShow, this, &KateCTagsView::aboutToShow);
......@@ -540,7 +540,7 @@ void KateCTagsView::updateSessionDB()
}
QString command = QStringLiteral("%1 -f %2 %3").arg(m_ctagsUi.cmdEdit->text()).arg(m_ctagsUi.tagsFile->text()).arg(targets);
QString command = QStringLiteral("%1 -f %2 %3").arg(m_ctagsUi.cmdEdit->text(), m_ctagsUi.tagsFile->text(), targets);
m_proc.start(command);
......
......@@ -41,7 +41,7 @@
#include "ui_kate_ctags.h"
const static QString DEFAULT_CTAGS_CMD = QLatin1String("ctags -R --c++-types=+px --extra=+q --excmd=pattern --exclude=Makefile --exclude=.");
const static QString DEFAULT_CTAGS_CMD = QStringLiteral("ctags -R --c++-types=+px --extra=+q --excmd=pattern --exclude=Makefile --exclude=.");
typedef struct
{
......
......@@ -99,7 +99,7 @@ Tags::TagList Tags::getMatches( const QString & tagpart, bool partial, const QSt
if ( type.isEmpty() && file.endsWith( QLatin1String("Makefile") ) )
{
type = QLatin1String("macro");
type = QStringLiteral("macro");
}
if ( types.isEmpty() || types.contains( QString::fromLocal8Bit(entry.kind) ) )
{
......
......@@ -96,8 +96,8 @@ KateBuildView::KateBuildView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
, m_filenameDetectorGccWorked(false)
, m_newDirDetector(QStringLiteral("make\\[.+\\]: .+ `.*'"))
{
KXMLGUIClient::setComponentName (QLatin1String("katebuild"), i18n ("Kate Build Plugin"));
setXMLFile(QLatin1String("ui.rc"));
KXMLGUIClient::setComponentName (QStringLiteral("katebuild"), i18n ("Kate Build Plugin"));
setXMLFile(QStringLiteral("ui.rc"));
m_toolView = mw->createToolView(plugin, QStringLiteral("kate_plugin_katebuildplugin"),
KTextEditor::MainWindow::Bottom,
......@@ -642,7 +642,7 @@ bool KateBuildView::buildCurrentTarget()
buildCmd.replace(QStringLiteral("%d"), docFInfo.absolutePath());
}
m_filenameDetectorGccWorked = false;
m_currentlyBuildingTarget = QStringLiteral("%1: %2").arg(targetSet).arg(cmdName);
m_currentlyBuildingTarget = QStringLiteral("%1: %2").arg(targetSet, cmdName);
m_buildCancelled = false;
QString msg = i18n("Building target <b>%1</b> ...", m_currentlyBuildingTarget);
m_buildUi.buildStatusLabel->setText(msg);
......
......@@ -30,10 +30,10 @@
ConnectionModel::ConnectionModel(QObject *parent)
: QAbstractListModel(parent)
{
m_icons[Connection::UNKNOWN] = QIcon::fromTheme(QLatin1String("user-offline"));
m_icons[Connection::ONLINE] = QIcon::fromTheme(QLatin1String("user-online"));
m_icons[Connection::OFFLINE] = QIcon::fromTheme(QLatin1String("user-offline"));
m_icons[Connection::REQUIRE_PASSWORD] = QIcon::fromTheme(QLatin1String("user-invisible"));
m_icons[Connection::UNKNOWN] = QIcon::fromTheme(QStringLiteral("user-offline"));
m_icons[Connection::ONLINE] = QIcon::fromTheme(QStringLiteral("user-online"));
m_icons[Connection::OFFLINE] = QIcon::fromTheme(QStringLiteral("user-offline"));