Commit 77377da9 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Run clang-format

If you want git blame to ignore formatting revisions run:
git config blame.ignoreRevsFile .git-blame-ignore-revs
parent 2daeffda
This diff is collapsed.
/*******************************************************************
* aboutbugreportingdialog.h
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
* aboutbugreportingdialog.h
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
#ifndef ABOUTBUGREPORTINGDIALOG__H
#define ABOUTBUGREPORTINGDIALOG__H
......@@ -13,20 +13,20 @@
class QTextBrowser;
class AboutBugReportingDialog: public QDialog
class AboutBugReportingDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutBugReportingDialog(QWidget * parent = nullptr);
explicit AboutBugReportingDialog(QWidget *parent = nullptr);
~AboutBugReportingDialog() override;
void showSection(const QString&);
void showSection(const QString &);
private Q_SLOTS:
void handleInternalLinks(const QUrl& url);
void handleInternalLinks(const QUrl &url);
private:
QTextBrowser * m_textBrowser = nullptr;
QTextBrowser *m_textBrowser = nullptr;
};
#endif
/*******************************************************************
* applicationdetailsexamples.cpp
* SPDX-FileCopyrightText: 2010 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
* applicationdetailsexamples.cpp
* SPDX-FileCopyrightText: 2010 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
#include "applicationdetailsexamples.h"
#include <KLocalizedString>
#include "drkonqi.h"
#include "crashedapplication.h"
#include "drkonqi.h"
ApplicationDetailsExamples::ApplicationDetailsExamples(QObject * parent)
ApplicationDetailsExamples::ApplicationDetailsExamples(QObject *parent)
: QObject(parent)
{
QString binaryName = DrKonqi::crashedApplication()->fakeExecutableBaseName();
if (binaryName == QLatin1String("plasmashell")) {
m_examples = i18nc("@info examples about information the user can provide",
"Widgets you have in your desktop and panels (both official and unofficial), "
"desktop settings (wallpaper plugin, themes) and activities.");
m_examples = i18nc("@info examples about information the user can provide",
"Widgets you have in your desktop and panels (both official and unofficial), "
"desktop settings (wallpaper plugin, themes) and activities.");
} else if (binaryName == QLatin1String("kwin_x11") || binaryName == QLatin1String("kwin_wayland")) {
m_examples = i18nc("@info examples about information the user can provide",
"State of Desktop Effects (Compositing), kind of effects enabled, window decoration, "
"and specific window rules and configuration.");
} else if (binaryName == QLatin1String("konqueror") ||
binaryName == QLatin1String("rekonq")) {
"State of Desktop Effects (Compositing), kind of effects enabled, window decoration, "
"and specific window rules and configuration.");
} else if (binaryName == QLatin1String("konqueror") || binaryName == QLatin1String("rekonq")) {
m_examples = i18nc("@info examples about information the user can provide",
"sites you were visiting, number of opened tabs, plugins you have installed, "
"and any other non-default setting.");
"sites you were visiting, number of opened tabs, plugins you have installed, "
"and any other non-default setting.");
} else if (binaryName == QLatin1String("dolphin")) {
m_examples = i18nc("@info examples about information the user can provide",
"File view mode, grouping and sorting settings, preview settings, and directory you were browsing.");
"File view mode, grouping and sorting settings, preview settings, and directory you were browsing.");
} else if (binaryName == QLatin1String("kopete")) {
m_examples = i18nc("@info examples about information the user can provide",
"Instant Messaging protocols you use, and plugins you have installed (official and unofficial).");
"Instant Messaging protocols you use, and plugins you have installed (official and unofficial).");
} else if (binaryName == QLatin1String("kmail")) {
m_examples = i18nc("@info examples about information the user can provide",
"Mail protocols and account-types you use.");
} else if (binaryName == QLatin1String("kwrite") ||
binaryName == QLatin1String("kate") ||
binaryName == QLatin1String("kword")) {
m_examples = i18nc("@info examples about information the user can provide",
"Type of the document you were editing.");
} else if (binaryName == QLatin1String("juk") ||
binaryName == QLatin1String("amarok") ||
binaryName == QLatin1String("dragon") ||
binaryName == QLatin1String("kaffeine")) {
m_examples = i18nc("@info examples about information the user can provide",
"Type of media (extension and format) you were watching and/or listening to.");
m_examples = i18nc("@info examples about information the user can provide", "Mail protocols and account-types you use.");
} else if (binaryName == QLatin1String("kwrite") || binaryName == QLatin1String("kate") || binaryName == QLatin1String("kword")) {
m_examples = i18nc("@info examples about information the user can provide", "Type of the document you were editing.");
} else if (binaryName == QLatin1String("juk") || binaryName == QLatin1String("amarok") || binaryName == QLatin1String("dragon")
|| binaryName == QLatin1String("kaffeine")) {
m_examples =
i18nc("@info examples about information the user can provide", "Type of media (extension and format) you were watching and/or listening to.");
}
}
......
/*******************************************************************
* applicationdetailsexamples.h
* SPDX-FileCopyrightText: 2010 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
* applicationdetailsexamples.h
* SPDX-FileCopyrightText: 2010 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
#ifndef APPLICATIONDETAILSEXAMPLES__H
#define APPLICATIONDETAILSEXAMPLES__H
......@@ -14,9 +14,9 @@
class ApplicationDetailsExamples : QObject
{
Q_OBJECT
Q_OBJECT
public:
explicit ApplicationDetailsExamples(QObject * parent);
explicit ApplicationDetailsExamples(QObject *parent);
bool hasExamples() const;
QString examples() const;
......
......@@ -9,21 +9,23 @@
#include "backtracegenerator.h"
#include "drkonqi_debug.h"
#include <KShell>
#include <KProcess>
#include <KShell>
#include "parser/backtraceparser.h"
BacktraceGenerator::BacktraceGenerator(const Debugger & debugger, QObject *parent)
: QObject(parent),
m_debugger(debugger), m_proc(nullptr),
m_temp(nullptr), m_state(NotLoaded)
BacktraceGenerator::BacktraceGenerator(const Debugger &debugger, QObject *parent)
: QObject(parent)
, m_debugger(debugger)
, m_proc(nullptr)
, m_temp(nullptr)
, m_state(NotLoaded)
{
m_parser = BacktraceParser::newParser(m_debugger.codeName(), this);
m_parser->connectToGenerator(this);
#ifdef BACKTRACE_PARSER_DEBUG
m_debugParser = BacktraceParser::newParser(QString(), this); //uses the null parser
m_debugParser = BacktraceParser::newParser(QString(), this); // uses the null parser
m_debugParser->connectToGenerator(this);
#endif
}
......@@ -48,7 +50,7 @@ BacktraceGenerator::~BacktraceGenerator()
bool BacktraceGenerator::start()
{
//they should always be null before entering this function.
// they should always be null before entering this function.
Q_ASSERT(!m_proc);
Q_ASSERT(!m_temp);
......@@ -64,7 +66,7 @@ bool BacktraceGenerator::start()
}
m_proc = new KProcess;
m_proc->setEnv(QStringLiteral("LC_ALL"), QStringLiteral("C")); // force C locale
m_proc->setEnv(QStringLiteral("LC_ALL"), QStringLiteral("C")); // force C locale
m_temp = new QTemporaryFile;
m_temp->open();
......@@ -97,7 +99,7 @@ bool BacktraceGenerator::start()
m_proc->start();
if (!m_proc->waitForStarted()) {
//we mustn't keep these around...
// we mustn't keep these around...
m_proc->deleteLater();
m_temp->deleteLater();
m_proc = nullptr;
......@@ -149,13 +151,13 @@ void BacktraceGenerator::slotReadInput()
void BacktraceGenerator::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus)
{
//these are useless now
// these are useless now
m_proc->deleteLater();
m_temp->deleteLater();
m_proc = nullptr;
m_temp = nullptr;
//mark the end of the backtrace for the parser
// mark the end of the backtrace for the parser
emit newLine(QString());
if (exitStatus != QProcess::NormalExit || exitCode != 0) {
......@@ -164,7 +166,7 @@ void BacktraceGenerator::slotProcessExited(int exitCode, QProcess::ExitStatus ex
return;
}
//no translation, string appears in the report
// no translation, string appears in the report
QString tmp(QStringLiteral("Application: %progname (%execname), signal: %signame\n"));
Debugger::expandString(tmp);
......@@ -172,12 +174,10 @@ void BacktraceGenerator::slotProcessExited(int exitCode, QProcess::ExitStatus ex
m_state = Loaded;
#ifdef BACKTRACE_PARSER_DEBUG
//append the raw unparsed backtrace
// append the raw unparsed backtrace
m_parsedBacktrace += "\n------------ Unparsed Backtrace ------------\n";
m_parsedBacktrace += m_debugParser->parsedBacktrace(); //it's not really parsed, it's from the null parser.
m_parsedBacktrace += m_debugParser->parsedBacktrace(); // it's not really parsed, it's from the null parser.
#endif
emit done();
}
......@@ -22,24 +22,34 @@ class BacktraceGenerator : public QObject
Q_OBJECT
public:
enum State { NotLoaded, Loading, Loaded, Failed, FailedToStart, };
BacktraceGenerator(const Debugger & debugger, QObject *parent);
enum State {
NotLoaded,
Loading,
Loaded,
Failed,
FailedToStart,
};
BacktraceGenerator(const Debugger &debugger, QObject *parent);
~BacktraceGenerator() override;
State state() const {
State state() const
{
return m_state;
}
BacktraceParser *parser() const {
BacktraceParser *parser() const
{
return m_parser;
}
QString backtrace() const {
QString backtrace() const
{
return m_parsedBacktrace;
}
const Debugger debugger() const {
const Debugger debugger() const
{
return m_debugger;
}
......@@ -58,16 +68,16 @@ private Q_SLOTS:
void slotReadInput();
private:
const Debugger m_debugger;
KProcess * m_proc = nullptr;
QTemporaryFile * m_temp = nullptr;
QByteArray m_output;
State m_state;
BacktraceParser * m_parser = nullptr;
QString m_parsedBacktrace;
const Debugger m_debugger;
KProcess *m_proc = nullptr;
QTemporaryFile *m_temp = nullptr;
QByteArray m_output;
State m_state;
BacktraceParser *m_parser = nullptr;
QString m_parsedBacktrace;
#ifdef BACKTRACE_PARSER_DEBUG
BacktraceParser * m_debugParser = nullptr;
BacktraceParser *m_debugParser = nullptr;
#endif
};
......
/*******************************************************************
* backtraceratingwidget.cpp
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
* backtraceratingwidget.cpp
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
#include "backtraceratingwidget.h"
#include <QPainter>
#include <QIcon>
#include <QPainter>
BacktraceRatingWidget::BacktraceRatingWidget(QWidget * parent) :
QWidget(parent),
m_state(BacktraceGenerator::NotLoaded)
BacktraceRatingWidget::BacktraceRatingWidget(QWidget *parent)
: QWidget(parent)
, m_state(BacktraceGenerator::NotLoaded)
{
setMinimumSize(105, 24);
......@@ -24,37 +24,37 @@ BacktraceRatingWidget::BacktraceRatingWidget(QWidget * parent) :
void BacktraceRatingWidget::setUsefulness(BacktraceParser::Usefulness usefulness)
{
switch(usefulness) {
case BacktraceParser::ReallyUseful:
m_numStars = 3;
switch (usefulness) {
case BacktraceParser::ReallyUseful:
m_numStars = 3;
break;
case BacktraceParser::MayBeUseful:
m_numStars = 2;
case BacktraceParser::MayBeUseful:
m_numStars = 2;
break;
case BacktraceParser::ProbablyUseless:
m_numStars = 1;
case BacktraceParser::ProbablyUseless:
m_numStars = 1;
break;
case BacktraceParser::Useless:
case BacktraceParser::InvalidUsefulness:
m_numStars = 0;
case BacktraceParser::Useless:
case BacktraceParser::InvalidUsefulness:
m_numStars = 0;
break;
}
update();
}
void BacktraceRatingWidget::paintEvent(QPaintEvent * event)
void BacktraceRatingWidget::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
QPainter p(this);
p.drawPixmap(QPoint(30, 1) , m_numStars >= 1 ? m_starPixmap : m_disabledStarPixmap);
p.drawPixmap(QPoint(55, 1) , m_numStars >= 2 ? m_starPixmap : m_disabledStarPixmap);
p.drawPixmap(QPoint(80, 1) , m_numStars >= 3 ? m_starPixmap : m_disabledStarPixmap);
p.drawPixmap(QPoint(30, 1), m_numStars >= 1 ? m_starPixmap : m_disabledStarPixmap);
p.drawPixmap(QPoint(55, 1), m_numStars >= 2 ? m_starPixmap : m_disabledStarPixmap);
p.drawPixmap(QPoint(80, 1), m_numStars >= 3 ? m_starPixmap : m_disabledStarPixmap);
switch (m_state) {
case BacktraceGenerator::Failed:
case BacktraceGenerator::FailedToStart: {
p.drawPixmap(QPoint(0, 1) , m_errorPixmap);
p.drawPixmap(QPoint(0, 1), m_errorPixmap);
break;
}
default:
......
/*******************************************************************
* backtraceratingwidget.h
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
* backtraceratingwidget.h
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
#ifndef BACKTRACERATINGWIDGET__H
#define BACKTRACERATINGWIDGET__H
#include <QWidget>
#include "parser/backtraceparser.h"
#include "backtracegenerator.h"
#include "parser/backtraceparser.h"
class QPixmap;
class BacktraceRatingWidget: public QWidget
class BacktraceRatingWidget : public QWidget
{
Q_OBJECT
public:
explicit BacktraceRatingWidget(QWidget *);
void setUsefulness(BacktraceParser::Usefulness);
void setState(BacktraceGenerator::State s) {
m_state = s; update();
void setState(BacktraceGenerator::State s)
{
m_state = s;
update();
}
protected:
void paintEvent(QPaintEvent * event) override;
void paintEvent(QPaintEvent *event) override;
private:
BacktraceGenerator::State m_state;
BacktraceGenerator::State m_state;
int m_numStars;
QPixmap m_errorPixmap;
int m_numStars;
QPixmap m_errorPixmap;
QPixmap m_starPixmap;
QPixmap m_disabledStarPixmap;
QPixmap m_starPixmap;
QPixmap m_disabledStarPixmap;
};
#endif
This diff is collapsed.
/*******************************************************************
* backtracewidget.h
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
* backtracewidget.h
* SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
******************************************************************/
#ifndef BACKTRACEWIDGET__H
#define BACKTRACEWIDGET__H
......@@ -14,19 +14,19 @@
#include "debugpackageinstaller.h"
#include "ui_backtracewidget.h"
namespace KSyntaxHighlighting {
class SyntaxHighlighter;
namespace KSyntaxHighlighting
{
class SyntaxHighlighter;
}
class BacktraceRatingWidget;
class BacktraceGenerator;
class BacktraceWidget: public QWidget
class BacktraceWidget : public QWidget
{
Q_OBJECT
public:
explicit BacktraceWidget(BacktraceGenerator *generator, QWidget *parent = nullptr,
bool showToggleBacktrace = false);
explicit BacktraceWidget(BacktraceGenerator *generator, QWidget *parent = nullptr, bool showToggleBacktrace = false);
bool canInstallDebugPackages() const;
......@@ -42,11 +42,11 @@ Q_SIGNALS:
void stateChanged();
private:
BacktraceGenerator * m_btGenerator = nullptr;
Ui::Form ui;
BacktraceRatingWidget * m_backtraceRatingWidget = nullptr;
BacktraceGenerator *m_btGenerator = nullptr;
Ui::Form ui;
BacktraceRatingWidget *m_backtraceRatingWidget = nullptr;
KSyntaxHighlighting::SyntaxHighlighter *m_highlighter = nullptr;
DebugPackageInstaller * m_debugPackageInstaller = nullptr;
DebugPackageInstaller *m_debugPackageInstaller = nullptr;
void setAsLoading();
......
......@@ -13,10 +13,14 @@
class BugReportAddress : public QString
{
public:
inline BugReportAddress() : QString() {}
inline BugReportAddress(const QString & address)
inline BugReportAddress()
: QString()
{
}
inline BugReportAddress(const QString &address)
: QString(address == QLatin1String("submit@bugs.kde.org") ? KDE_BUGZILLA_URL : address)
{}
{
}
inline bool isKdeBugzilla() const
{
......
/*******************************************************************
* SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
******************************************************************/
* SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
******************************************************************/
#include "assistantpage_bugzilla_version.h"
#include "ui_assistantpage_bugzilla_version.h"
......@@ -27,24 +27,19 @@ BugzillaVersionPage::BugzillaVersionPage(ReportAssistantDialog *parent)
ui->errorIconLabel->setPixmap(QIcon::fromTheme(QStringLiteral("state-error")).pixmap(ui->errorIconLabel->size()));
connect(bugzillaManager(), &BugzillaManager::bugzillaVersionFound,
this, [=] {
connect(bugzillaManager(), &BugzillaManager::bugzillaVersionFound, this, [=] {
// Don't show this page ever again!
assistant()->setAppropriate(m_item, false);
if (assistant()->currentPage() == m_item) {
assistant()->next();
}
});
connect(bugzillaManager(), &BugzillaManager::bugzillaVersionError,
this, [=](const QString &error) {
connect(bugzillaManager(), &BugzillaManager::bugzillaVersionError, this, [=](const QString &error) {
ui->busyWidget->hide();
ui->errorWidget->show();
ui->errorLabel->setText(xi18nc("@info %1 is an error message from the backend",
"Failed to contact bugs.kde.org: <message>%1</message>",
error));
ui->errorLabel->setText(xi18nc("@info %1 is an error message from the backend", "Failed to contact bugs.kde.org: <message>%1</message>", error));
});
connect(ui->retryButton, &QPushButton::clicked,
this, [=] {
connect(ui->retryButton, &QPushButton::clicked, this, [=] {
ui->busyWidget->show();
ui->errorWidget->hide();
bugzillaManager()->lookupVersion();
......
/*******************************************************************
* SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
******************************************************************/
* SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
******************************************************************/
#ifndef ASSISTANTPAGE_BUGZILLA_VERSION_H
#define ASSISTANTPAGE_BUGZILLA_VERSION_H
......@@ -12,7 +12,8 @@
#include "reportassistantpage.h"
class ReportAssistantDialog;
namespace Ui {
namespace Ui
{
class BugzillaVersionPage;
}
......
/*******************************************************************
* bugzillalib.cpp
* SPDX-FileCopyrightText: 2009, 2011 Dario Andres Rodriguez <andresbajotierra@gmail.com>
* SPDX-FileCopyrightText: 2012 George Kiagiadakis <kiagiadakis.george@gmail.com>
* SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*