Commit 9f918428 authored by dt's avatar dt
Browse files

Compile without rtti support

Since we can easily do that, just do it. No gurantee that we aren't
going to use rtti in the future.
parent 0bbc9451
......@@ -250,7 +250,7 @@ bool CMakeProject::parseCMakeLists()
//qDebug()<<"Create run configurations of m_targets";
QMultiMap<QString, QSharedPointer<CMakeRunConfiguration> > existingRunConfigurations;
foreach(QSharedPointer<ProjectExplorer::RunConfiguration> cmakeRunConfiguration, runConfigurations()) {
if (QSharedPointer<CMakeRunConfiguration> rc = cmakeRunConfiguration.dynamicCast<CMakeRunConfiguration>()) {
if (QSharedPointer<CMakeRunConfiguration> rc = cmakeRunConfiguration.objectCast<CMakeRunConfiguration>()) {
existingRunConfigurations.insert(rc->title(), rc);
}
}
......
......@@ -463,7 +463,7 @@ IDebuggerEngine *DebuggerManager::engine()
IDebuggerManagerAccessForEngines *DebuggerManager::engineInterface()
{
return dynamic_cast<IDebuggerManagerAccessForEngines *>(this);
return this;
}
void DebuggerManager::createNewDock(QWidget *widget)
......
......@@ -31,7 +31,6 @@
#include "debuggermanager.h"
#include <projectexplorer/applicationrunconfiguration.h>
#include <projectexplorer/environment.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
......@@ -50,29 +49,6 @@ using ProjectExplorer::RunConfiguration;
using ProjectExplorer::RunControl;
using ProjectExplorer::ApplicationRunConfiguration;
// A default run configuration for external executables or attaching to
// running processes by id.
class DefaultApplicationRunConfiguration : public ProjectExplorer::ApplicationRunConfiguration
{
public:
explicit DefaultApplicationRunConfiguration(const QString &executable = QString());
virtual QString executable() const { return m_executable; }
virtual RunMode runMode() const { return Gui; }
virtual QString workingDirectory() const { return QString(); }
virtual QStringList commandLineArguments() const { return QStringList(); }
virtual ProjectExplorer::Environment environment() const
{ return ProjectExplorer::Environment(); }
virtual QString dumperLibrary() const { return QString(); }
virtual QStringList dumperLibraryLocations() const { return QStringList(); }
virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const
{ return ProjectExplorer::ToolChain::UNKNOWN; }
virtual QWidget *configurationWidget() { return 0; }
private:
const QString m_executable;
};
DefaultApplicationRunConfiguration::DefaultApplicationRunConfiguration(const QString &executable) :
ProjectExplorer::ApplicationRunConfiguration(0),
m_executable(executable)
......@@ -93,7 +69,7 @@ DebuggerRunner::DebuggerRunner(DebuggerManager *manager)
bool DebuggerRunner::canRun(RunConfigurationPtr runConfiguration, const QString &mode)
{
return mode == ProjectExplorer::Constants::DEBUGMODE
&& !runConfiguration.dynamicCast<ApplicationRunConfiguration>().isNull();
&& !runConfiguration.objectCast<ApplicationRunConfiguration>().isNull();
}
QString DebuggerRunner::displayName() const
......@@ -113,7 +89,7 @@ RunControl *DebuggerRunner::run(RunConfigurationPtr runConfiguration,
{
QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0);
ApplicationRunConfigurationPtr rc =
runConfiguration.dynamicCast<ApplicationRunConfiguration>();
runConfiguration.objectCast<ApplicationRunConfiguration>();
QTC_ASSERT(!rc.isNull(), return 0);
//qDebug() << "***** Debugging" << rc->name() << rc->executable();
DebuggerRunControl *runControl = new DebuggerRunControl(m_manager, startMode, sp, rc);
......@@ -170,7 +146,7 @@ void DebuggerRunControl::start()
{
m_running = true;
ApplicationRunConfigurationPtr rc =
runConfiguration().dynamicCast<ApplicationRunConfiguration>();
runConfiguration().objectCast<ApplicationRunConfiguration>();
if (rc) {
// Enhance parameters by info from the project, but do not clobber
// arguments given in the dialogs
......
......@@ -33,6 +33,7 @@
#include "debuggermanager.h"
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/applicationrunconfiguration.h>
namespace ProjectExplorer {
class ApplicationRunConfiguration;
......@@ -110,6 +111,30 @@ private:
bool m_running;
};
// A default run configuration for external executables or attaching to
// running processes by id.
class DefaultApplicationRunConfiguration : public ProjectExplorer::ApplicationRunConfiguration
{
Q_OBJECT
public:
explicit DefaultApplicationRunConfiguration(const QString &executable = QString());
virtual QString executable() const { return m_executable; }
virtual RunMode runMode() const { return Gui; }
virtual QString workingDirectory() const { return QString(); }
virtual QStringList commandLineArguments() const { return QStringList(); }
virtual ProjectExplorer::Environment environment() const
{ return ProjectExplorer::Environment(); }
virtual QString dumperLibrary() const { return QString(); }
virtual QStringList dumperLibraryLocations() const { return QStringList(); }
virtual ProjectExplorer::ToolChain::ToolChainType toolChainType() const
{ return ProjectExplorer::ToolChain::UNKNOWN; }
virtual QWidget *configurationWidget() { return 0; }
private:
const QString m_executable;
};
} // namespace Internal
} // namespace Debugger
......
......@@ -166,8 +166,10 @@ QVariant SearchResultTreeModel::data(const SearchResultTextRow *row, int role) c
break;
case ItemDataRoles::FileNameRole:
{
const SearchResultFile *file = dynamic_cast<const SearchResultFile *>(row->parent());
result = file->fileName();
if (row->parent()->itemType() == SearchResultTreeItem::ResultFile) {
const SearchResultFile *file = static_cast<const SearchResultFile *>(row->parent());
result = file->fileName();
}
break;
}
default:
......
......@@ -600,8 +600,7 @@ Core::IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName,
Core::EditorManager *editorManager = Core::EditorManager::instance();
Core::IEditor *editor = editorManager->openEditor(fileName, Constants::PERFORCESUBMITEDITOR_KIND);
editorManager->ensureEditorManagerVisible();
PerforceSubmitEditor *submitEditor = dynamic_cast<PerforceSubmitEditor*>(editor);
QTC_ASSERT(submitEditor, return 0);
PerforceSubmitEditor *submitEditor = static_cast<PerforceSubmitEditor*>(editor);
submitEditor->restrictToProjectFiles(depotFileNames);
submitEditor->registerActions(m_undoAction, m_redoAction, m_submitCurrentLogAction, m_diffSelectedFiles);
connect(submitEditor, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiff(QStringList)));
......
......@@ -81,7 +81,7 @@ ApplicationRunConfigurationRunner::~ApplicationRunConfigurationRunner()
bool ApplicationRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
return (mode == ProjectExplorer::Constants::RUNMODE)
&& (!runConfiguration.dynamicCast<ApplicationRunConfiguration>().isNull());
&& (!runConfiguration.objectCast<ApplicationRunConfiguration>().isNull());
}
QString ApplicationRunConfigurationRunner::displayName() const
......@@ -91,7 +91,7 @@ QString ApplicationRunConfigurationRunner::displayName() const
RunControl *ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration.dynamicCast<ApplicationRunConfiguration>();
QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration.objectCast<ApplicationRunConfiguration>();
Q_ASSERT(!rc.isNull());
Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE);
......@@ -126,7 +126,7 @@ ApplicationRunControl::~ApplicationRunControl()
void ApplicationRunControl::start()
{
QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration().dynamicCast<ApplicationRunConfiguration>();
QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration().objectCast<ApplicationRunConfiguration>();
Q_ASSERT(!rc.isNull());
m_applicationLauncher.setEnvironment(rc->environment().toStringList());
......
......@@ -491,12 +491,12 @@ S60DeviceRunConfigurationRunner::S60DeviceRunConfigurationRunner(QObject *parent
bool S60DeviceRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
return (mode == ProjectExplorer::Constants::RUNMODE)
&& (!runConfiguration.dynamicCast<S60DeviceRunConfiguration>().isNull());
&& (!runConfiguration.objectCast<S60DeviceRunConfiguration>().isNull());
}
RunControl* S60DeviceRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration.dynamicCast<S60DeviceRunConfiguration>();
QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration.objectCast<S60DeviceRunConfiguration>();
Q_ASSERT(!rc.isNull());
Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE);
......@@ -541,7 +541,7 @@ S60DeviceRunControl::S60DeviceRunControl(QSharedPointer<RunConfiguration> runCon
void S60DeviceRunControl::start()
{
QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration().dynamicCast<S60DeviceRunConfiguration>();
QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration().objectCast<S60DeviceRunConfiguration>();
QTC_ASSERT(!rc.isNull(), return);
Qt4Project *project = qobject_cast<Qt4Project *>(rc->project());
......
......@@ -264,12 +264,12 @@ S60EmulatorRunConfigurationRunner::S60EmulatorRunConfigurationRunner(QObject *pa
bool S60EmulatorRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
return (mode == ProjectExplorer::Constants::RUNMODE)
&& (!runConfiguration.dynamicCast<S60EmulatorRunConfiguration>().isNull());
&& (!runConfiguration.objectCast<S60EmulatorRunConfiguration>().isNull());
}
RunControl* S60EmulatorRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode)
{
QSharedPointer<S60EmulatorRunConfiguration> rc = runConfiguration.dynamicCast<S60EmulatorRunConfiguration>();
QSharedPointer<S60EmulatorRunConfiguration> rc = runConfiguration.objectCast<S60EmulatorRunConfiguration>();
Q_ASSERT(!rc.isNull());
Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE);
......@@ -304,7 +304,7 @@ S60EmulatorRunControl::S60EmulatorRunControl(QSharedPointer<RunConfiguration> ru
void S60EmulatorRunControl::start()
{
QSharedPointer<S60EmulatorRunConfiguration> rc = runConfiguration().dynamicCast<S60EmulatorRunConfiguration>();
QSharedPointer<S60EmulatorRunConfiguration> rc = runConfiguration().objectCast<S60EmulatorRunConfiguration>();
Q_ASSERT(!rc.isNull());
// stuff like the EPOCROOT and EPOCDEVICE env variable
......
......@@ -960,7 +960,7 @@ void Qt4Project::checkForNewApplicationProjects()
foreach (Qt4ProFileNode *qt4proFile, m_applicationProFileChange) {
bool found = false;
foreach (QSharedPointer<RunConfiguration> rc, runConfigurations()) {
QSharedPointer<Qt4RunConfiguration> qtrc = rc.dynamicCast<Qt4RunConfiguration>();
QSharedPointer<Qt4RunConfiguration> qtrc = rc.objectCast<Qt4RunConfiguration>();
if (qtrc && qtrc->proFilePath() == qt4proFile->path()) {
found = true;
break;
......@@ -984,7 +984,7 @@ void Qt4Project::checkForDeletedApplicationProjects()
QList<QSharedPointer<Qt4RunConfiguration> > removeList;
foreach (QSharedPointer<RunConfiguration> rc, runConfigurations()) {
if (QSharedPointer<Qt4RunConfiguration> qt4rc = rc.dynamicCast<Qt4RunConfiguration>()) {
if (QSharedPointer<Qt4RunConfiguration> qt4rc = rc.objectCast<Qt4RunConfiguration>()) {
if (!paths.contains(qt4rc->proFilePath())) {
removeList.append(qt4rc);
// qDebug()<<"Removing runConfiguration for "<<qt4rc->proFilePath();
......@@ -1037,7 +1037,7 @@ void Qt4Project::projectTypeChanged(Qt4ProFileNode *node, const Qt4ProjectType o
void Qt4Project::proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node)
{
foreach (QSharedPointer<RunConfiguration> rc, runConfigurations()) {
if (QSharedPointer<Qt4RunConfiguration> qt4rc = rc.dynamicCast<Qt4RunConfiguration>()) {
if (QSharedPointer<Qt4RunConfiguration> qt4rc = rc.objectCast<Qt4RunConfiguration>()) {
if (qt4rc->proFilePath() == node->path()) {
qt4rc->invalidateCachedTargetInformation();
}
......
......@@ -86,11 +86,8 @@ ModifyPropertyCommand::ModifyPropertyCommand(ResourceView *view, const QModelInd
bool ModifyPropertyCommand::mergeWith(const QUndoCommand * command)
{
const ModifyPropertyCommand * const brother
= dynamic_cast<const ModifyPropertyCommand *>(command);
if (command == 0 || m_property != brother->m_property)
if (command->id() != id() || m_property != static_cast<const ModifyPropertyCommand *>(command)->m_property)
return false;
// Choose older command (this) and forgot the other
return true;
}
......
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