Remove TerminalDisplay::sessionIsPrimaryScreen(), and use Q_ASSERT
instead, where if _sessionController is actually a nullptr it means
the current konsole process is doomed anyway. Better catch such cases in
debug builds.
Details
Details
- Reviewers
hindenburg - Group Reviewers
Konsole - Commits
- R319:85ee52b10fc5: Use Q_ASSERT to catch null pointers for _sessionController and session()
Diff Detail
Diff Detail
- Repository
- R319 Konsole
- Branch
- check-session-pointer (branched from master)
- Lint
No Linters Available - Unit
No Unit Test Coverage
src/TerminalDisplay.cpp | ||
---|---|---|
798 ↗ | (On Diff #35353) | This is not quite the same - the previous checks _sessionController is not nullptr; this new doesn't. |
src/TerminalDisplay.cpp | ||
---|---|---|
798 ↗ | (On Diff #35353) | Reflecting on this diff and the other one (about primaryScreen), if the session is null, checking for null won't really make a difference as the process is pretty much screwed with a TerminalDisplay but no associated SessionController or Session. It makes more sense to add a Q_ASSERT() to catch this in debug builds; WDYT? |
src/TerminalDisplay.cpp | ||
---|---|---|
798 ↗ | (On Diff #35353) | Ok that is fine |
src/TerminalDisplay.cpp | ||
---|---|---|
798 ↗ | (On Diff #35353) | Don't we want the reverse? We want to die when the variable is nullptr, correct? Prints a warning message containing the source code file name and line number if test is false. |
src/TerminalDisplay.cpp | ||
---|---|---|
798 ↗ | (On Diff #35353) | You're right, of course. I'll fix it shortly. |