Commit b298f1cc authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Fix some build warnings


Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <waqar.17a@gmail.com>
parent b9641c91
......@@ -10,6 +10,7 @@
#include "katebookmarkhandler.h"
#include "katefilebrowser.h"
#include <KActionCollection>
#include <KDirOperator>
#include <QMenu>
......@@ -33,7 +34,18 @@ KateBookmarkHandler::KateBookmarkHandler(KateFileBrowser *parent, QMenu *kpopupm
KBookmarkManager *manager = KBookmarkManager::managerForFile(file, QStringLiteral("kate"));
manager->setUpdate(true);
m_bookmarkMenu = new KBookmarkMenu(manager, this, m_menu, parent->actionCollection());
m_bookmarkMenu = new KBookmarkMenu(manager, this, m_menu);
KActionCollection *ac = parent->actionCollection();
if (QAction *addBookmarkAction = m_bookmarkMenu->addBookmarkAction()) {
ac->addAction(addBookmarkAction->objectName(), addBookmarkAction);
}
if (QAction *newBookmarkFolderAction = m_bookmarkMenu->newBookmarkFolderAction()) {
ac->addAction(newBookmarkFolderAction->objectName(), newBookmarkFolderAction);
}
if (QAction *editBookmarksAction = m_bookmarkMenu->editBookmarksAction()) {
ac->addAction(editBookmarksAction->objectName(), editBookmarksAction);
}
}
KateBookmarkHandler::~KateBookmarkHandler()
......
......@@ -55,7 +55,7 @@ KateFileBrowserConfigPage::KateFileBrowserConfigPage(QWidget *parent, KateFileBr
, fileBrowser(kfb)
{
QVBoxLayout *lo = new QVBoxLayout(this);
int spacing = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing);
int spacing = QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
lo->setSpacing(spacing);
lo->setContentsMargins(0, 0, 0, 0);
......
......@@ -496,7 +496,7 @@ KateKonsoleConfigPage::KateKonsoleConfigPage(QWidget *parent, KateKonsolePlugin
, mPlugin(plugin)
{
QVBoxLayout *lo = new QVBoxLayout(this);
lo->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
lo->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
lo->setContentsMargins(0, 0, 0, 0);
cbAutoSyncronize = new QCheckBox(i18n("&Automatically synchronize the terminal with the current document when possible"), this);
......
......@@ -1893,7 +1893,7 @@ public:
auto location = QStringLiteral("%1:%2").arg(basename).arg(related.location.range.start().line());
relatedItemMessage->setText(QStringLiteral("[%1] %2").arg(location).arg(related.message));
relatedItemMessage->setData(diagnosticsIcon(LSPDiagnosticSeverity::Information), Qt::DecorationRole);
item->appendRow({relatedItemMessage});
item->appendRow(relatedItemMessage);
m_diagnosticsTree->setExpanded(item->index(), true);
}
}
......
......@@ -49,6 +49,7 @@ public:
, m_change(change_ms)
, m_motion(motion_ms)
{
Q_UNUSED(m_plugin);
// get updated
m_changeTimer.setSingleShot(true);
auto ch = [this]() {
......
......@@ -146,35 +146,6 @@ public:
QRect prect = opt.rect;
// const int ascent = (opt.fontMetrics.ascent() / 2);
// draw line
// prect.setX(prect.x() + ascent + 2);
// auto sp = painter->pen();
// auto p = painter->pen();
// p.setWidth(2);
// painter->setPen(p);
// auto p1 = prect.bottomLeft();
// int w = opt.fontMetrics.ascent();
// int h = opt.rect.height();
// int r = w / 3;
// p1.ry() -= (h / 2) - r;
// painter->setRenderHint(QPainter::Antialiasing, true);
// QPoint pp = p1;
// pp.ry() -= 3 + 1;
// painter->drawLine(prect.topLeft(), pp);
// painter->drawEllipse(p1, r, r);
// auto p2 = p1;
// p2.ry() += r + 1;
// painter->drawLine(p2, prect.bottomLeft());
// painter->setRenderHint(QPainter::Antialiasing, false);
// painter->setPen(sp);
// padding
prect.setX(prect.x() + 5);
prect.setY(prect.y() + lineHeight);
......@@ -188,8 +159,9 @@ public:
// draw author on right
auto dt = QDateTime::fromSecsSinceEpoch(commit.authorDate);
QString timestamp =
(dt.date() == QDate::currentDate()) ? dt.time().toString(Qt::DefaultLocaleShortDate) : dt.date().toString(Qt::DefaultLocaleShortDate);
QLocale l;
const bool isToday = dt.date() == QDate::currentDate();
QString timestamp = isToday ? l.toString(dt.time(), QLocale::ShortFormat) : l.toString(dt.date(), QLocale::ShortFormat);
painter->drawText(prect, Qt::AlignRight, timestamp);
// draw commit hash
......
......@@ -116,7 +116,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
if ((current == QLatin1Char('c')) && (stripped.indexOf(QLatin1String("class"), c) == c)) {
identifier.clear();
c += 6;
for (c = c; c < stripped.length(); c++) {
for (/*c = c*/; c < stripped.length(); c++) {
current = stripped.at(c);
// look for the beginning of the class itself
if ((current == QLatin1Char('(')) || (current == QLatin1Char('{'))) {
......@@ -152,7 +152,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
c += 8;
// look for the beginning of the parameters
identifier.clear();
for (c = c; c < stripped.length(); c++) {
for (/*c = c*/; c < stripped.length(); c++) {
current = stripped.at(c);
// look for the beginning of the function definition
if ((current == QLatin1Char('(')) || (current == QLatin1Char('{'))) {
......@@ -241,7 +241,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
c += 3;
identifier.clear();
// parse the id name
for (c = c; c < stripped.length(); c++) {
for (/*c = c*/; c < stripped.length(); c++) {
current = stripped.at(c);
// look for the beginning of the id
if (current == QLatin1Char(';')) {
......
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