From 8e74da840e0fb1b81c83f8f73bf86d6816ae0bd7 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 7 Mar 2021 18:25:57 +0200 Subject: [PATCH] drkonqi: remove debug package installer Signed-off-by: Ivailo Monev --- drkonqi/CMakeLists.txt | 5 -- drkonqi/backtracewidget.cpp | 78 +++-------------------- drkonqi/backtracewidget.h | 15 +---- drkonqi/backtracewidget.ui | 3 - drkonqi/config-drkonqi.h.cmake | 1 - drkonqi/debugpackageinstaller.cpp | 127 -------------------------------------- drkonqi/debugpackageinstaller.h | 56 ----------------- 7 files changed, 10 insertions(+), 275 deletions(-) delete mode 100644 drkonqi/debugpackageinstaller.cpp delete mode 100644 drkonqi/debugpackageinstaller.h diff --git a/drkonqi/CMakeLists.txt b/drkonqi/CMakeLists.txt index b1dcb4fd..bff18ab6 100644 --- a/drkonqi/CMakeLists.txt +++ b/drkonqi/CMakeLists.txt @@ -3,10 +3,6 @@ project(drkonqi) check_function_exists("strsignal" HAVE_STRSIGNAL) check_function_exists("uname" HAVE_UNAME) -if(NOT DEBUG_PACKAGE_INSTALLER_NAME) - set (DEBUG_PACKAGE_INSTALLER_NAME "installdbgsymbols.sh") -endif() - configure_file( config-drkonqi.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-drkonqi.h @@ -26,7 +22,6 @@ set(drkonqi_SRCS drkonqi.cpp drkonqibackends.cpp detachedprocessmonitor.cpp - debugpackageinstaller.cpp systeminformation.cpp crashedapplication.cpp debugger.cpp diff --git a/drkonqi/backtracewidget.cpp b/drkonqi/backtracewidget.cpp index c0a307f1..63f693ee 100644 --- a/drkonqi/backtracewidget.cpp +++ b/drkonqi/backtracewidget.cpp @@ -49,12 +49,6 @@ BacktraceWidget::BacktraceWidget(BacktraceGenerator *generator, QWidget *parent, { ui.setupUi(this); - //Debug package installer - m_debugPackageInstaller = new DebugPackageInstaller(this); - connect(m_debugPackageInstaller, SIGNAL(error(QString)), this, SLOT(debugPackageError(QString))); - connect(m_debugPackageInstaller, SIGNAL(packagesInstalled()), this, SLOT(regenerateBacktrace())); - connect(m_debugPackageInstaller, SIGNAL(canceled()), this, SLOT(debugPackageCanceled())); - connect(m_btGenerator, SIGNAL(done()) , this, SLOT(loadData())); connect(m_btGenerator, SIGNAL(someError()) , this, SLOT(loadData())); connect(m_btGenerator, SIGNAL(failedToStart()) , this, SLOT(loadData())); @@ -74,13 +68,6 @@ BacktraceWidget::BacktraceWidget(BacktraceGenerator *generator, QWidget *parent, "a better backtrace."))); connect(ui.m_reloadBacktraceButton, SIGNAL(clicked()), this, SLOT(regenerateBacktrace())); - ui.m_installDebugButton->setGuiItem( - KGuiItem2(i18nc("@action:button", "&Install Debug Symbols"), - KIcon("system-software-update"), i18nc("@info:tooltip", "Use this button to " - "install the missing debug symbols packages."))); - ui.m_installDebugButton->setVisible(false); - connect(ui.m_installDebugButton, SIGNAL(clicked()), this, SLOT(installDebugPackages())); - ui.m_copyButton->setGuiItem(KGuiItem2(QString(), KIcon("edit-copy"), i18nc("@info:tooltip", "Use this button to copy the " "crash information (backtrace) to the clipboard."))); @@ -142,7 +129,6 @@ void BacktraceWidget::setAsLoading() ui.m_extraDetailsLabel->setVisible(false); ui.m_extraDetailsLabel->clear(); - ui.m_installDebugButton->setVisible(false); ui.m_reloadBacktraceButton->setEnabled(false); ui.m_copyButton->setEnabled(false); @@ -195,7 +181,6 @@ void BacktraceWidget::anotherDebuggerRunning() "the crashed application. Therefore, the DrKonqi debugger cannot " "fetch the backtrace. Please close the other debugger and " "click Reload.")); - ui.m_installDebugButton->setVisible(false); ui.m_reloadBacktraceButton->setEnabled(true); } @@ -249,34 +234,13 @@ void BacktraceWidget::loadData() if (btParser->backtraceUsefulness() != BacktraceParser::ReallyUseful) { //Not a perfect bactrace, ask the user to try to improve it - ui.m_extraDetailsLabel->setVisible(true); - if (canInstallDebugPackages()) { - //The script to install the debug packages is available - ui.m_extraDetailsLabel->setText(i18nc("@info/rich", "You can click the " - "Install Debug Symbols button in order to automatically " - "install the missing debugging information packages. If this method " - "does not work: please read How to " - "create useful crash reports to learn how to get a useful " - "backtrace; install the needed packages (" - "list of files) and click the " - "Reload button.", - QLatin1String(TECHBASE_HOWTO_DOC), - QLatin1String("#missingDebugPackages"))); - ui.m_installDebugButton->setVisible(true); - //Retrieve the libraries with missing debug info - QStringList missingLibraries = btParser->librariesWithMissingDebugSymbols().toList(); - m_debugPackageInstaller->setMissingLibraries(missingLibraries); - } else { - //No automated method to install the missing debug info - //Tell the user to read the howto and reload - ui.m_extraDetailsLabel->setText(i18nc("@info/rich", "Please read How to " - "create useful crash reports to learn how to get a useful " - "backtrace; install the needed packages (" - "list of files) and click the " - "Reload button.", - QLatin1String(TECHBASE_HOWTO_DOC), - QLatin1String("#missingDebugPackages"))); - } + ui.m_extraDetailsLabel->setText(i18nc("@info/rich", "Please read How to " + "create useful crash reports to learn how to get a useful " + "backtrace; install the needed packages (" + "list of files) and click the " + "Reload button.", + QLatin1String(TECHBASE_HOWTO_DOC), + QLatin1String("#missingDebugPackages"))); } ui.m_copyButton->setEnabled(true); @@ -346,34 +310,6 @@ void BacktraceWidget::hilightExtraDetailsLabel(bool hilight) ui.m_extraDetailsLabel->setStyleSheet(stylesheet); } -void BacktraceWidget::focusImproveBacktraceButton() -{ - ui.m_installDebugButton->setFocus(); -} - -void BacktraceWidget::installDebugPackages() -{ - ui.m_installDebugButton->setVisible(false); - m_debugPackageInstaller->installDebugPackages(); -} - -void BacktraceWidget::debugPackageError(const QString & errorMessage) -{ - ui.m_installDebugButton->setVisible(true); - KMessageBox::error(this, errorMessage, i18nc("@title:window", "Error during the installation of" - " debug symbols")); -} - -void BacktraceWidget::debugPackageCanceled() -{ - ui.m_installDebugButton->setVisible(true); -} - -bool BacktraceWidget::canInstallDebugPackages() const -{ - return m_debugPackageInstaller->canInstallDebugPackages(); -} - void BacktraceWidget::toggleBacktrace(bool show) { ui.m_backtraceStack->setCurrentWidget(show ? ui.backtracePage : ui.backtraceHelpPage); diff --git a/drkonqi/backtracewidget.h b/drkonqi/backtracewidget.h index 4545e8f5..17367645 100644 --- a/drkonqi/backtracewidget.h +++ b/drkonqi/backtracewidget.h @@ -21,11 +21,10 @@ #define BACKTRACEWIDGET__H #include +#include -#include "debugpackageinstaller.h" #include "ui_backtracewidget.h" -#include class BacktraceRatingWidget; class BacktraceGenerator; @@ -37,12 +36,9 @@ public: explicit BacktraceWidget(BacktraceGenerator *generator, QWidget *parent = 0, bool showToggleBacktrace = false); - bool canInstallDebugPackages() const; - public Q_SLOTS: void generateBacktrace(); void hilightExtraDetailsLabel(bool hilight); - void focusImproveBacktraceButton(); void toggleBacktrace(bool show); void extraDetailsLinkActivated(QString link); @@ -51,11 +47,10 @@ Q_SIGNALS: void stateChanged(); private: - BacktraceGenerator * m_btGenerator; + BacktraceGenerator *m_btGenerator; Ui::Form ui; - BacktraceRatingWidget * m_backtraceRatingWidget; + BacktraceRatingWidget *m_backtraceRatingWidget; QSyntaxHighlighter *m_highlighter; - DebugPackageInstaller * m_debugPackageInstaller; void setAsLoading(); @@ -69,10 +64,6 @@ private Q_SLOTS: void copyClicked(); void anotherDebuggerRunning(); - - void installDebugPackages(); - void debugPackageError(const QString &); - void debugPackageCanceled(); }; #endif diff --git a/drkonqi/backtracewidget.ui b/drkonqi/backtracewidget.ui index 59aba99d..883eaf46 100644 --- a/drkonqi/backtracewidget.ui +++ b/drkonqi/backtracewidget.ui @@ -113,9 +113,6 @@ - - - Qt::Horizontal diff --git a/drkonqi/config-drkonqi.h.cmake b/drkonqi/config-drkonqi.h.cmake index f5723d50..fd26899e 100644 --- a/drkonqi/config-drkonqi.h.cmake +++ b/drkonqi/config-drkonqi.h.cmake @@ -1,3 +1,2 @@ #cmakedefine HAVE_STRSIGNAL 1 #cmakedefine HAVE_UNAME 1 -#define DEBUG_PACKAGE_INSTALLER_NAME "@DEBUG_PACKAGE_INSTALLER_NAME@" diff --git a/drkonqi/debugpackageinstaller.cpp b/drkonqi/debugpackageinstaller.cpp deleted file mode 100644 index d40e7c39..00000000 --- a/drkonqi/debugpackageinstaller.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************* -* debugpackageinstaller.cpp -* Copyright 2009 Dario Andres Rodriguez -* -* 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 . -* -******************************************************************/ - -#include - -#include "debugpackageinstaller.h" - -#include -#include -#include -#include - -#include "drkonqi.h" -#include "crashedapplication.h" - -DebugPackageInstaller::DebugPackageInstaller(QObject *parent) - : QObject(parent), m_installerProcess(0), m_progressDialog(0) -{ - m_executablePath = KStandardDirs::findExe(DEBUG_PACKAGE_INSTALLER_NAME); //defined from CMakeLists.txt -} - -bool DebugPackageInstaller::canInstallDebugPackages() const -{ - return !m_executablePath.isEmpty(); -} - -void DebugPackageInstaller::setMissingLibraries(const QStringList & libraries) -{ - m_missingLibraries = libraries; -} - -void DebugPackageInstaller::installDebugPackages() -{ - Q_ASSERT(canInstallDebugPackages()); - - if (!m_installerProcess) { - //Run process - m_installerProcess = new QProcess(this); - connect(m_installerProcess, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(processFinished(int,QProcess::ExitStatus))); - - QStringList installerArguments; - installerArguments << DrKonqi::crashedApplication()->executable().absoluteFilePath() - << m_missingLibraries; - m_installerProcess->start(m_executablePath, installerArguments); - - //Show dialog - m_progressDialog = new KProgressDialog(qobject_cast(parent())); - connect(m_progressDialog, SIGNAL(cancelClicked()), this, SLOT(progressDialogCanceled())); - m_progressDialog->progressBar()->setRange(0,0); - m_progressDialog->setWindowTitle(i18nc("@title:window", "Missing debug symbols")); - m_progressDialog->setLabelText(i18nc("@info:progress", "Requesting installation of missing " - "debug symbols packages...")); - m_progressDialog->show(); - } -} - -void DebugPackageInstaller::progressDialogCanceled() -{ - m_progressDialog->deleteLater(); - m_progressDialog = 0; - - if (m_installerProcess) { - if (m_installerProcess->state() == QProcess::Running) { - disconnect(m_installerProcess, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(processFinished(int,QProcess::ExitStatus))); - m_installerProcess->kill(); - disconnect(m_installerProcess, SIGNAL(finished(int,QProcess::ExitStatus)), - m_installerProcess, SLOT(deleteLater())); - } - m_installerProcess = 0; - } - - emit canceled(); -} - -void DebugPackageInstaller::processFinished(int exitCode, QProcess::ExitStatus) -{ - switch(exitCode) { - case ResultInstalled: - { - emit packagesInstalled(); - break; - } - case ResultSymbolsNotFound: - { - emit error(i18nc("@info", "Could not find debug symbol packages for this application.")); - break; - } - case ResultCanceled: - { - emit canceled(); - break; - } - case ResultError: - default: - { - emit error(i18nc("@info", "An error was encountered during the installation " - "of the debug symbol packages.")); - break; - } - } - - m_progressDialog->reject(); - - delete m_progressDialog; - m_progressDialog = 0; - - delete m_installerProcess; - m_installerProcess = 0; -} diff --git a/drkonqi/debugpackageinstaller.h b/drkonqi/debugpackageinstaller.h deleted file mode 100644 index 359be77d..00000000 --- a/drkonqi/debugpackageinstaller.h +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************* -* debugpackageinstaller.h -* Copyright 2009 Dario Andres Rodriguez -* -* 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 DEBUGPACKAGEINSTALLER__H -#define DEBUGPACKAGEINSTALLER__H - -#include -#include - -class KProgressDialog; - -class DebugPackageInstaller: public QObject -{ - Q_OBJECT - - enum Results { ResultInstalled = 0, ResultError = 1, - ResultSymbolsNotFound = 2, ResultCanceled = 3 }; - - public: - explicit DebugPackageInstaller(QObject *parent = 0); - bool canInstallDebugPackages() const; - void setMissingLibraries(const QStringList &); - void installDebugPackages(); - - private Q_SLOTS: - void processFinished(int, QProcess::ExitStatus); - void progressDialogCanceled(); - - Q_SIGNALS: - void packagesInstalled(); - void error(const QString &); - void canceled(); - - private: - QProcess * m_installerProcess; - KProgressDialog * m_progressDialog; - QString m_executablePath; - QStringList m_missingLibraries; -}; - -#endif -- 2.11.0