[rkward/work/kateintegration] rkward: AMEND ME: Just some initial experiments in getting kate plugins to work.

Thomas Friedrichsmeier null at kde.org
Sun Apr 22 09:22:21 UTC 2018


Git commit 3a6e07d5569a7c6e035cd5b87d7297f107f6fe9a by Thomas Friedrichsmeier.
Committed on 16/06/2017 at 08:24.
Pushed by tfry into branch 'work/kateintegration'.

AMEND ME: Just some initial experiments in getting kate plugins to work.

M  +11   -0    rkward/rkward.cpp
M  +5    -0    rkward/rkward.h
M  +1    -0    rkward/windows/CMakeLists.txt
M  +2    -1    rkward/windows/rkcommandeditorwindow.cpp

https://commits.kde.org/rkward/3a6e07d5569a7c6e035cd5b87d7297f107f6fe9a

diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 6e510412..320b1c8e 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -81,6 +81,7 @@
 #include "windows/rkdebugconsole.h"
 #include "windows/rkcallstackviewer.h"
 #include "windows/rkdebugmessagewindow.h"
+#include "windows/katepluginintegration.h"
 #include "rkconsole.h"
 #include "debug.h"
 #include "version.h"
@@ -120,6 +121,7 @@ RKWardMainWindow::RKWardMainWindow () : KParts::MainWindow ((QWidget *)0, (Qt::W
 	workspace_modified = false;
 	merge_loads = false;
 	rkward_mainwin = this;
+	katepluginintegration = 0;
 	RKGlobals::rinter = 0;
 	RKSettings::settings_tracker = new RKSettingsTracker (this);
 
@@ -179,6 +181,15 @@ RKWardMainWindow::~RKWardMainWindow() {
 	delete RControlWindow::getControl ();
 }
 
+KatePluginIntegration* RKWardMainWindow::katePluginIntegration () {
+	RK_TRACE (APP);
+
+	if (!katepluginintegration) {
+		katepluginintegration = new KatePluginIntegration (this);
+	}
+	return katepluginintegration;
+}
+
 void RKWardMainWindow::closeEvent (QCloseEvent *e) {
 	RK_TRACE (APP);
 
diff --git a/rkward/rkward.h b/rkward/rkward.h
index a04cc8e6..11ff4af6 100644
--- a/rkward/rkward.h
+++ b/rkward/rkward.h
@@ -29,6 +29,7 @@ class RKTopLevelWindowGUI;
 class KRecentFilesAction;
 class KSqueezedTextLabel;
 class QAction;
+class KatePluginIntegration;
 
 /**
 The main class of rkward. This is where all strings are tied together, controls the initialization, and there are some of the most important slots for user actions. All real work is done elsewhere.
@@ -58,6 +59,8 @@ public:
 	void setWorkspaceMightBeModified (bool modified) { workspace_modified = modified; };
 /** Merge files to be loaded, instead of closing windows / clearing workspace */
 	void setMergeLoads (bool merge) { merge_loads = merge; };
+
+	KatePluginIntegration *katePluginIntegration ();
 protected:
 	/** save Options/Settings. Includes general Options like all bar positions and status as well as the geometry and the recent file list */
 	void saveOptions();
@@ -199,6 +202,8 @@ private:
 	bool no_ask_save;
 	bool workspace_modified;
 	bool merge_loads;
+
+	KatePluginIntegration *katepluginintegration;
 };
 
 #endif // RKWARD_H
diff --git a/rkward/windows/CMakeLists.txt b/rkward/windows/CMakeLists.txt
index 45767cd4..6c1a2ae0 100644
--- a/rkward/windows/CMakeLists.txt
+++ b/rkward/windows/CMakeLists.txt
@@ -21,6 +21,7 @@ SET(windows_STAT_SRCS
 	rktoolwindowlist.cpp
 	robjectbrowser.cpp
 	rkdebugmessagewindow.cpp
+	katepluginintegration.cpp
 )
 
 ADD_LIBRARY(windows STATIC ${windows_STAT_SRCS})
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 82230635..ddcb3c6f 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -60,6 +60,7 @@
 #include "../rkward.h"
 #include "rkhelpsearchwindow.h"
 #include "rkworkplace.h"
+#include "katepluginintegration.h"
 
 #include "../debug.h"
 
@@ -92,7 +93,7 @@ RKCommandEditorWindow::RKCommandEditorWindow (QWidget *parent, bool use_r_highli
 	KTextEditor::ModificationInterface* em_iface = qobject_cast<KTextEditor::ModificationInterface*> (m_doc);
 	if (em_iface) em_iface->setModifiedOnDiskWarning (true);
 	else RK_ASSERT (false);
-	m_view = m_doc->createView (this);
+	m_view = m_doc->createView (this, RKWardMainWindow::getMain ()->katePluginIntegration ()->mainWindow ());
 
 	setFocusProxy (m_view);
 	setFocusPolicy (Qt::StrongFocus);



More information about the rkward-tracker mailing list