Commit 618a7508 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Fix bool implicit conversions

parent 7342cbea
......@@ -134,7 +134,7 @@ MainWindow::MainWindow() :
// KXMLGui is making the status bar always visible, we need to fix in a proper way.
if (statusBar()) {
if (statusBar() != nullptr) {
statusBar()->installEventFilter(this);
}
}
......@@ -926,7 +926,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
default: ;
}
}
if (qobject_cast<QStatusBar*>(obj)) {
if (qobject_cast<QStatusBar*>(obj) != nullptr) {
switch(event->type()) {
case QEvent::Show: statusBar()->hide(); break;
default: return true;
......
......@@ -22,7 +22,7 @@ EscapeSequenceUrlFilter::EscapeSequenceUrlFilter(Session* session, TerminalDispl
void EscapeSequenceUrlFilter::process()
{
if (!_window->screenWindow() && _window->screenWindow()->screen()) {
if ((_window->screenWindow() == nullptr) && (_window->screenWindow()->screen() != nullptr)) {
return;
}
auto sWindow = _window->screenWindow();
......
......@@ -76,7 +76,7 @@ void FileFilterHotSpot::activate(QObject *)
// The file path without the ":123" ... etc bits
const QString path = _filePath.mid(0, match.capturedStart(0));
if (!_session) {
if (_session == nullptr) {
openUrl(path);
return;
}
......@@ -116,7 +116,7 @@ void FileFilterHotSpot::activate(QObject *)
// already part of editorCmd
auto *job = new KIO::ApplicationLauncherJob(service);
connect(job, &KJob::result, this, [path, job, openUrl]() {
if (job->error()) {
if (job->error() != 0) {
// TODO: use KMessageWidget (like the "terminal is read-only" message)
KMessageBox::sorry(QApplication::activeWindow(),
i18n("Could not open file with the text editor specified in the profile settings;\n"
......
......@@ -155,7 +155,7 @@ void FilterChain::keyReleaseEvent(TerminalDisplay *td, QKeyEvent *ev, int charLi
}
auto spot = hotSpotAt(charLine, charColumn);
if (spot) {
if (spot != nullptr) {
spot->keyReleaseEvent(td, ev);
}
}
......@@ -186,7 +186,7 @@ bool FilterChain::keyPressEvent(TerminalDisplay *td, QKeyEvent *ev, int charLine
}
auto spot = hotSpotAt(charLine, charColumn);
if (spot) {
if (spot != nullptr) {
spot->keyPressEvent(td, ev);
}
return false;
......@@ -196,16 +196,16 @@ void FilterChain::mouseMoveEvent(TerminalDisplay *td, QMouseEvent *ev, int char
{
auto spot = hotSpotAt(charLine, charColumn);
if (_hotSpotUnderMouse != spot) {
if (_hotSpotUnderMouse) {
if (_hotSpotUnderMouse != nullptr) {
_hotSpotUnderMouse->mouseLeaveEvent(td, ev);
}
_hotSpotUnderMouse = spot;
if (_hotSpotUnderMouse) {
if (_hotSpotUnderMouse != nullptr) {
_hotSpotUnderMouse->mouseEnterEvent(td, ev);
}
}
if (spot) {
if (spot != nullptr) {
spot->mouseMoveEvent(td, ev);
}
}
......
......@@ -54,7 +54,7 @@ void ConfigDialogButtonGroupManager::add(const QButtonGroup *obj)
bool ConfigDialogButtonGroupManager::hasChanged() const
{
for(const QButtonGroup *group: qAsConst(_groups)) {
if (!group->checkedButton()) {
if (group->checkedButton() == nullptr) {
continue;
}
int value = buttonToEnumValue(group->checkedButton());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment