if (watched == m_view->viewport()) {
switch (event->type()) {
case QEvent::Leave:
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
// Set the toggle invisible, if a mouse button has been pressed
// outside the toggle boundaries. This e.g. assures, that the toggle
// gets invisible during dragging items.
- if (m_toggle != 0) {
+ if (m_toggle) {
const QRect toggleBounds(m_toggle->mapToGlobal(QPoint(0, 0)), m_toggle->size());
m_toggle->setVisible(toggleBounds.contains(QCursor::pos()));
}
void SelectionManager::reset()
{
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->reset();
}
}
m_connected = false;
}
- if (m_toggle == 0) {
+ if (!m_toggle) {
return;
}
void SelectionManager::slotViewportEntered()
{
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
{
emit selectionChanged();
- if ((m_toggle != 0) && !m_toggle->url().isEmpty()) {
+ if (m_toggle && !m_toggle->url().isEmpty()) {
const QModelIndex index = indexForUrl(m_toggle->url());
if (index.isValid()) {
QItemSelectionModel* selModel = m_view->selectionModel();
Q_UNUSED(parent);
Q_UNUSED(start);
Q_UNUSED(end);
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
// The selection has been changed outside the scope of the selection manager
// (e. g. by the rubberband or the "Select All" action). Take care updating
// the state of the toggle button.
- if ((m_toggle != 0) && !m_toggle->url().isEmpty()) {
+ if (m_toggle && !m_toggle->url().isEmpty()) {
const QModelIndex index = indexForUrl(m_toggle->url());
if (index.isValid()) {
if (selected.contains(index)) {