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

Use static_cast when sure about the result

parent 5c65da19
......@@ -225,7 +225,7 @@ KDevelop::ContextMenuExtension Plugin::contextMenuExtension(KDevelop::Context* c
KDevelop::ContextMenuExtension extension = KDevelop::IPlugin::contextMenuExtension(context);
if (context->hasType(KDevelop::Context::EditorContext) && m_currentProject && !isRunning()) {
auto eContext = dynamic_cast<KDevelop::EditorContext*>(context);
auto eContext = static_cast<KDevelop::EditorContext*>(context);
QMimeDatabase db;
const auto mime = db.mimeTypeForUrl(eContext->url());
......@@ -237,7 +237,7 @@ KDevelop::ContextMenuExtension Plugin::contextMenuExtension(KDevelop::Context* c
}
if (context->hasType(KDevelop::Context::ProjectItemContext) && !isRunning()) {
auto pContext = dynamic_cast<KDevelop::ProjectItemContext*>(context);
auto pContext = static_cast<KDevelop::ProjectItemContext*>(context);
if (pContext->items().size() != 1) {
return extension;
}
......
......@@ -752,7 +752,7 @@ int main( int argc, char *argv[] )
return 1;
}
KDevelop::ILaunchConfiguration* ilaunch = core->runController()->createLaunchConfiguration(type, launcher, nullptr, launchName);
launch = dynamic_cast<KDevelop::LaunchConfiguration*>(ilaunch);
launch = static_cast<KDevelop::LaunchConfiguration*>(ilaunch);
}
type->configureLaunchFromCmdLineArguments(launch->config(), debugArgs);
......
......@@ -241,7 +241,7 @@ void MIDebugger::processLine(const QByteArray& line)
}
case MI::Record::Async: {
MI::AsyncRecord& async = dynamic_cast<MI::AsyncRecord&>(*r);
MI::AsyncRecord& async = static_cast<MI::AsyncRecord&>(*r);
switch (async.subkind) {
case MI::AsyncRecord::Exec: {
......@@ -281,7 +281,7 @@ void MIDebugger::processLine(const QByteArray& line)
case MI::Record::Stream: {
MI::StreamRecord& s = dynamic_cast<MI::StreamRecord&>(*r);
MI::StreamRecord& s = static_cast<MI::StreamRecord&>(*r);
if (s.subkind == MI::StreamRecord::Target) {
emit applicationOutput(s.message);
......
......@@ -85,7 +85,7 @@ void LldbFrameStackModel::handleThreadInfo(const ResultRecord& r)
if (threadMI[QStringLiteral("state")].literal() == QLatin1String("stopped")) {
// lldb-mi returns multiple frame entry for each thread
// so can't directly use threadMI["frame"]
auto &th = dynamic_cast<const TupleValue&>(threadMI);
auto &th = static_cast<const TupleValue&>(threadMI);
Value *topFrame = nullptr;
for (auto res : th.results) {
if (res->variable == QLatin1String("frame")) {
......
......@@ -63,7 +63,8 @@ CMakePreferences::CMakePreferences(IPlugin* plugin, const ProjectConfigOptions&
// configure the extraArguments widget to span the advanced box width but not
// expand the dialog to the width of the longest element in the argument history.
m_prefsUi->extraArguments->setMinimumWidth(dynamic_cast<QComboBox*>(m_prefsUi->extraArguments)->minimumSizeHint().width());
// static_cast<QComboBox*> needed because KComboBox::minimumSizeHint() override mistakingly made it protected
m_prefsUi->extraArguments->setMinimumWidth(static_cast<QComboBox*>(m_prefsUi->extraArguments)->minimumSizeHint().width());
m_extraArgumentsHistory = new CMakeExtraArgumentsHistory(m_prefsUi->extraArguments);
connect(m_prefsUi->buildDirs, static_cast<void(KComboBox::*)(int)>(&KComboBox::currentIndexChanged),
......
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