File 0001-Fix-Manage-Profiles-option-from-KonsolePart.patch of Package konsole

From c550f8940c51a43d3547700ebb59f7c6bc490e6c Mon Sep 17 00:00:00 2001
From: Kurt Hindenburg <kurt.hindenburg@gmail.com>
Date: Thu, 1 Jun 2017 22:24:48 -0400
Subject: [PATCH] Fix 'Manage Profiles' option from KonsolePart

Allow the menu option to work again.  Code copied from MainWindow.
Keeping the bug report open for now as I think this still need some
work.

CCBUG: 360072
---
 src/CMakeLists.txt |  5 +++--
 src/Part.cpp       | 23 ++++++++++++++++++++++-
 src/Part.h         |  3 ++-
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b64545a2..468174ac 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -201,8 +201,9 @@ install(TARGETS kdeinit_konsole konsole
 
 ### Embedded Konsole KPart
 
-set(konsolepart_PART_SRCS Part.cpp)
-
+set(konsolepart_PART_SRCS Part.cpp
+   settings/ProfileSettings.cpp)
+kconfig_add_kcfg_files(konsolepart_PART_SRCS settings/KonsoleSettings.kcfgc)
 add_library(konsolepart MODULE ${konsolepart_PART_SRCS})
 generate_export_header(konsolepart BASE_NAME konsole)
 set_target_properties(konsolepart PROPERTIES DEFINE_SYMBOL KONSOLE_PART)
diff --git a/src/Part.cpp b/src/Part.cpp
index 7968176f..e9fef7c6 100644
--- a/src/Part.cpp
+++ b/src/Part.cpp
@@ -31,6 +31,8 @@
 #include <KActionCollection>
 #include <KPluginFactory>
 #include <QDebug>
+#include <KLocalizedString>
+#include <KConfigDialog>
 
 // Konsole
 #include "EditProfileDialog.h"
@@ -41,6 +43,8 @@
 #include "ProfileManager.h"
 #include "TerminalDisplay.h"
 #include "ViewManager.h"
+#include "KonsoleSettings.h"
+#include "settings/ProfileSettings.h"
 
 using namespace Konsole;
 
@@ -51,7 +55,6 @@ Part::Part(QWidget* parentWidget , QObject* parent, const QVariantList&)
     : KParts::ReadOnlyPart(parent)
     , _viewManager(0)
     , _pluggedController(0)
-    , _manageProfilesAction(0)
 {
     // create view widget
     _viewManager = new ViewManager(this, actionCollection());
@@ -264,6 +267,24 @@ void Part::activeViewTitleChanged(ViewProperties* properties)
     emit setWindowCaption(properties->title());
 }
 
+void Part::showManageProfilesDialog(QWidget* parent)
+{
+    if (KConfigDialog::showDialog(QStringLiteral("settings"))) {
+        return;
+    }
+
+    KConfigDialog *settingsDialog = new KConfigDialog(parent, QStringLiteral("settings"), KonsoleSettings::self());
+    settingsDialog->setFaceType(KPageDialog::Tabbed);
+
+    auto profileSettings = new ProfileSettings(settingsDialog);
+    settingsDialog->addPage(profileSettings,
+                            i18nc("@title Preferences page name",
+                                  "Profiles"),
+                            QStringLiteral("configure"));
+
+    settingsDialog->show();
+}
+
 void Part::showEditCurrentProfileDialog(QWidget* parent)
 {
     Q_ASSERT(activeSession());
diff --git a/src/Part.h b/src/Part.h
index bbe65106..85c7c7b6 100644
--- a/src/Part.h
+++ b/src/Part.h
@@ -93,6 +93,8 @@ public slots:
      */
     QStringList profileNameList() const;
 
+    void showManageProfilesDialog(QWidget* parent);
+
     /**
      * Shows the dialog used to edit the profile used by the active session.  The
      * dialog will be non-modal and will delete itself when it is closed.
@@ -194,7 +196,6 @@ private:
 private:
     ViewManager* _viewManager;
     SessionController* _pluggedController;
-    QAction* _manageProfilesAction;
 };
 }
 
-- 
2.13.0