From 4b92d32d29fe4d87f7c97a224d86c362362b6f39 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 22 Feb 2015 22:06:06 +0000 Subject: [PATCH] drkonqi: cleanup and simplify --- drkonqi/bugreportaddress.h | 44 ------------------------------------------ drkonqi/crashedapplication.cpp | 2 +- drkonqi/crashedapplication.h | 6 ++---- drkonqi/drkonqi_globals.h | 11 ----------- drkonqi/drkonqibackends.cpp | 2 +- drkonqi/drkonqidialog.cpp | 2 +- 6 files changed, 5 insertions(+), 62 deletions(-) delete mode 100644 drkonqi/bugreportaddress.h diff --git a/drkonqi/bugreportaddress.h b/drkonqi/bugreportaddress.h deleted file mode 100644 index c64331c2..00000000 --- a/drkonqi/bugreportaddress.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2009 George Kiagiadakis - - 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 . -*/ -#ifndef BUGREPORTADDRESS_H -#define BUGREPORTADDRESS_H - -#include - -#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 diff --git a/drkonqi/crashedapplication.cpp b/drkonqi/crashedapplication.cpp index ef63232b..ae937ad7 100644 --- a/drkonqi/crashedapplication.cpp +++ b/drkonqi/crashedapplication.cpp @@ -66,7 +66,7 @@ QString CrashedApplication::version() const return m_version; } -BugReportAddress CrashedApplication::bugReportAddress() const +QString CrashedApplication::bugReportAddress() const { return m_reportAddress; } diff --git a/drkonqi/crashedapplication.h b/drkonqi/crashedapplication.h index 59672f87..74a8f555 100644 --- a/drkonqi/crashedapplication.h +++ b/drkonqi/crashedapplication.h @@ -21,8 +21,6 @@ #include #include -#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; diff --git a/drkonqi/drkonqi_globals.h b/drkonqi/drkonqi_globals.h index 7cbdab08..43c6deeb 100644 --- a/drkonqi/drkonqi_globals.h +++ b/drkonqi/drkonqi_globals.h @@ -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 diff --git a/drkonqi/drkonqibackends.cpp b/drkonqi/drkonqibackends.cpp index eea710bb..fbc8321b 100644 --- a/drkonqi/drkonqibackends.cpp +++ b/drkonqi/drkonqibackends.cpp @@ -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"); diff --git a/drkonqi/drkonqidialog.cpp b/drkonqi/drkonqidialog.cpp index 96d3c7e2..43b949c3 100644 --- a/drkonqi/drkonqidialog.cpp +++ b/drkonqi/drkonqidialog.cpp @@ -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; -- 2.11.0