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
Konsole
Commits
1946d32d
Commit
1946d32d
authored
Jul 10, 2021
by
Martin Tobias Holmedahl Sandsmark
Committed by
Tomaz Canabrava
Jul 16, 2021
Browse files
Fix one crash in the sshmanager plugin
BUG: 439551
parent
54186903
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/SSHManager/sshmanagerplugin.cpp
View file @
1946d32d
...
...
@@ -11,6 +11,7 @@
#include
"sshmanagermodel.h"
#include
"session/SessionController.h"
#include
"konsoledebug.h"
#include
<QMainWindow>
#include
<QDockWidget>
...
...
@@ -78,12 +79,29 @@ QList<QAction *> SSHManagerPlugin::menuBarActions(Konsole::MainWindow* mainWindo
void
SSHManagerPlugin
::
activeViewChanged
(
Konsole
::
SessionController
*
controller
)
{
activeViewChangedInternal
(
QPointer
(
controller
));
}
void
SSHManagerPlugin
::
activeViewChangedInternal
(
QPointer
<
Konsole
::
SessionController
>
controller
)
{
if
(
!
controller
)
{
qCWarning
(
KonsoleDebug
)
<<
"Active view changed, but no controller"
;
return
;
}
if
(
!
controller
->
view
())
{
qCWarning
(
KonsoleDebug
)
<<
controller
<<
"does not have a view"
;
return
;
}
auto
mainWindow
=
qobject_cast
<
Konsole
::
MainWindow
*>
(
controller
->
view
()
->
topLevelWidget
());
// if we don't get a mainwindow here this *might* be just opening, call it again
//
HACK:
if we don't get a mainwindow here this *might* be just opening, call it again
// later on.
// We really shouldn't use an arbitrary time delay, and we need to use a
// QPointer in case it gets deleted while the timer is running.
if
(
!
mainWindow
)
{
QTimer
::
singleShot
(
500
,
this
,
[
this
,
controller
]{
activeViewChanged
(
controller
);
});
QTimer
::
singleShot
(
500
,
this
,
[
this
,
controller
]{
activeViewChanged
Internal
(
controller
);
});
return
;
}
...
...
src/plugins/SSHManager/sshmanagerplugin.h
View file @
1946d32d
...
...
@@ -29,6 +29,9 @@ public:
void
activeViewChanged
(
Konsole
::
SessionController
*
controller
)
override
;
QList
<
QAction
*>
menuBarActions
(
Konsole
::
MainWindow
*
mainWindow
)
const
override
;
private
Q_SLOTS
:
void
activeViewChangedInternal
(
QPointer
<
Konsole
::
SessionController
>
controller
);
private:
std
::
unique_ptr
<
SSHManagerPluginPrivate
>
d
;
};
...
...
Martin Tobias Holmedahl Sandsmark
@sandsmark
mentioned in commit
94e4285d
·
Jul 19, 2021
mentioned in commit
94e4285d
mentioned in commit 94e4285da0acee4ff94ccb54583eaafda40a8958
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