Commit 3a470cd2 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

apply make clang-format

parent 9e0be5ef
......@@ -78,7 +78,6 @@ static QStringList normalizeBt(const QStringList &l)
static BtInfo parseBtLine(const QString &line)
{
// the syntax types we support are
// a) #24 0xb688ff8e in QApplication::notify (this=0xbf997e8c, receiver=0x82607e8, e=0xbf997074) at kernel/qapplication.cpp:3115
// b) #39 0xb634211c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
......
......@@ -22,9 +22,9 @@
#include "btfileindexer.h"
#include "btparser.h"
#include <KAboutData>
#include <KConfigGroup>
#include <KLineEdit>
#include <KAboutData>
#include <KLocalizedString> // i18n
#include <KPluginFactory>
#include <KPluginLoader>
......
......@@ -31,12 +31,12 @@
#include "ui_close_confirm_dialog.h"
#include <KTextEditor/Document>
#include <KToggleAction>
#include <KWindowConfig>
#include <QCheckBox>
#include <QDialog>
#include <QList>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <KWindowConfig>
namespace kate
{
......
......@@ -24,8 +24,8 @@
#include "configview.h"
#include <QCompleter>
#include <QFileSystemModel>
#include <QFileDialog>
#include <QFileSystemModel>
#include <QLayout>
#include <QPushButton>
#include <QTimer>
......
......@@ -37,10 +37,10 @@
#include <QList>
#include <KTextEditor/MainWindow>
#include <KActionCollection>
#include <KConfigGroup>
#include <KSelectAction>
#include <KTextEditor/MainWindow>
struct GDBTargetConf {
QString executable;
......
......@@ -18,9 +18,9 @@
// Boston, MA 02110-1301, USA.
#include "localsview.h"
#include <KLocalizedString>
#include <QDebug>
#include <QLabel>
#include <KLocalizedString>
LocalsView::LocalsView(QWidget *parent)
: QTreeWidget(parent)
......
......@@ -357,7 +357,7 @@ void KatePluginGDBView::slotToggleBreakpoint()
void KatePluginGDBView::slotBreakpointSet(const QUrl &file, int line)
{
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5,69,0)
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5, 69, 0)
KTextEditor::MarkInterfaceV2 *iface = qobject_cast<KTextEditor::MarkInterfaceV2 *>(m_kateApplication->findUrl(file));
#else
KTextEditor::MarkInterface *iface = qobject_cast<KTextEditor::MarkInterface *>(m_kateApplication->findUrl(file));
......@@ -365,7 +365,7 @@ void KatePluginGDBView::slotBreakpointSet(const QUrl &file, int line)
if (iface) {
iface->setMarkDescription(KTextEditor::MarkInterface::BreakpointActive, i18n("Breakpoint"));
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5,69,0)
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5, 69, 0)
iface->setMarkIcon(KTextEditor::MarkInterface::BreakpointActive, QIcon::fromTheme(QStringLiteral("media-playback-pause")));
#else
iface->setMarkPixmap(KTextEditor::MarkInterface::BreakpointActive, QIcon::fromTheme(QStringLiteral("media-playback-pause")).pixmap(10, 10));
......@@ -458,7 +458,7 @@ void KatePluginGDBView::enableDebugActions(bool enable)
m_ioView->enableInput(!enable && m_debugView->debuggerRunning());
if ((m_lastExecLine > -1)) {
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5,69,0)
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5, 69, 0)
KTextEditor::MarkInterfaceV2 *iface = qobject_cast<KTextEditor::MarkInterfaceV2 *>(m_kateApplication->findUrl(m_lastExecUrl));
#else
KTextEditor::MarkInterface *iface = qobject_cast<KTextEditor::MarkInterface *>(m_kateApplication->findUrl(m_lastExecUrl));
......@@ -467,7 +467,7 @@ void KatePluginGDBView::enableDebugActions(bool enable)
if (iface) {
if (enable) {
iface->setMarkDescription(KTextEditor::MarkInterface::Execution, i18n("Execution point"));
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5,69,0)
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5, 69, 0)
iface->setMarkIcon(KTextEditor::MarkInterface::Execution, QIcon::fromTheme(QStringLiteral("arrow-right")));
#else
iface->setMarkPixmap(KTextEditor::MarkInterface::Execution, QIcon::fromTheme(QStringLiteral("arrow-right")).pixmap(10, 10));
......
......@@ -29,42 +29,46 @@ static const CTagsKindMapping kindMappingAsp[] = {{'f', I18N_NOOP2("Tag Type", "
static const CTagsKindMapping kindMappingAwk[] = {{'f', I18N_NOOP2("Tag Type", "function")}, {0, nullptr}};
static const CTagsKindMapping kindMappingBeta[] = {{'f', I18N_NOOP2("Tag Type", "fragment definition")}, {'p', I18N_NOOP2("Tag Type", "any pattern")}, {'s', I18N_NOOP2("Tag Type", "slot")}, {'v', I18N_NOOP2("Tag Type", "pattern")}, {0, nullptr}};
static const CTagsKindMapping kindMappingBeta[] = {{'f', I18N_NOOP2("Tag Type", "fragment definition")},
{'p', I18N_NOOP2("Tag Type", "any pattern")},
{'s', I18N_NOOP2("Tag Type", "slot")},
{'v', I18N_NOOP2("Tag Type", "pattern")},
{0, nullptr}};
static const CTagsKindMapping kindMappingC[] = {{'c', I18N_NOOP2("Tag Type", "class")},
{'d', I18N_NOOP2("Tag Type", "macro")},
{'e', I18N_NOOP2("Tag Type", "enumerator")},
{'f', I18N_NOOP2("Tag Type", "function")},
{'g', I18N_NOOP2("Tag Type", "enumeration")},
{'m', I18N_NOOP2("Tag Type", "member")},
{'n', I18N_NOOP2("Tag Type", "namespace")},
{'p', I18N_NOOP2("Tag Type", "prototype")},
{'s', I18N_NOOP2("Tag Type", "struct")},
{'t', I18N_NOOP2("Tag Type", "typedef")},
{'u', I18N_NOOP2("Tag Type", "union")},
{'v', I18N_NOOP2("Tag Type", "variable")},
{'x', I18N_NOOP2("Tag Type", "external variable")},
{0, nullptr}};
{'d', I18N_NOOP2("Tag Type", "macro")},
{'e', I18N_NOOP2("Tag Type", "enumerator")},
{'f', I18N_NOOP2("Tag Type", "function")},
{'g', I18N_NOOP2("Tag Type", "enumeration")},
{'m', I18N_NOOP2("Tag Type", "member")},
{'n', I18N_NOOP2("Tag Type", "namespace")},
{'p', I18N_NOOP2("Tag Type", "prototype")},
{'s', I18N_NOOP2("Tag Type", "struct")},
{'t', I18N_NOOP2("Tag Type", "typedef")},
{'u', I18N_NOOP2("Tag Type", "union")},
{'v', I18N_NOOP2("Tag Type", "variable")},
{'x', I18N_NOOP2("Tag Type", "external variable")},
{0, nullptr}};
static const CTagsKindMapping kindMappingCobol[] = {{'p', I18N_NOOP2("Tag Type", "paragraph")}, {0, nullptr}};
static const CTagsKindMapping kindMappingEiffel[] = {{'c', I18N_NOOP2("Tag Type", "class")}, {'f', I18N_NOOP2("Tag Type", "feature")}, {'l', I18N_NOOP2("Tag Type", "local entity")}, {0, nullptr}};
static const CTagsKindMapping kindMappingFortran[] = {{'b', I18N_NOOP2("Tag Type", "block")},
{'c', I18N_NOOP2("Tag Type", "common")},
{'e', I18N_NOOP2("Tag Type", "entry")},
{'f', I18N_NOOP2("Tag Type", "function")},
{'i', I18N_NOOP2("Tag Type", "interface")},
{'k', I18N_NOOP2("Tag Type", "type component")},
{'l', I18N_NOOP2("Tag Type", "label")},
{'L', I18N_NOOP2("Tag Type", "local")},
{'m', I18N_NOOP2("Tag Type", "module")},
{'n', I18N_NOOP2("Tag Type", "namelist")},
{'p', I18N_NOOP2("Tag Type", "program")},
{'s', I18N_NOOP2("Tag Type", "subroutine")},
{'t', I18N_NOOP2("Tag Type", "type")},
{'v', I18N_NOOP2("Tag Type", "variable")},
{0, nullptr}};
{'c', I18N_NOOP2("Tag Type", "common")},
{'e', I18N_NOOP2("Tag Type", "entry")},
{'f', I18N_NOOP2("Tag Type", "function")},
{'i', I18N_NOOP2("Tag Type", "interface")},
{'k', I18N_NOOP2("Tag Type", "type component")},
{'l', I18N_NOOP2("Tag Type", "label")},
{'L', I18N_NOOP2("Tag Type", "local")},
{'m', I18N_NOOP2("Tag Type", "module")},
{'n', I18N_NOOP2("Tag Type", "namelist")},
{'p', I18N_NOOP2("Tag Type", "program")},
{'s', I18N_NOOP2("Tag Type", "subroutine")},
{'t', I18N_NOOP2("Tag Type", "type")},
{'v', I18N_NOOP2("Tag Type", "variable")},
{0, nullptr}};
static const CTagsKindMapping kindMappingJava[] =
{{'c', I18N_NOOP2("Tag Type", "class")}, {'f', I18N_NOOP2("Tag Type", "field")}, {'i', I18N_NOOP2("Tag Type", "interface")}, {'m', I18N_NOOP2("Tag Type", "method")}, {'p', I18N_NOOP2("Tag Type", "package")}, {0, nullptr}};
......
......@@ -86,7 +86,7 @@ private:
QProcess m_proc;
KateCTagsPlugin *m_plugin;
Ui_CTagsGlobalConfig m_confUi{};
Ui_CTagsGlobalConfig m_confUi {};
};
#endif
......@@ -32,10 +32,10 @@
#include <KXMLGUIFactory>
#include <QMenu>
#include <QStandardPaths>
#include <KLocalizedString>
#include <KMessageBox>
#include <KStringHandler>
#include <QStandardPaths>
/******************************************************************/
KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWin)
......
......@@ -97,7 +97,7 @@ private:
QPointer<KTextEditor::MainWindow> m_mWin;
QPointer<QWidget> m_toolView;
Ui::kateCtags m_ctagsUi{};
Ui::kateCtags m_ctagsUi {};
QPointer<KActionMenu> m_menu;
QAction *m_gotoDef;
......
......@@ -21,6 +21,7 @@
#include "TargetHtmlDelegate.h"
#include "TargetModel.h"
#include <KLocalizedString>
#include <QAbstractTextDocumentLayout>
#include <QCompleter>
#include <QFileSystemModel>
......@@ -30,7 +31,6 @@
#include <QTextCharFormat>
#include <QTextDocument>
#include <QToolButton>
#include <KLocalizedString>
#include "UrlInserter.h"
......
......@@ -19,9 +19,9 @@
***************************************************************************/
#include "TargetModel.h"
#include <KLocalizedString>
#include <QDebug>
#include <QTimer>
#include <KLocalizedString>
TargetModel::TargetSet::TargetSet(const QString &_name, const QString &_dir)
: name(_name)
......
......@@ -19,14 +19,14 @@
***************************************************************************/
#include "UrlInserter.h"
#include <KLocalizedString>
#include <QCompleter>
#include <QDebug>
#include <QFileSystemModel>
#include <QFileDialog>
#include <QFileInfo>
#include <QFileSystemModel>
#include <QHBoxLayout>
#include <QIcon>
#include <KLocalizedString>
UrlInserter::UrlInserter(const QUrl &startUrl, QWidget *parent)
: QWidget(parent)
......
......@@ -400,23 +400,27 @@ void KateBuildView::slotPrev()
QString KateBuildView::caseFixed(const QString &path)
{
QStringList paths = path.split(QLatin1Char('/'));
if (paths.isEmpty()) { return path; }
if (paths.isEmpty()) {
return path;
}
QString result = paths[0].toUpper() + QLatin1Char('/');
for (int i=1; i<paths.count(); ++i) {
for (int i = 1; i < paths.count(); ++i) {
QDir curDir(result);
const QStringList items = curDir.entryList();
int j;
for (j=0; j<items.size(); ++j) {
for (j = 0; j < items.size(); ++j) {
if (items[j].compare(paths[i], Qt::CaseInsensitive) == 0) {
result += items[j];
if (i < paths.count()-1) {
if (i < paths.count() - 1) {
result += QLatin1Char('/');
}
break;
}
}
if (j==items.size()) { return path; }
if (j == items.size()) {
return path;
}
}
return result;
}
......@@ -546,7 +550,7 @@ void KateBuildView::clearMarks()
void KateBuildView::addMarks(KTextEditor::Document *doc, bool mark)
{
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5,69,0)
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5, 69, 0)
KTextEditor::MarkInterfaceV2 *iface = qobject_cast<KTextEditor::MarkInterfaceV2 *>(doc);
#else
KTextEditor::MarkInterface *iface = qobject_cast<KTextEditor::MarkInterface *>(doc);
......@@ -586,7 +590,7 @@ void KateBuildView::addMarks(KTextEditor::Document *doc, bool mark)
}
if (markType) {
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5,69,0)
#if KTEXTEDITOR_VERSION >= QT_VERSION_CHECK(5, 69, 0)
iface->setMarkIcon(markType, messageIcon(category));
#else
const int ps = 32;
......@@ -1071,7 +1075,7 @@ void KateBuildView::processLine(const QString &line)
filename = QFileInfo(filename).filePath();
#endif
//qDebug() << "File Name:"<<m_make_dir << filename << " msg:"<< msg;
// qDebug() << "File Name:"<<m_make_dir << filename << " msg:"<< msg;
// add path to file
if (QFile::exists(m_make_dir + QLatin1Char('/') + filename)) {
filename = m_make_dir + QLatin1Char('/') + filename;
......
......@@ -134,7 +134,7 @@ private:
KTextEditor::MainWindow *m_win;
QWidget *m_toolView;
Ui::build m_buildUi{};
Ui::build m_buildUi {};
QWidget *m_buildWidget;
int m_outputWidgetWidth;
TargetsUi *m_targetsUi;
......
......@@ -18,11 +18,11 @@
// Boston, MA 02110-1301, USA.
#include "targets.h"
#include <KLocalizedString>
#include <QDebug>
#include <QEvent>
#include <QIcon>
#include <QKeyEvent>
#include <KLocalizedString>
TargetsUi::TargetsUi(QObject *view, QWidget *parent)
: QWidget(parent)
......
......@@ -19,10 +19,10 @@
#include "connectionmodel.h"
#include <QDebug>
#include <QFontDatabase>
#include <QIcon>
#include <QFont>
#include <QFontDatabase>
#include <QFontMetrics>
#include <QIcon>
#include <QSize>
#include <QStringList>
#include <QVariant>
......
......@@ -22,8 +22,8 @@
#include "connection.h"
#include <QAbstractListModel>
#include <QIcon>
#include <QHash>
#include <QIcon>
#include <QString>
class ConnectionModel : public QAbstractListModel
......
......@@ -25,8 +25,8 @@
#include <KMessageBox>
#include <KUrlRequester>
#include <QSpinBox>
#include <QFormLayout>
#include <QSpinBox>
#include <QSqlDatabase>
#include <QSqlError>
......
......@@ -19,10 +19,10 @@
#include "dataoutputmodel.h"
#include "outputstyle.h"
#include <KSharedConfig>
#include <KColorScheme>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <QFontDatabase>
#include <QLocale>
......
......@@ -27,25 +27,24 @@
#include <ktexteditor/mainwindow.h>
#include <ktexteditor/view.h>
#include <QAction>
#include <KLocalizedString>
#include <KMessageBox>
#include <KToggleAction>
#include <KToolBar>
#include <QAction>
#include <QApplication>
#include <QClipboard>
#include <QElapsedTimer>
#include <QStyle>
#include <QTime>
#include <QClipboard>
#include <QFile>
#include <QHeaderView>
#include <QLayout>
#include <QSize>
#include <QSqlError>
#include <QSqlQuery>
#include <QStyle>
#include <QTextStream>
#include <QTime>
#include <QTimer>
DataOutputWidget::DataOutputWidget(QWidget *parent)
......
......@@ -19,9 +19,9 @@
#include "katesqlconfigpage.h"
#include "outputstylewidget.h"
#include <KSharedConfig>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <QBoxLayout>
#include <QCheckBox>
......
......@@ -35,21 +35,21 @@
#include <ktexteditor/plugin.h>
#include <ktexteditor/view.h>
#include <KSharedConfig>
#include <KXMLGUIFactory>
#include <QAction>
#include <KActionCollection>
#include <KComboBox>
#include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KXMLGUIFactory>
#include <QAction>
#include <QApplication>
#include <QVBoxLayout>
#include <QWidgetAction>
#include <QMenu>
#include <QSqlQuery>
#include <QString>
#include <QVBoxLayout>
#include <QWidgetAction>
KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mw)
: QObject(mw)
......
......@@ -19,11 +19,11 @@
#include "outputstylewidget.h"
#include <KSharedConfig>
#include <QFontDatabase>
#include <QIcon>
#include <QBrush>
#include <QCheckBox>
#include <QFont>
#include <QFontDatabase>
#include <QIcon>
#include <QVariant>
#include <KColorButton>
......
......@@ -20,8 +20,8 @@
#include "outputwidget.h"
#include "dataoutputwidget.h"
#include <KLocalizedString>
#include "textoutputwidget.h"
#include <KLocalizedString>
KateSQLOutputWidget::KateSQLOutputWidget(QWidget *parent)
: QTabWidget(parent)
......
......@@ -19,8 +19,8 @@
#include "schemabrowserwidget.h"
#include "schemawidget.h"
#include <QVBoxLayout>
#include <QTreeView>
#include <QVBoxLayout>
SchemaBrowserWidget::SchemaBrowserWidget(QWidget *parent, SQLManager *manager)
: QWidget(parent)
......
......@@ -27,16 +27,16 @@
#include <QApplication>
#include <QDrag>
#include <QMimeData>
#include <QEvent>
#include <QMenu>
#include <QMimeData>
#include <QMouseEvent>
#include <QSqlDatabase>
#include <QSqlField>
#include <QSqlIndex>
#include <QSqlRecord>
#include <QStringList>
#include <QVariant>
#include <QMouseEvent>
SchemaWidget::SchemaWidget(QWidget *parent, SQLManager *manager)
: QTreeWidget(parent)
......
......@@ -22,10 +22,10 @@
class SQLManager;
class QMouseEvent;
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QSqlDriver>
#include <QString>
#include <QTreeWidget>
#include <QTreeWidgetItem>
class SchemaWidget : public QTreeWidget
{
......
......@@ -19,14 +19,14 @@
#include "textoutputwidget.h"
#include "connection.h"
#include <QAction>
#include <KLocalizedString>
#include <KToolBar>
#include <QAction>
#include <QFontDatabase>
#include <QStyle>
#include <QDateTime>
#include <QFontDatabase>
#include <QLayout>
#include <QStyle>
#include <QTextEdit>
TextOutputWidget::TextOutputWidget(QWidget *parent)
......
......@@ -27,11 +27,11 @@
#include <ktexteditor/message.h>
#include <ktexteditor/view.h>
#include <QAction>
#include <KActionCollection>
#include <KShell>
#include <QAction>
#include <kde_terminal_interface.h>
#include <kparts/part.h>
#include <KShell>
#include <KMessageBox>
......@@ -47,14 +47,13 @@
#include <QStyle>
#include <QVBoxLayout>
#include <KAboutData>
#include <KAuthorized>
#include <KConfigGroup>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KSharedConfig>
#include <KXMLGUIFactory>
#include <KAboutData>
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(KateKonsolePluginFactory, "katekonsoleplugin.json", registerPlugin<KateKonsolePlugin>();)
......
......@@ -255,10 +255,10 @@ public:
// maybe use WaitForReset ??
// but more complex and already l