[rkward/work/kateintegration] rkward/windows: Most plugin integration slots are implemented, now. Only a few tough ones left...
Thomas Friedrichsmeier
null at kde.org
Wed Jan 8 20:48:59 GMT 2020
Git commit a0177d843a493e17921a3b823da1c159c81cd843 by Thomas Friedrichsmeier.
Committed on 08/01/2020 at 20:48.
Pushed by tfry into branch 'work/kateintegration'.
Most plugin integration slots are implemented, now. Only a few tough ones left...
M +9 -5 rkward/windows/katepluginintegration.cpp
M +3 -2 rkward/windows/rkworkplaceview.h
https://commits.kde.org/rkward/a0177d843a493e17921a3b823da1c159c81cd843
diff --git a/rkward/windows/katepluginintegration.cpp b/rkward/windows/katepluginintegration.cpp
index f640f30c..8dc0a5a5 100644
--- a/rkward/windows/katepluginintegration.cpp
+++ b/rkward/windows/katepluginintegration.cpp
@@ -136,9 +136,10 @@ QList<KTextEditor::Document *> KatePluginIntegrationApp::documents() {
QList<KTextEditor::Document*> ret;
for (int i = 0; i < w.size (); ++i) {
KTextEditor::View *v = static_cast<RKCommandEditorWindow*>(w[i])->getView();
- if (v) ret.append (v->document());
+ if (v) ret.append(v->document());
}
return ret;
+ // TODO: This should never return an empty list, as some plugins depend on it. See activeView().
}
KTextEditor::Document *KatePluginIntegrationApp::findUrl(const QUrl &url) {
@@ -344,8 +345,10 @@ QObject *KatePluginIntegrationWindow::pluginView(const QString &name) {
bool KatePluginIntegrationWindow::closeSplitView(KTextEditor::View* view) {
RK_TRACE (APP);
- return false;
- // TODO
+
+ // TODO: This should close the area that this view is in, not necessarily the view itself. However, if the same doc
+ // is also present in the area to merge into, then close this view, keeping the other.
+ return closeView(view);
}
bool KatePluginIntegrationWindow::closeView(KTextEditor::View* view) {
@@ -389,12 +392,13 @@ bool KatePluginIntegrationWindow::moveToolView(QWidget* widget, KTextEditor::Mai
void KatePluginIntegrationWindow::splitView(Qt::Orientation orientation) {
RK_TRACE (APP);
- // TODO
+ RKWorkplace::mainWorkplace()->view()->splitView(orientation);
}
bool KatePluginIntegrationWindow::viewsInSameSplitView(KTextEditor::View* view1, KTextEditor::View* view2) {
RK_TRACE (APP);
- // TODO
+ // TODO not sure what the semantics of this really are. The two views are in the same view area (not visible, simultaneously), or in two areas split side-by-side?
+ // However, this is essentially unused in kate.
return false;
}
diff --git a/rkward/windows/rkworkplaceview.h b/rkward/windows/rkworkplaceview.h
index 2f0f6c2b..cf737f65 100644
--- a/rkward/windows/rkworkplaceview.h
+++ b/rkward/windows/rkworkplaceview.h
@@ -2,7 +2,7 @@
rkworkplaceview - description
-------------------
begin : Tue Sep 26 2006
- copyright : (C) 2006 - 2017 by Thomas Friedrichsmeier
+ copyright : (C) 2006 - 2020 by Thomas Friedrichsmeier
email : thomas.friedrichsmeier at kdemail.net
***************************************************************************/
@@ -99,6 +99,7 @@ public:
void restoreLayout (const QString& desc);
/** For use right after workplace restoration: Purge any panes set up by restoreLayout(), but left empty */
void purgeEmptyPanes ();
+ void splitView(Qt::Orientation orientation) { splitView (orientation, QString()); };
signals:
/** a new page / window was activated
@param widget the newly activated window */
@@ -123,7 +124,7 @@ private:
void updateActions ();
RKWorkplaceViewPane *createPane (bool init_actions = true);
RKWorkplaceViewPane *findWindow (RKMDIWindow *window) const;
- void splitView (Qt::Orientation orientation, const QString &description=QString (), const QString &base=QString ());
+ void splitView (Qt::Orientation orientation, const QString &description, const QString &base=QString ());
QAction *action_page_left;
QAction *action_page_right;
More information about the rkward-tracker
mailing list