drkonqi: cleanup and simplify

This commit is contained in:
Ivailo Monev 2015-02-22 22:06:06 +00:00
parent 25c1f00b67
commit 4b92d32d29
6 changed files with 5 additions and 62 deletions

View file

@ -1,44 +0,0 @@
/*
Copyright (C) 2009 George Kiagiadakis <gkiagia@users.sourceforge.net>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BUGREPORTADDRESS_H
#define BUGREPORTADDRESS_H
#include <QtCore/QString>
#include "drkonqi_globals.h"
class BugReportAddress : public QString
{
public:
inline BugReportAddress() : QString() {}
inline BugReportAddress(const QString & address)
: QString(address == QLatin1String("submit@bugs.kde.org") ?
QLatin1String(KDE_BUGZILLA_URL) : address)
{}
inline bool isKdeBugzilla() const
{
return *this == QLatin1String(KDE_BUGZILLA_URL);
}
inline bool isEmail() const
{
return contains('@');
}
};
#endif

View file

@ -66,7 +66,7 @@ QString CrashedApplication::version() const
return m_version;
}
BugReportAddress CrashedApplication::bugReportAddress() const
QString CrashedApplication::bugReportAddress() const
{
return m_reportAddress;
}

View file

@ -21,8 +21,6 @@
#include <QtCore/QDateTime>
#include <QtCore/QFileInfo>
#include "bugreportaddress.h"
class KCrashBackend;
class CrashedApplication : public QObject
@ -49,7 +47,7 @@ public:
QString version() const;
/** Returns the address where the bug report for this application should go */
BugReportAddress bugReportAddress() const;
QString bugReportAddress() const;
/** Returns the pid of the crashed program */
int pid() const;
@ -82,7 +80,7 @@ protected:
QFileInfo m_executable;
QString m_fakeBaseName;
QString m_version;
BugReportAddress m_reportAddress;
QString m_reportAddress;
bool m_restarted;
int m_thread;
QDateTime m_datetime;

View file

@ -31,17 +31,6 @@ public:
};
/* Urls are defined globally here, so that they can change easily */
#define KDE_BUGZILLA_URL "https://bugs.kde.org/"
#define KDE_BUGZILLA_CREATE_ACCOUNT_URL KDE_BUGZILLA_URL "createaccount.cgi"
#define KDE_BUGZILLA_SHORT_URL "bugs.kde.org"
#define TECHBASE_HOWTO_DOC "http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports#Preparing_your_KDE_packages"
/* IDs for bugreport assistant pages -> help anchors */
#define PAGE_INTRODUCTION_ID "IntroductionID"
#define PAGE_CRASHINFORMATION_ID "BacktraceID"
#define PAGE_AWARENESS_ID "AwarenessID"
#define PAGE_CONCLUSIONS_ID "ConclusionsID"
#define PAGE_HELP_BEGIN_ID "Begin"
#endif

View file

@ -124,7 +124,7 @@ CrashedApplication *KCrashBackend::constructCrashedApplication()
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
a->m_name = args->getOption("programname");
a->m_version = args->getOption("appversion").toUtf8();
a->m_reportAddress = BugReportAddress(args->getOption("bugaddress").toUtf8());
a->m_reportAddress = args->getOption("bugaddress").toUtf8();
a->m_pid = args->getOption("pid").toInt();
a->m_signalNumber = args->getOption("signal").toInt();
a->m_restarted = args->isSet("restarted");

View file

@ -236,7 +236,7 @@ void DrKonqiDialog::enableDebugMenu(bool debuggerRunning)
void DrKonqiDialog::startBugReportAssistant()
{
const CrashedApplication *crashedApp = DrKonqi::crashedApplication();
BugReportAddress appReportAddress = crashedApp->bugReportAddress();
QString appReportAddress = crashedApp->bugReportAddress();
SystemInformation *sysinfo = new SystemInformation(this);
QString backtrace = DrKonqi::debuggerManager()->backtraceGenerator()->parser()->parsedBacktrace();
QString query;