Commit b518395c authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Remove unneeded cast to same type

parent b25ff342
......@@ -72,5 +72,5 @@ QModelIndex ProjectProxyModel::proxyIndexFromItem(KDevelop::ProjectBaseItem* ite
KDevelop::ProjectBaseItem* ProjectProxyModel::itemFromProxyIndex( const QModelIndex& idx ) const
{
return static_cast<KDevelop::ProjectBaseItem*>( projectModel()->itemFromIndex( mapToSource( idx ) ) );
return projectModel()->itemFromIndex( mapToSource(idx));
}
......@@ -63,16 +63,13 @@ IdealController::IdealController(Sublime::MainWindow* mainWindow):
m_docks = qobject_cast<KActionMenu*>(mainWindow->action("docks_submenu"));
m_showLeftDock = qobject_cast<QAction*>(m_mainWindow->action("show_left_dock"));
m_showRightDock = qobject_cast<QAction*>(m_mainWindow->action("show_right_dock"));
m_showBottomDock = qobject_cast<QAction*>(m_mainWindow->action("show_bottom_dock"));
m_showLeftDock = m_mainWindow->action("show_left_dock");
m_showRightDock = m_mainWindow->action("show_right_dock");
m_showBottomDock = m_mainWindow->action("show_bottom_dock");
// the 'show top dock' action got removed (IOW, it's never created)
// (let's keep this code around if we ever want to reintroduce the feature...
auto action = m_mainWindow->action("show_top_dock");
if (action) {
m_showTopDock = qobject_cast<QAction*>(action);
}
m_showTopDock = m_mainWindow->action("show_top_dock");
connect(m_mainWindow, &MainWindow::settingsLoaded, this, &IdealController::loadSettings);
......
......@@ -181,8 +181,6 @@ bool ProjectModelItemDelegate::helpEvent(QHelpEvent* event,
}
if (event->type() == QEvent::ToolTip) {
auto* helpEvent = static_cast<QHelpEvent*>(event);
// explicitly close current tooltip, as its autoclose margins overlap items
if ((m_tooltippedIndex != index) && m_tooltip) {
m_tooltip->close();
......@@ -205,7 +203,7 @@ bool ProjectModelItemDelegate::helpEvent(QHelpEvent* event,
// but the API seems not to allow more control.
QToolTip::hideText();
m_tooltip = new KDevelop::NavigationToolTip(view, helpEvent->globalPos() + QPoint(40, 0), navigationWidget);
m_tooltip = new KDevelop::NavigationToolTip(view, event->globalPos() + QPoint(40, 0), navigationWidget);
m_tooltip->resize(navigationWidget->sizeHint() + QSize(10, 10));
auto rect = view->visualRect(m_tooltippedIndex);
rect.moveTopLeft(view->mapToGlobal(rect.topLeft()));
......
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