File ksuseinstall.diff of Package kdebase4-runtime

Index: kde-runtime-4.7.98/drkonqi/backtracewidget.cpp
===================================================================
--- kde-runtime-4.7.98.orig/drkonqi/backtracewidget.cpp
+++ kde-runtime-4.7.98/drkonqi/backtracewidget.cpp
@@ -39,6 +39,10 @@
 #include <KToolInvocation>
 #include <KGlobalSettings>
 
+#if 1
+#include "susedebugpackageinstaller.h"
+#endif
+
 const char *extraDetailsLabelMargin = " margin: 5px; ";
 
 BacktraceWidget::BacktraceWidget(BacktraceGenerator *generator, QWidget *parent,
@@ -50,7 +54,11 @@ BacktraceWidget::BacktraceWidget(Backtra
     ui.setupUi(this);
 
     //Debug package installer
+#if 1
+    m_debugPackageInstaller = new SUSEDebugPackageInstaller(this);
+#else
     m_debugPackageInstaller = new DebugPackageInstaller(this);
+#endif
     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()));
Index: kde-runtime-4.7.98/drkonqi/backtracewidget.h
===================================================================
--- kde-runtime-4.7.98.orig/drkonqi/backtracewidget.h
+++ kde-runtime-4.7.98/drkonqi/backtracewidget.h
@@ -29,6 +29,10 @@ class QSyntaxHighlighter;
 class BacktraceRatingWidget;
 class BacktraceGenerator;
 
+#if 1
+class SUSEDebugPackageInstaller;
+#endif
+
 class BacktraceWidget: public QWidget
 {
     Q_OBJECT
@@ -55,7 +59,11 @@ private:
     Ui::Form    ui;
     BacktraceRatingWidget *   m_backtraceRatingWidget;
     QSyntaxHighlighter *m_highlighter;
+#if 1
+    SUSEDebugPackageInstaller * m_debugPackageInstaller;
+#else
     DebugPackageInstaller * m_debugPackageInstaller;
+#endif
     
 private Q_SLOTS:
     void loadData();
Index: kde-runtime-4.7.98/drkonqi/CMakeLists.txt
===================================================================
--- kde-runtime-4.7.98.orig/drkonqi/CMakeLists.txt
+++ kde-runtime-4.7.98/drkonqi/CMakeLists.txt
@@ -40,6 +40,7 @@ set(drkonqi_SRCS
     debugpackageinstaller.cpp
     systeminformation.cpp
     crashedapplication.cpp
+    susedebugpackageinstaller.cpp
     debugger.cpp
     debuggerlaunchers.cpp
     debuggermanager.cpp
@@ -73,6 +74,6 @@ kde4_add_ui_files(drkonqi_SRCS
 
 kde4_add_executable(drkonqi ${drkonqi_SRCS})
 
-target_link_libraries(drkonqi ${KDE4_KIO_LIBS} ${QT_QTWEBKIT_LIBRARY} ${KDE4_KDEWEBKIT_LIBRARY} drkonqi_backtrace_parser)
+target_link_libraries(drkonqi ${KDE4_KIO_LIBS} ${QT_QTWEBKIT_LIBRARY} ${KDE4_KDEWEBKIT_LIBRARY} ksuseinstall drkonqi_backtrace_parser)
 
 install(TARGETS drkonqi DESTINATION ${LIBEXEC_INSTALL_DIR})
Index: kde-runtime-4.7.98/drkonqi/susedebugpackageinstaller.cpp
===================================================================
--- /dev/null
+++ kde-runtime-4.7.98/drkonqi/susedebugpackageinstaller.cpp
@@ -0,0 +1,51 @@
+/*******************************************************************
+* debugpackageinstaller.cpp
+* Copyright  2009    Dario Andres Rodriguez <andresbajotierra@gmail.com>
+*
+* 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/>.
+*
+******************************************************************/
+
+#include "susedebugpackageinstaller.h"
+
+#include <klocale.h>
+#include <qdebug.h>
+#include <qwidget.h>
+
+#include "ksuseinstall.h"
+
+SUSEDebugPackageInstaller::SUSEDebugPackageInstaller(QWidget *parent)
+    : QObject(parent)
+{
+}
+
+bool SUSEDebugPackageInstaller::canInstallDebugPackages() const
+{
+    return KSUSEInstall::canInstallDebuginfo();
+}
+
+void SUSEDebugPackageInstaller::setMissingLibraries(const QStringList & libraries)
+{
+    m_missingLibraries = libraries;
+}
+
+void SUSEDebugPackageInstaller::installDebugPackages()
+{
+    Q_ASSERT(canInstallDebugPackages());
+    qDebug() << "MISSING:" << m_missingLibraries;
+    if( KSUSEInstall::installDebuginfo( m_missingLibraries, static_cast< QWidget* >( parent())))
+        emit packagesInstalled();
+    else
+        emit error(i18nc("@info", "Could not find debug symbol packages for this application."));
+}
Index: kde-runtime-4.7.98/drkonqi/susedebugpackageinstaller.h
===================================================================
--- /dev/null
+++ kde-runtime-4.7.98/drkonqi/susedebugpackageinstaller.h
@@ -0,0 +1,46 @@
+/*******************************************************************
+* debugpackageinstaller.h
+* Copyright  2009    Dario Andres Rodriguez <andresbajotierra@gmail.com>
+*
+* 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 SUSEDEBUGPACKAGEINSTALLER__H
+#define SUSEDEBUGPACKAGEINSTALLER__H
+
+#include "debugpackageinstaller.h"
+
+class SUSEDebugPackageInstaller: public QObject
+{
+    Q_OBJECT
+
+    enum Results { ResultInstalled = 0, ResultError = 1,
+                   ResultSymbolsNotFound = 2, ResultCanceled = 3 };
+
+    public:
+        explicit SUSEDebugPackageInstaller(QWidget *parent = 0);
+        bool canInstallDebugPackages() const;
+        void setMissingLibraries(const QStringList &);
+        void installDebugPackages();
+
+    Q_SIGNALS:
+        void packagesInstalled();
+        void error(const QString &);
+        void canceled();
+
+    private:
+        QStringList             m_missingLibraries;
+};
+
+#endif