Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Konsole
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
24
Merge Requests
24
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Utilities
Konsole
Commits
66e85acb
Commit
66e85acb
authored
Nov 05, 2016
by
Martin Tobias Holmedahl Sandsmark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence ubsan warnings about invalid pointer casts
REVIEW: 129343
parent
a30be88f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
22 deletions
+21
-22
src/SessionController.cpp
src/SessionController.cpp
+17
-19
src/TerminalDisplay.cpp
src/TerminalDisplay.cpp
+2
-1
src/ViewManager.cpp
src/ViewManager.cpp
+2
-2
No files found.
src/SessionController.cpp
View file @
66e85acb
...
...
@@ -450,25 +450,23 @@ void SessionController::sendBackgroundColor()
bool
SessionController
::
eventFilter
(
QObject
*
watched
,
QEvent
*
event
)
{
if
(
watched
==
_view
)
{
if
(
event
->
type
()
==
QEvent
::
FocusIn
)
{
// notify the world that the view associated with this session has been focused
// used by the view manager to update the title of the MainWindow widget containing the view
emit
focused
(
this
);
// when the view is focused, set bell events from the associated session to be delivered
// by the focused view
// first, disconnect any other views which are listening for bell signals from the session
disconnect
(
_session
.
data
(),
&
Konsole
::
Session
::
bellRequest
,
0
,
0
);
// second, connect the newly focused view to listen for the session's bell signal
connect
(
_session
.
data
(),
&
Konsole
::
Session
::
bellRequest
,
_view
.
data
(),
&
Konsole
::
TerminalDisplay
::
bell
);
if
(
_copyInputToAllTabsAction
&&
_copyInputToAllTabsAction
->
isChecked
())
{
// A session with "Copy To All Tabs" has come into focus:
// Ensure that newly created sessions are included in _copyToGroup!
copyInputToAllTabs
();
}
if
(
event
->
type
()
==
QEvent
::
FocusIn
&&
watched
==
_view
)
{
// notify the world that the view associated with this session has been focused
// used by the view manager to update the title of the MainWindow widget containing the view
emit
focused
(
this
);
// when the view is focused, set bell events from the associated session to be delivered
// by the focused view
// first, disconnect any other views which are listening for bell signals from the session
disconnect
(
_session
.
data
(),
&
Konsole
::
Session
::
bellRequest
,
0
,
0
);
// second, connect the newly focused view to listen for the session's bell signal
connect
(
_session
.
data
(),
&
Konsole
::
Session
::
bellRequest
,
_view
.
data
(),
&
Konsole
::
TerminalDisplay
::
bell
);
if
(
_copyInputToAllTabsAction
&&
_copyInputToAllTabsAction
->
isChecked
())
{
// A session with "Copy To All Tabs" has come into focus:
// Ensure that newly created sessions are included in _copyToGroup!
copyInputToAllTabs
();
}
}
...
...
src/TerminalDisplay.cpp
View file @
66e85acb
...
...
@@ -3466,9 +3466,9 @@ bool AutoScrollHandler::eventFilter(QObject* watched, QEvent* event)
Q_ASSERT
(
watched
==
parent
());
Q_UNUSED
(
watched
);
QMouseEvent
*
mouseEvent
=
(
QMouseEvent
*
)
event
;
switch
(
event
->
type
())
{
case
QEvent
::
MouseMove
:
{
QMouseEvent
*
mouseEvent
=
(
QMouseEvent
*
)
event
;
bool
mouseInWidget
=
widget
()
->
rect
().
contains
(
mouseEvent
->
pos
());
if
(
mouseInWidget
)
{
if
(
_timerId
)
...
...
@@ -3483,6 +3483,7 @@ bool AutoScrollHandler::eventFilter(QObject* watched, QEvent* event)
break
;
}
case
QEvent
::
MouseButtonRelease
:
{
QMouseEvent
*
mouseEvent
=
(
QMouseEvent
*
)
event
;
if
(
_timerId
&&
(
mouseEvent
->
buttons
()
&
~
Qt
::
LeftButton
))
{
killTimer
(
_timerId
);
_timerId
=
0
;
...
...
src/ViewManager.cpp
View file @
66e85acb
...
...
@@ -720,8 +720,8 @@ void ViewManager::viewDestroyed(QWidget* view)
{
// Note: the received QWidget has already been destroyed, so
// using dynamic_cast<> or qobject_cast<> does not work here
TerminalDisplay
*
display
=
static_cast
<
TerminalDisplay
*>
(
view
);
Q_ASSERT
(
display
);
// We only need the pointer address to look it up below
TerminalDisplay
*
display
=
reinterpret_cast
<
TerminalDisplay
*>
(
view
);
// 1. detach view from session
// 2. if the session has no views left, close it
...
...
Write
Preview
Markdown
is supported
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