Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
e16167da
Commit
e16167da
authored
Sep 21, 2021
by
Waqar Ahmed
Browse files
Fix replicode plugin not deleting its toolview
BUG: 441859
parent
13c00b18
Pipeline
#81872
passed with stage
in 8 minutes and 47 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
addons/kate-ctags/kate_ctags_view.cpp
View file @
e16167da
...
...
@@ -133,7 +133,7 @@ KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
KMessageBox
::
sorry
(
nullptr
,
error
);
});
m_gotoSymbWidget
=
new
GotoSymbolWidget
(
mainWin
,
this
);
m_gotoSymbWidget
.
reset
(
new
GotoSymbolWidget
(
mainWin
,
this
)
)
;
auto
openLocal
=
actionCollection
()
->
addAction
(
QStringLiteral
(
"open_local_gts"
));
openLocal
->
setText
(
i18n
(
"Go To Local Symbol"
));
actionCollection
()
->
setDefaultShortcut
(
openLocal
,
Qt
::
CTRL
|
Qt
::
ALT
|
Qt
::
Key_P
);
...
...
addons/kate-ctags/kate_ctags_view.h
View file @
e16167da
...
...
@@ -103,7 +103,7 @@ private:
QPointer
<
KTextEditor
::
MainWindow
>
m_mWin
;
QPointer
<
QWidget
>
m_toolView
;
Ui
::
kateCtags
m_ctagsUi
{};
GotoSymbolWidget
*
m_gotoSymbWidget
;
std
::
unique_ptr
<
GotoSymbolWidget
>
m_gotoSymbWidget
;
QPointer
<
KActionMenu
>
m_menu
;
QAction
*
m_gotoDef
;
...
...
addons/replicode/replicodeview.cpp
View file @
e16167da
...
...
@@ -46,22 +46,22 @@ ReplicodeView::ReplicodeView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
actionCollection
()
->
addAction
(
QStringLiteral
(
"katereplicode_stop"
),
m_stopAction
);
m_stopAction
->
setEnabled
(
false
);
m_toolview
=
m_mainWindow
->
createToolView
(
plugin
,
QStringLiteral
(
"kate_private_plugin_katereplicodeplugin_run"
),
KTextEditor
::
MainWindow
::
Bottom
,
QIcon
::
fromTheme
(
QStringLiteral
(
"code-block"
)),
i18n
(
"Replicode Output"
));
m_replicodeOutput
=
new
QListWidget
(
m_toolview
);
m_toolview
.
reset
(
m_mainWindow
->
createToolView
(
plugin
,
QStringLiteral
(
"kate_private_plugin_katereplicodeplugin_run"
),
KTextEditor
::
MainWindow
::
Bottom
,
QIcon
::
fromTheme
(
QStringLiteral
(
"code-block"
)),
i18n
(
"Replicode Output"
))
)
;
m_replicodeOutput
=
new
QListWidget
(
m_toolview
.
get
()
);
m_replicodeOutput
->
setSelectionMode
(
QAbstractItemView
::
ContiguousSelection
);
connect
(
m_replicodeOutput
,
&
QListWidget
::
itemActivated
,
this
,
&
ReplicodeView
::
outputClicked
);
m_mainWindow
->
hideToolView
(
m_toolview
);
m_mainWindow
->
hideToolView
(
m_toolview
.
get
()
);
m_configSidebar
=
m_mainWindow
->
createToolView
(
plugin
,
QStringLiteral
(
"kate_private_plugin_katereplicodeplugin_config"
),
KTextEditor
::
MainWindow
::
Right
,
QIcon
::
fromTheme
(
QStringLiteral
(
"code-block"
)),
i18n
(
"Replicode Config"
));
m_configView
=
new
ReplicodeConfig
(
m_configSidebar
);
m_configSidebar
.
reset
(
m_mainWindow
->
createToolView
(
plugin
,
QStringLiteral
(
"kate_private_plugin_katereplicodeplugin_config"
),
KTextEditor
::
MainWindow
::
Right
,
QIcon
::
fromTheme
(
QStringLiteral
(
"code-block"
)),
i18n
(
"Replicode Config"
))
)
;
m_configView
=
new
ReplicodeConfig
(
m_configSidebar
.
get
()
);
m_runButton
=
new
QPushButton
(
i18nc
(
"shortcut for action"
,
"Run (%1)"
,
m_runAction
->
shortcut
().
toString
()));
m_stopButton
=
new
QPushButton
(
i18nc
(
"shortcut for action"
,
"Stop (%1)"
,
m_stopAction
->
shortcut
().
toString
()));
...
...
@@ -79,24 +79,24 @@ ReplicodeView::ReplicodeView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
ReplicodeView
::~
ReplicodeView
()
{
m_mainWindow
->
guiFactory
()
->
removeClient
(
this
);
delete
m_executor
;
m_mainWindow
->
guiFactory
()
->
removeClient
(
this
);
}
void
ReplicodeView
::
viewChanged
()
{
if
(
m_mainWindow
->
activeView
()
&&
m_mainWindow
->
activeView
()
->
document
()
&&
m_mainWindow
->
activeView
()
->
document
()
->
url
().
fileName
().
endsWith
(
QLatin1String
(
".replicode"
)))
{
m_mainWindow
->
showToolView
(
m_configSidebar
);
m_mainWindow
->
showToolView
(
m_configSidebar
.
get
()
);
}
else
{
m_mainWindow
->
hideToolView
(
m_configSidebar
);
m_mainWindow
->
hideToolView
(
m_toolview
);
m_mainWindow
->
hideToolView
(
m_configSidebar
.
get
()
);
m_mainWindow
->
hideToolView
(
m_toolview
.
get
()
);
}
}
void
ReplicodeView
::
runReplicode
()
{
m_mainWindow
->
showToolView
(
m_toolview
);
m_mainWindow
->
showToolView
(
m_toolview
.
get
()
);
KTextEditor
::
View
*
editor
=
m_mainWindow
->
activeView
();
if
(
!
editor
||
!
editor
->
document
())
{
QMessageBox
::
warning
(
m_mainWindow
->
window
(),
i18nc
(
"@title:window"
,
"Active Document Not Found"
),
i18n
(
"Could not find an active document to run."
));
...
...
addons/replicode/replicodeview.h
View file @
e16167da
...
...
@@ -49,8 +49,8 @@ private:
KTextEditor
::
MainWindow
*
m_mainWindow
;
QProcess
*
m_executor
;
QListWidget
*
m_replicodeOutput
;
QWidget
*
m_toolview
;
QWidget
*
m_configSidebar
;
std
::
unique_ptr
<
QWidget
>
m_toolview
;
std
::
unique_ptr
<
QWidget
>
m_configSidebar
;
QPushButton
*
m_runButton
;
QPushButton
*
m_stopButton
;
QAction
*
m_runAction
;
...
...
Waqar Ahmed
@waqar
mentioned in commit
727e9e88
·
Sep 21, 2021
mentioned in commit
727e9e88
mentioned in commit 727e9e883d174a4d8b25e4eb0f11dbc3e5f73d6d
Toggle commit list
Waqar Ahmed
@waqar
mentioned in commit
1d0983e1
·
Sep 21, 2021
mentioned in commit
1d0983e1
mentioned in commit 1d0983e16161f066ee8cd5707df6dce170e71e19
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment