Projectexplorer: Modernize codebase

Change-Id: I4793b58aa77bcd46af99f8b843c0f7439cdc9269
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-04-13 15:52:14 +02:00
parent 79da8a4586
commit 95ac4edfd4
207 changed files with 1047 additions and 1292 deletions

View File

@@ -105,7 +105,7 @@ FileName AndroidGdbServerKitInformation::autoDetect(const Kit *kit)
ToolChain *tc = ToolChainKitInformation::toolChain(kit);
if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_ID)
return FileName();
AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc);
auto atc = static_cast<AndroidToolChain *>(tc);
return atc->suggestedGdbServer();
}
@@ -114,13 +114,13 @@ FileName AndroidGdbServerKitInformation::autoDetect(const Kit *kit)
///////////////
AndroidGdbServerKitInformationWidget::AndroidGdbServerKitInformationWidget(Kit *kit, const KitInformation *ki)
: KitConfigWidget(kit, ki),
m_label(new ElidingLabel),
m_button(new QPushButton(tr("Manage...")))
AndroidGdbServerKitInformationWidget::AndroidGdbServerKitInformationWidget(Kit *kit, const KitInformation *ki) :
KitConfigWidget(kit, ki),
m_label(new ElidingLabel),
m_button(new QPushButton(tr("Manage...")))
{
// ToolButton with Menu, defaulting to 'Autodetect'.
QMenu *buttonMenu = new QMenu(m_button);
auto buttonMenu = new QMenu(m_button);
QAction *autoDetectAction = buttonMenu->addAction(tr("Auto-detect"));
connect(autoDetectAction, SIGNAL(triggered()), this, SLOT(autoDetectDebugger()));
QAction *changeAction = buttonMenu->addAction(tr("Edit..."));
@@ -179,19 +179,19 @@ void AndroidGdbServerKitInformationWidget::autoDetectDebugger()
void AndroidGdbServerKitInformationWidget::showDialog()
{
QDialog dialog;
QVBoxLayout *layout = new QVBoxLayout(&dialog);
QFormLayout *formLayout = new QFormLayout;
auto layout = new QVBoxLayout(&dialog);
auto formLayout = new QFormLayout;
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
QLabel *binaryLabel = new QLabel(tr("&Binary:"));
PathChooser *chooser = new PathChooser;
auto binaryLabel = new QLabel(tr("&Binary:"));
auto chooser = new PathChooser;
chooser->setExpectedKind(PathChooser::ExistingCommand);
chooser->setPath(AndroidGdbServerKitInformation::gdbServer(m_kit).toString());
binaryLabel->setBuddy(chooser);
formLayout->addRow(binaryLabel, chooser);
layout->addLayout(formLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
layout->addWidget(buttonBox);

View File

@@ -56,7 +56,7 @@ void AndroidPotentialKit::executeFromMenu()
QWidget *AndroidPotentialKit::createWidget(QWidget *parent) const
{
if (!isEnabled())
return 0;
return nullptr;
return new AndroidPotentialKitWidget(parent);
}
@@ -89,18 +89,18 @@ AndroidPotentialKitWidget::AndroidPotentialKitWidget(QWidget *parent)
setSummaryText(QLatin1String("<b>Android has not been configured. Create Android kits.</b>"));
setIcon(Core::Icons::WARNING.icon());
//detailsWidget->setState(Utils::DetailsWidget::NoSummary);
QWidget *mainWidget = new QWidget(this);
auto mainWidget = new QWidget(this);
setWidget(mainWidget);
QGridLayout *layout = new QGridLayout(mainWidget);
auto layout = new QGridLayout(mainWidget);
layout->setMargin(0);
QLabel *label = new QLabel;
auto label = new QLabel;
label->setText(tr("Qt Creator needs additional settings to enable Android support."
" You can configure those settings in the Options dialog."));
label->setWordWrap(true);
layout->addWidget(label, 0, 0, 1, 2);
QPushButton *openOptions = new QPushButton;
auto openOptions = new QPushButton;
openOptions->setText(Core::ICore::msgShowOptionsDialog());
openOptions->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
layout->addWidget(openOptions, 1, 1);

View File

@@ -35,10 +35,10 @@ class AndroidPotentialKit : public ProjectExplorer::IPotentialKit
{
Q_OBJECT
public:
QString displayName() const;
void executeFromMenu();
QWidget *createWidget(QWidget *parent) const;
bool isEnabled() const;
QString displayName() const override;
void executeFromMenu() override;
QWidget *createWidget(QWidget *parent) const override;
bool isEnabled() const override;
};
class AndroidPotentialKitWidget : public Utils::DetailsWidget

View File

@@ -339,7 +339,7 @@ void CMakeConfigurationKitConfigWidget::editConfigurationChanges()
m_dialog = new QDialog(m_summaryLabel->window());
m_dialog->setWindowTitle(tr("Edit CMake Configuration"));
QVBoxLayout *layout = new QVBoxLayout(m_dialog);
auto layout = new QVBoxLayout(m_dialog);
m_editor = new QPlainTextEdit;
m_editor->setToolTip(tr("Enter one variable per line with the variable name "
"separated from the variable value by \"=\".<br>"

View File

@@ -37,11 +37,9 @@ class SearchTaskHandler : public ProjectExplorer::ITaskHandler
Q_OBJECT
public:
SearchTaskHandler() {}
bool canHandle(const ProjectExplorer::Task &task) const;
void handle(const ProjectExplorer::Task &task);
QAction *createAction(QObject *parent) const;
bool canHandle(const ProjectExplorer::Task &task) const override;
void handle(const ProjectExplorer::Task &task) override;
QAction *createAction(QObject *parent) const override;
signals:
void search(const QUrl &url);

View File

@@ -68,8 +68,7 @@ public:
// AbiWidget
// --------------------------------------------------------------------------
AbiWidget::AbiWidget(QWidget *parent) :
QWidget(parent),
AbiWidget::AbiWidget(QWidget *parent) : QWidget(parent),
d(new Internal::AbiWidgetPrivate)
{
QHBoxLayout *layout = new QHBoxLayout(this);

View File

@@ -43,7 +43,7 @@ class PROJECTEXPLORER_EXPORT AbiWidget : public QWidget
Q_OBJECT
public:
AbiWidget(QWidget *parent = 0);
AbiWidget(QWidget *parent = nullptr);
~AbiWidget() override;
void setAbis(const QList<Abi> &, const Abi &current);

View File

@@ -41,12 +41,10 @@ enum { debug = 0 };
namespace ProjectExplorer {
namespace Internal {
AbstractMsvcToolChain::AbstractMsvcToolChain(Core::Id typeId,
Detection d,
const Abi &abi,
const QString& vcvarsBat) :
ToolChain(typeId, d),
const QString& vcvarsBat) : ToolChain(typeId, d),
m_lastEnvironment(Utils::Environment::systemEnvironment()),
m_abi(abi),
m_vcvarsBat(vcvarsBat)
@@ -232,7 +230,6 @@ QByteArray AbstractMsvcToolChain::msvcPredefinedMacros(const QStringList cxxflag
return predefinedMacros;
}
bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env,
const QString &batchFile,
const QString &batchArgs,
@@ -401,7 +398,6 @@ bool AbstractMsvcToolChain::WarningFlagAdder::triggered() const
return m_triggered;
}
} // namespace Internal
} // namespace ProjectExplorer

View File

@@ -83,19 +83,13 @@ using namespace ProjectExplorer;
*/
AbstractProcessStep::AbstractProcessStep(BuildStepList *bsl, Core::Id id) :
BuildStep(bsl, id), m_timer(0), m_futureInterface(0),
m_ignoreReturnValue(false), m_process(0),
m_outputParserChain(0), m_skipFlush(false)
{
}
BuildStep(bsl, id)
{ }
AbstractProcessStep::AbstractProcessStep(BuildStepList *bsl,
AbstractProcessStep *bs) :
BuildStep(bsl, bs), m_timer(0), m_futureInterface(0),
m_ignoreReturnValue(bs->m_ignoreReturnValue),
m_process(0), m_outputParserChain(0), m_skipFlush(false)
{
}
BuildStep(bsl, bs), m_ignoreReturnValue(bs->m_ignoreReturnValue)
{ }
AbstractProcessStep::~AbstractProcessStep()
{
@@ -226,7 +220,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
if (!m_process->waitForStarted()) {
processStartupFailed();
delete m_process;
m_process = 0;
m_process = nullptr;
fi.reportResult(false);
emit finished();
return;
@@ -248,13 +242,13 @@ void AbstractProcessStep::cleanUp()
// Clean up output parsers
if (m_outputParserChain) {
delete m_outputParserChain;
m_outputParserChain = 0;
m_outputParserChain = nullptr;
}
delete m_process;
m_process = 0;
m_process = nullptr;
m_futureInterface->reportResult(returnValue);
m_futureInterface = 0;
m_futureInterface = nullptr;
emit finished();
}
@@ -451,7 +445,7 @@ void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
{
m_timer->stop();
delete m_timer;
m_timer = 0;
m_timer = nullptr;
QString line = QString::fromLocal8Bit(m_process->readAllStandardError());
if (!line.isEmpty())

View File

@@ -88,14 +88,14 @@ private:
void outputAdded(const QString &string, BuildStep::OutputFormat format);
QTimer *m_timer;
QFutureInterface<bool> *m_futureInterface;
QTimer *m_timer = nullptr;
QFutureInterface<bool> *m_futureInterface = nullptr;
ProcessParameters m_param;
bool m_ignoreReturnValue;
Utils::QtcProcess *m_process;
IOutputParser *m_outputParserChain;
bool m_killProcess;
bool m_skipFlush;
bool m_ignoreReturnValue = false;
bool m_killProcess = false;
bool m_skipFlush = false;
Utils::QtcProcess *m_process = nullptr;
IOutputParser *m_outputParserChain = nullptr;
};
} // namespace ProjectExplorer

View File

@@ -50,7 +50,7 @@ AllProjectsFilter::AllProjectsFilter()
void AllProjectsFilter::markFilesAsOutOfDate()
{
setFileIterator(0);
setFileIterator(nullptr);
}
void AllProjectsFilter::prepareSearch(const QString &entry)

View File

@@ -46,8 +46,7 @@ using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
using namespace TextEditor;
AllProjectsFind::AllProjectsFind()
: m_configWidget(0)
AllProjectsFind::AllProjectsFind() : m_configWidget(nullptr)
{
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::fileListChanged,
this, &AllProjectsFind::handleFileListChanged);
@@ -138,10 +137,10 @@ QWidget *AllProjectsFind::createConfigWidget()
{
if (!m_configWidget) {
m_configWidget = new QWidget;
QGridLayout * const gridLayout = new QGridLayout(m_configWidget);
auto gridLayout = new QGridLayout(m_configWidget);
gridLayout->setMargin(0);
m_configWidget->setLayout(gridLayout);
QLabel * const filePatternLabel = new QLabel(tr("Fi&le pattern:"));
auto filePatternLabel = new QLabel(tr("Fi&le pattern:"));
filePatternLabel->setMinimumWidth(80);
filePatternLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
filePatternLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

View File

@@ -88,8 +88,8 @@ ApplicationLauncherPrivate::ApplicationLauncherPrivate() :
{
}
ApplicationLauncher::ApplicationLauncher(QObject *parent)
: QObject(parent), d(new ApplicationLauncherPrivate)
ApplicationLauncher::ApplicationLauncher(QObject *parent) : QObject(parent),
d(new ApplicationLauncherPrivate)
{
if (ProjectExplorerPlugin::projectExplorerSettings().mergeStdErrAndStdOut){
d->m_guiProcess.setReadChannelMode(QProcess::MergedChannels);

View File

@@ -47,7 +47,7 @@ public:
Gui
};
explicit ApplicationLauncher(QObject *parent = 0);
explicit ApplicationLauncher(QObject *parent = nullptr);
~ApplicationLauncher() override;
void setProcessChannelMode(QProcess::ProcessChannelMode mode);

View File

@@ -85,7 +85,7 @@ class TabWidget : public QTabWidget
{
Q_OBJECT
public:
TabWidget(QWidget *parent = 0);
TabWidget(QWidget *parent = nullptr);
signals:
void contextMenuRequested(const QPoint &pos, const int index);
protected:
@@ -139,8 +139,7 @@ void TabWidget::slotContextMenuRequested(const QPoint &pos)
AppOutputPane::RunControlTab::RunControlTab(RunControl *rc, Core::OutputWindow *w) :
runControl(rc), window(w), asyncClosing(false), behaviorOnOutput(Flash)
{
}
{ }
AppOutputPane::AppOutputPane() :
m_mainWidget(new QWidget),
@@ -627,7 +626,7 @@ void AppOutputPane::zoomOut()
m_zoom = m_runControlTabs.first().window->fontZoom();
}
void AppOutputPane::enableButtons(const RunControl *rc /* = 0 */, bool isRunning /* = false */)
void AppOutputPane::enableButtons(const RunControl *rc, bool isRunning)
{
if (rc) {
m_reRunButton->setEnabled(!isRunning && rc->supportsReRunning());

View File

@@ -120,8 +120,8 @@ private:
void enableButtons(const RunControl *rc, bool isRunning);
struct RunControlTab {
explicit RunControlTab(RunControl *runControl = 0,
Core::OutputWindow *window = 0);
explicit RunControlTab(RunControl *runControl = nullptr,
Core::OutputWindow *window = nullptr);
RunControl* runControl;
Core::OutputWindow *window;
// Is the run control stopping asynchronously, close the tab once it finishes

View File

@@ -56,7 +56,7 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id) :
m_clearSystemEnvironment(false)
{
Q_ASSERT(target);
BuildStepList *bsl = new BuildStepList(this, Core::Id(Constants::BUILDSTEPS_BUILD));
auto bsl = new BuildStepList(this, Core::Id(Constants::BUILDSTEPS_BUILD));
//: Display name of the build build step list. Used as part of the labels in the project window.
bsl->setDefaultDisplayName(tr("Build"));
m_stepLists.append(bsl);
@@ -173,7 +173,7 @@ bool BuildConfiguration::fromMap(const QVariantMap &map)
qWarning() << "No data for build step list" << i << "found!";
continue;
}
BuildStepList *list = new BuildStepList(this, data);
auto list = new BuildStepList(this, data);
if (list->isNull()) {
qWarning() << "Failed to restore build step list" << i;
delete list;
@@ -282,7 +282,7 @@ void BuildConfiguration::cloneSteps(BuildConfiguration *source)
qDeleteAll(m_stepLists);
m_stepLists.clear();
foreach (BuildStepList *bsl, source->m_stepLists) {
BuildStepList *newBsl = new BuildStepList(this, bsl);
auto newBsl = new BuildStepList(this, bsl);
newBsl->cloneSteps(bsl);
m_stepLists.append(newBsl);
}

View File

@@ -119,7 +119,7 @@ class PROJECTEXPLORER_EXPORT IBuildConfigurationFactory : public QObject
Q_OBJECT
public:
explicit IBuildConfigurationFactory(QObject *parent = 0);
explicit IBuildConfigurationFactory(QObject *parent = nullptr);
~IBuildConfigurationFactory() override;
// The priority is negative if this factory can not create anything for the target.

View File

@@ -81,7 +81,7 @@ int BuildConfigurationModel::columnCount(const QModelIndex &parent) const
void BuildConfigurationModel::displayNameChanged()
{
BuildConfiguration *rc = qobject_cast<BuildConfiguration *>(sender());
auto rc = qobject_cast<BuildConfiguration *>(sender());
if (!rc)
return;

View File

@@ -36,7 +36,7 @@ class BuildConfigurationModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit BuildConfigurationModel(Target *target, QObject *parent = 0);
explicit BuildConfigurationModel(Target *target, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;

View File

@@ -35,10 +35,10 @@
using namespace ProjectExplorer;
BuildEnvironmentWidget::BuildEnvironmentWidget(BuildConfiguration *bc)
: m_buildConfiguration(0)
BuildEnvironmentWidget::BuildEnvironmentWidget(BuildConfiguration *bc) :
m_buildConfiguration(nullptr)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
auto vbox = new QVBoxLayout(this);
vbox->setMargin(0);
m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
m_clearSystemEnvironmentCheckBox->setText(tr("Clear system environment"));

View File

@@ -107,8 +107,8 @@ BuildManagerPrivate::BuildManagerPrivate() :
{
}
static BuildManagerPrivate *d = 0;
static BuildManager *m_instance = 0;
static BuildManagerPrivate *d = nullptr;
static BuildManager *m_instance = nullptr;
BuildManager::BuildManager(QObject *parent, QAction *cancelBuildAction)
: QObject(parent)
@@ -168,7 +168,7 @@ void BuildManager::extensionsInitialized()
BuildManager::~BuildManager()
{
cancel();
m_instance = 0;
m_instance = nullptr;
ExtensionSystem::PluginManager::removeObject(d->m_taskWindow);
delete d->m_taskWindow;
@@ -256,15 +256,15 @@ void BuildManager::clearBuildQueue()
d->m_buildQueue.clear();
d->m_enabledState.clear();
d->m_running = false;
d->m_previousBuildStepProject = 0;
d->m_currentBuildStep = 0;
d->m_previousBuildStepProject = nullptr;
d->m_currentBuildStep = nullptr;
d->m_progressFutureInterface->reportCanceled();
d->m_progressFutureInterface->reportFinished();
d->m_progressWatcher.setFuture(QFuture<void>());
delete d->m_progressFutureInterface;
d->m_progressFutureInterface = 0;
d->m_futureProgress = 0;
d->m_progressFutureInterface = nullptr;
d->m_futureProgress = nullptr;
d->m_maxProgress = 0;
emit m_instance->buildQueueFinished(false);
@@ -464,12 +464,12 @@ void BuildManager::nextStep()
}
} else {
d->m_running = false;
d->m_previousBuildStepProject = 0;
d->m_previousBuildStepProject = nullptr;
d->m_progressFutureInterface->reportFinished();
d->m_progressWatcher.setFuture(QFuture<void>());
d->m_currentBuildStep = 0;
d->m_currentBuildStep = nullptr;
delete d->m_progressFutureInterface;
d->m_progressFutureInterface = 0;
d->m_progressFutureInterface = nullptr;
d->m_maxProgress = 0;
emit m_instance->buildQueueFinished(true);
}

View File

@@ -27,27 +27,27 @@
#include "projectexplorerconstants.h"
#include <coreplugin/coreicons.h>
#include <utils/stylehelper.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QFont>
#include <QLabel>
#include <QHBoxLayout>
#include <QPixmap>
#include <QDebug>
#include <QVBoxLayout>
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation)
: m_contentWidget(new QWidget),
m_errorIcon(new QLabel),
m_warningIcon(new QLabel),
m_errorLabel(new QLabel),
m_warningLabel(new QLabel),
m_taskWindow(taskWindow)
BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation) :
m_contentWidget(new QWidget),
m_errorIcon(new QLabel),
m_warningIcon(new QLabel),
m_errorLabel(new QLabel),
m_warningLabel(new QLabel),
m_taskWindow(taskWindow)
{
QHBoxLayout *contentLayout = new QHBoxLayout;
auto contentLayout = new QHBoxLayout;
contentLayout->setContentsMargins(0, 0, 0, 0);
contentLayout->setSpacing(0);
setLayout(contentLayout);
@@ -60,12 +60,12 @@ BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation
layout->setContentsMargins(8, 2, 0, 2);
layout->setSpacing(2);
m_contentWidget->setLayout(layout);
QHBoxLayout *errorLayout = new QHBoxLayout;
auto errorLayout = new QHBoxLayout;
errorLayout->setSpacing(2);
layout->addLayout(errorLayout);
errorLayout->addWidget(m_errorIcon);
errorLayout->addWidget(m_errorLabel);
QHBoxLayout *warningLayout = new QHBoxLayout;
auto warningLayout = new QHBoxLayout;
warningLayout->setSpacing(2);
layout->addLayout(warningLayout);
warningLayout->addWidget(m_warningIcon);

View File

@@ -61,16 +61,15 @@ BuildSettingsWidget::~BuildSettingsWidget()
}
BuildSettingsWidget::BuildSettingsWidget(Target *target) :
m_target(target),
m_buildConfiguration(0)
m_target(target)
{
Q_ASSERT(m_target);
QVBoxLayout *vbox = new QVBoxLayout(this);
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
if (!IBuildConfigurationFactory::find(m_target)) {
QLabel *noSettingsLabel = new QLabel(this);
auto noSettingsLabel = new QLabel(this);
noSettingsLabel->setText(tr("No build settings available"));
QFont f = noSettingsLabel->font();
f.setPointSizeF(f.pointSizeF() * 1.2);
@@ -80,7 +79,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
}
{ // Edit Build Configuration row
QHBoxLayout *hbox = new QHBoxLayout();
auto hbox = new QHBoxLayout();
hbox->setContentsMargins(0, 0, 0, 0);
hbox->addWidget(new QLabel(tr("Edit build configuration:"), this));
m_buildConfigurationComboBox = new QComboBox(this);
@@ -110,7 +109,7 @@ BuildSettingsWidget::BuildSettingsWidget(Target *target) :
}
m_buildConfiguration = m_target->activeBuildConfiguration();
BuildConfigurationModel *model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model());
auto model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model());
m_buildConfigurationComboBox->setCurrentIndex(model->indexFor(m_buildConfiguration).row());
updateAddButtonMenu();
@@ -135,7 +134,7 @@ void BuildSettingsWidget::addSubWidget(NamedWidget *widget)
{
widget->setContentsMargins(0, 10, 0, 0);
QLabel *label = new QLabel(this);
auto label = new QLabel(this);
label->setText(widget->displayName());
connect(widget, &NamedWidget::displayNameChanged,
label, &QLabel::setText);
@@ -218,7 +217,7 @@ void BuildSettingsWidget::updateBuildSettings()
void BuildSettingsWidget::currentIndexChanged(int index)
{
BuildConfigurationModel *model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model());
auto model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model());
BuildConfiguration *buildConfiguration = model->buildConfigurationAt(index);
SessionManager::setActiveBuildConfiguration(m_target, buildConfiguration, SetActive::Cascade);
}
@@ -230,7 +229,7 @@ void BuildSettingsWidget::updateActiveConfiguration()
m_buildConfiguration = m_target->activeBuildConfiguration();
BuildConfigurationModel *model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model());
auto model = static_cast<BuildConfigurationModel *>(m_buildConfigurationComboBox->model());
m_buildConfigurationComboBox->setCurrentIndex(model->indexFor(m_buildConfiguration).row());
updateBuildSettings();

View File

@@ -69,7 +69,7 @@ private:
QString uniqueName(const QString &name);
Target *m_target;
BuildConfiguration *m_buildConfiguration;
BuildConfiguration *m_buildConfiguration = nullptr;
QPushButton *m_addButton;
QPushButton *m_removeButton;

View File

@@ -89,6 +89,7 @@ signals:
void finished();
void enabledChanged();
private:
bool m_enabled;
};
@@ -98,7 +99,7 @@ class PROJECTEXPLORER_EXPORT IBuildStepFactory : public QObject
Q_OBJECT
public:
explicit IBuildStepFactory(QObject *parent = 0);
explicit IBuildStepFactory(QObject *parent = nullptr);
// used to show the list of possible additons to a target, returns a list of types
virtual QList<Core::Id> availableCreationIds(BuildStepList *parent) const = 0;

View File

@@ -61,8 +61,7 @@ const char STEPS_PREFIX[] = "ProjectExplorer.BuildStepList.Step.";
} // namespace
BuildStepList::BuildStepList(QObject *parent, Core::Id id) :
ProjectConfiguration(parent, id),
m_isNull(false)
ProjectConfiguration(parent, id)
{
Q_ASSERT(parent);
}
@@ -202,10 +201,10 @@ BuildStep *BuildStepList::at(int position)
Target *BuildStepList::target() const
{
Q_ASSERT(parent());
BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(parent());
auto bc = qobject_cast<BuildConfiguration *>(parent());
if (bc)
return bc->target();
DeployConfiguration *dc = qobject_cast<DeployConfiguration *>(parent());
auto dc = qobject_cast<DeployConfiguration *>(parent());
if (dc)
return dc->target();
return 0;

View File

@@ -74,7 +74,7 @@ protected:
private:
QList<BuildStep *> m_steps;
bool m_isNull;
bool m_isNull = false;
};
} // namespace ProjectExplorer

View File

@@ -52,16 +52,16 @@ using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
using namespace Utils;
ToolWidget::ToolWidget(QWidget *parent)
: FadingPanel(parent), m_buildStepEnabled(true), m_targetOpacity(1.0f)
ToolWidget::ToolWidget(QWidget *parent) : FadingPanel(parent),
m_targetOpacity(1.0f)
{
QHBoxLayout *layout = new QHBoxLayout;
auto layout = new QHBoxLayout;
layout->setMargin(4);
layout->setSpacing(4);
setLayout(layout);
m_firstWidget = new FadingWidget(this);
m_firstWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QHBoxLayout *hbox = new QHBoxLayout();
auto hbox = new QHBoxLayout();
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setSpacing(0);
m_firstWidget->setLayout(hbox);
@@ -209,7 +209,7 @@ BuildStepListWidget::~BuildStepListWidget()
void BuildStepListWidget::updateSummary()
{
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(sender());
auto widget = qobject_cast<BuildStepConfigWidget *>(sender());
if (widget) {
foreach (const BuildStepsWidgetData *s, m_buildStepsData) {
if (s->widget == widget) {
@@ -222,7 +222,7 @@ void BuildStepListWidget::updateSummary()
void BuildStepListWidget::updateAdditionalSummary()
{
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(sender());
auto widget = qobject_cast<BuildStepConfigWidget *>(sender());
if (widget) {
foreach (const BuildStepsWidgetData *s, m_buildStepsData) {
if (s->widget == widget) {
@@ -235,7 +235,7 @@ void BuildStepListWidget::updateAdditionalSummary()
void BuildStepListWidget::updateEnabledState()
{
BuildStep *step = qobject_cast<BuildStep *>(sender());
auto step = qobject_cast<BuildStep *>(sender());
if (step) {
foreach (const BuildStepsWidgetData *s, m_buildStepsData) {
if (s->step == step) {
@@ -324,7 +324,7 @@ void BuildStepListWidget::updateAddBuildStepMenu()
void BuildStepListWidget::addBuildStepWidget(int pos, BuildStep *step)
{
// create everything
BuildStepsWidgetData *s = new BuildStepsWidgetData(step);
auto s = new BuildStepsWidgetData(step);
m_buildStepsData.insert(pos, s);
m_vbox->insertWidget(pos, s->detailsWidget);
@@ -412,7 +412,7 @@ void BuildStepListWidget::triggerDisable(int pos)
void BuildStepListWidget::setupUi()
{
if (0 != m_addButton)
if (m_addButton)
return;
m_disableMapper = new QSignalMapper(this);
@@ -436,7 +436,7 @@ void BuildStepListWidget::setupUi()
m_noStepsLabel->setContentsMargins(0, 0, 0, 0);
m_vbox->addWidget(m_noStepsLabel);
QHBoxLayout *hboxLayout = new QHBoxLayout();
auto hboxLayout = new QHBoxLayout();
hboxLayout->setContentsMargins(0, 4, 0, 0);
m_addButton = new QPushButton(this);
m_addButton->setMenu(new QMenu(this));
@@ -479,11 +479,10 @@ void BuildStepListWidget::updateBuildStepButtonsState()
}
BuildStepsPage::BuildStepsPage(BuildConfiguration *bc, Core::Id id) :
NamedWidget(),
m_id(id),
m_widget(new BuildStepListWidget(this))
{
QVBoxLayout *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
layout->addWidget(m_widget);
@@ -495,6 +494,3 @@ BuildStepsPage::BuildStepsPage(BuildConfiguration *bc, Core::Id id) :
if (m_id == Constants::BUILDSTEPS_CLEAN)
setDisplayName(tr("Clean Steps"));
}
BuildStepsPage::~BuildStepsPage()
{ }

View File

@@ -51,7 +51,7 @@ class ToolWidget : public Utils::FadingPanel
{
Q_OBJECT
public:
explicit ToolWidget(QWidget *parent = 0);
explicit ToolWidget(QWidget *parent = nullptr);
void fadeTo(qreal value);
void setOpacity(qreal value);
@@ -75,7 +75,7 @@ private:
QToolButton *m_downButton;
QToolButton *m_removeButton;
bool m_buildStepEnabled;
bool m_buildStepEnabled = true;
Utils::FadingWidget *m_firstWidget;
Utils::FadingWidget *m_secondWidget;
qreal m_targetOpacity;
@@ -98,7 +98,7 @@ class BuildStepListWidget : public NamedWidget
Q_OBJECT
public:
BuildStepListWidget(QWidget *parent = 0);
BuildStepListWidget(QWidget *parent = nullptr);
virtual ~BuildStepListWidget();
void init(BuildStepList *bsl);
@@ -145,11 +145,10 @@ class BuildStepsPage : public NamedWidget
public:
BuildStepsPage(BuildConfiguration *bc, Core::Id id);
virtual ~BuildStepsPage();
private:
Core::Id m_id;
BuildStepListWidget *m_widget;
BuildStepListWidget *m_widget = nullptr;
};
} // Internal

View File

@@ -35,11 +35,6 @@ using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
using Utils::Environment;
CeSdkInfo::CeSdkInfo()
: m_major(0), m_minor(0)
{
}
void CeSdkInfo::addToEnvironment(Environment &env)
{
// qDebug() << "adding " << name() << "to Environment";

View File

@@ -36,36 +36,26 @@ namespace ProjectExplorer {
class PROJECTEXPLORER_EXPORT CeSdkInfo
{
public:
CeSdkInfo();
inline QString name() const;
inline QString binPath() const;
inline QString includePath() const;
inline QString libPath() const;
void addToEnvironment(Utils::Environment &env);
inline bool isValid() const;
inline int majorVersion() const;
inline int minorVersion() const;
inline bool isSupported() const;
QString name() const { return m_name; }
QString binPath() const { return m_bin; }
QString includePath() const { return m_include; }
QString libPath() const { return m_lib; }
void addToEnvironment(Utils::Environment &env);
bool isValid() const { return !m_name.isEmpty() && !m_bin.isEmpty() && !m_include.isEmpty() && !m_lib.isEmpty(); }
int majorVersion() const { return m_major; }
int minorVersion() const { return m_minor; }
bool isSupported() const { return m_major >= 5; }
private:
friend class CeSdkHandler;
QString m_name;
QString m_bin;
QString m_include;
QString m_lib;
int m_major;
int m_minor;
};
friend class CeSdkHandler;
inline QString CeSdkInfo::name() const { return m_name; }
inline QString CeSdkInfo::binPath() const { return m_bin; }
inline QString CeSdkInfo::includePath() const { return m_include; }
inline QString CeSdkInfo::libPath() const { return m_lib; }
inline bool CeSdkInfo::isValid() const { return !m_name.isEmpty() && !m_bin.isEmpty() && !m_include.isEmpty() && !m_lib.isEmpty(); }
inline int CeSdkInfo::majorVersion() const { return m_major; }
inline int CeSdkInfo::minorVersion() const { return m_minor; }
inline bool CeSdkInfo::isSupported() const { return m_major >= 5; }
QString m_name;
QString m_bin;
QString m_include;
QString m_lib;
int m_major = 0;
int m_minor = 0;
};
class PROJECTEXPLORER_EXPORT CeSdkHandler
{
@@ -74,6 +64,7 @@ public:
inline QList<CeSdkInfo> listAll() const;
CeSdkInfo find(const QString &name) const;
static QString platformName(const QString &qtpath);
private:
inline QString fixPaths(QString path) const;
QList<CeSdkInfo> m_list;

View File

@@ -40,7 +40,7 @@ static Task::TaskType taskType(const QString &capture)
}
// opt. drive letter + filename: (2 brackets)
static const char * const FILE_PATTERN = "(<command line>|([A-Za-z]:)?[^:]+\\.[^:]+)";
static const char *const FILE_PATTERN = "(<command line>|([A-Za-z]:)?[^:]+\\.[^:]+)";
ClangParser::ClangParser() :
m_commandRegExp(QLatin1String("^clang(\\+\\+)?: +(fatal +)?(warning|error|note): (.*)$")),

View File

@@ -49,7 +49,7 @@ CodeStyleSettingsWidget::CodeStyleSettingsWidget(Project *project) : QWidget(),
Core::Id languageId = factory->languageId();
ICodeStylePreferences *codeStylePreferences = config->codeStyle(languageId);
CodeStyleEditor *preview = new CodeStyleEditor(factory, codeStylePreferences, m_ui.stackedWidget);
auto preview = new CodeStyleEditor(factory, codeStylePreferences, m_ui.stackedWidget);
preview->clearMargins();
m_ui.stackedWidget->addWidget(preview);
m_ui.languageComboBox->addItem(factory->displayName());

View File

@@ -65,8 +65,7 @@ class CompileOutputTextEdit : public Core::OutputWindow
{
Q_OBJECT
public:
CompileOutputTextEdit(const Core::Context &context)
: Core::OutputWindow(context)
CompileOutputTextEdit(const Core::Context &context) : Core::OutputWindow(context)
{
setWheelZoomEnabled(true);
@@ -182,7 +181,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
connect(m_zoomOutButton, &QToolButton::clicked,
this, [this]() { m_outputWindow->zoomOut(1); });
Aggregation::Aggregate *agg = new Aggregation::Aggregate;
auto agg = new Aggregation::Aggregate;
agg->add(m_outputWindow);
agg->add(new Core::BaseTextFind(m_outputWindow));
@@ -284,9 +283,7 @@ void CompileOutputWindow::clearContents()
}
void CompileOutputWindow::visibilityChanged(bool)
{
}
{ }
int CompileOutputWindow::priorityInStatusBar() const
{
@@ -304,14 +301,10 @@ bool CompileOutputWindow::canPrevious() const
}
void CompileOutputWindow::goToNext()
{
}
{ }
void CompileOutputWindow::goToPrev()
{
}
{ }
bool CompileOutputWindow::canNavigate() const
{

View File

@@ -56,7 +56,7 @@ void ConfigTaskHandler::handle(const Task &task)
QAction *ConfigTaskHandler::createAction(QObject *parent) const
{
QAction *action = new QAction(Core::ICore::msgShowOptionsDialog(), parent);
auto action = new QAction(Core::ICore::msgShowOptionsDialog(), parent);
action->setToolTip(Core::ICore::msgShowOptionsDialogToolTip());
return action;
}

View File

@@ -64,6 +64,5 @@ Core::Id CopyTaskHandler::actionManagerId() const
QAction *CopyTaskHandler::createAction(QObject *parent) const
{
QAction *copyAction = new QAction(parent);
return copyAction;
return new QAction(parent);
}

View File

@@ -36,7 +36,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
CurrentProjectFilter::CurrentProjectFilter() : BaseFileFilter(), m_project(0)
CurrentProjectFilter::CurrentProjectFilter() : BaseFileFilter()
{
setId("Files in current project");
setDisplayName(tr("Files in Current Project"));
@@ -49,7 +49,7 @@ CurrentProjectFilter::CurrentProjectFilter() : BaseFileFilter(), m_project(0)
void CurrentProjectFilter::markFilesAsOutOfDate()
{
setFileIterator(0);
setFileIterator(nullptr);
}
void CurrentProjectFilter::prepareSearch(const QString &entry)

View File

@@ -49,7 +49,7 @@ private:
void currentProjectChanged();
void markFilesAsOutOfDate();
Project *m_project;
Project *m_project = nullptr;
};
} // namespace Internal

View File

@@ -100,7 +100,7 @@ void CurrentProjectFind::handleProjectChanged()
void CurrentProjectFind::recheckEnabled()
{
Core::SearchResult *search = qobject_cast<Core::SearchResult *>(sender());
auto search = qobject_cast<Core::SearchResult *>(sender());
if (!search)
return;
QString projectFile = getAdditionalParameters(search).toString();

View File

@@ -43,7 +43,7 @@ class CustomParserConfigDialog : public QDialog
Q_OBJECT
public:
explicit CustomParserConfigDialog(QDialog *parent = 0);
explicit CustomParserConfigDialog(QDialog *parent = nullptr);
~CustomParserConfigDialog() override;
void setExampleSettings();

View File

@@ -204,7 +204,7 @@ IOutputParser *CustomToolChain::outputParser() const
case Msvc: return new MsvcParser;
#endif
case Custom: return new CustomParser(m_customParserSettings);
default: return 0;
default: return nullptr;
}
}
@@ -352,7 +352,7 @@ bool CustomToolChain::operator ==(const ToolChain &other) const
if (!ToolChain::operator ==(other))
return false;
const CustomToolChain *customTc = static_cast<const CustomToolChain *>(&other);
auto customTc = static_cast<const CustomToolChain *>(&other);
return m_compilerCommand == customTc->m_compilerCommand
&& m_makeCommand == customTc->m_makeCommand
&& m_targetAbi == customTc->m_targetAbi
@@ -428,12 +428,12 @@ bool CustomToolChainFactory::canRestore(const QVariantMap &data)
ToolChain *CustomToolChainFactory::restore(const QVariantMap &data)
{
CustomToolChain *tc = new CustomToolChain(ToolChain::ManualDetection);
auto tc = new CustomToolChain(ToolChain::ManualDetection);
if (tc->fromMap(data))
return tc;
delete tc;
return 0;
return nullptr;
}
// --------------------------------------------------------------------------
@@ -499,8 +499,8 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) :
for (int i = 0; i < CustomToolChain::OutputParserCount; ++i)
m_errorParserComboBox->addItem(CustomToolChain::parserName((CustomToolChain::OutputParser)i));
QWidget *parserLayoutWidget = new QWidget;
QHBoxLayout *parserLayout = new QHBoxLayout(parserLayoutWidget);
auto parserLayoutWidget = new QWidget;
auto parserLayout = new QHBoxLayout(parserLayoutWidget);
parserLayout->setContentsMargins(0, 0, 0, 0);
m_predefinedMacros->setTabChangesFocus(true);
m_predefinedMacros->setToolTip(tr("Each line defines a macro. Format is MACRO[=VALUE]."));
@@ -576,7 +576,7 @@ void CustomToolChainConfigWidget::applyImpl()
if (toolChain()->isAutoDetected())
return;
CustomToolChain *tc = static_cast<CustomToolChain *>(toolChain());
auto tc = static_cast<CustomToolChain *>(toolChain());
Q_ASSERT(tc);
QString displayName = tc->displayName();
tc->setCompilerCommand(m_compilerCommand->fileName());
@@ -595,7 +595,7 @@ void CustomToolChainConfigWidget::setFromToolchain()
{
// subwidgets are not yet connected!
bool blocked = blockSignals(true);
CustomToolChain *tc = static_cast<CustomToolChain *>(toolChain());
auto tc = static_cast<CustomToolChain *>(toolChain());
m_compilerCommand->setFileName(tc->compilerCommand());
m_makeCommand->setFileName(FileName::fromString(tc->makeCommand(Environment())));
m_abiWidget->setAbis(QList<Abi>(), tc->targetAbi());
@@ -610,7 +610,7 @@ void CustomToolChainConfigWidget::setFromToolchain()
bool CustomToolChainConfigWidget::isDirtyImpl() const
{
CustomToolChain *tc = static_cast<CustomToolChain *>(toolChain());
auto tc = static_cast<CustomToolChain *>(toolChain());
Q_ASSERT(tc);
return m_compilerCommand->fileName() != tc->compilerCommand()
|| m_makeCommand->path() != tc->makeCommand(Environment())

View File

@@ -135,10 +135,10 @@ void CustomWizard::setParameters(const CustomWizardParametersPtr &p)
Core::BaseFileWizard *CustomWizard::create(QWidget *parent, const Core::WizardDialogParameters &p) const
{
QTC_ASSERT(!d->m_parameters.isNull(), return 0);
Core::BaseFileWizard *wizard = new Core::BaseFileWizard(this, p.extraValues(), parent);
auto wizard = new Core::BaseFileWizard(this, p.extraValues(), parent);
d->m_context->reset();
CustomWizardPage *customPage = new CustomWizardPage(d->m_context, parameters());
auto customPage = new CustomWizardPage(d->m_context, parameters());
customPage->setPath(p.defaultPath());
if (parameters()->firstPageId >= 0)
wizard->setPage(parameters()->firstPageId, customPage);
@@ -202,7 +202,7 @@ template <class WizardPage>
WizardPage *findWizardPage(const QWizard *w)
{
foreach (int pageId, w->pageIds())
if (WizardPage *wp = qobject_cast<WizardPage *>(w->page(pageId)))
if (auto wp = qobject_cast<WizardPage *>(w->page(pageId)))
return wp;
return 0;
}
@@ -330,7 +330,7 @@ CustomWizard *CustomWizard::createWizard(const CustomProjectWizard::CustomWizard
return p->klass.isEmpty() ? (p->kind == factory->kind()) : (p->klass == factory->klass());
});
CustomWizard *rc = 0;
CustomWizard *rc = nullptr;
if (factory)
rc = factory->create();
@@ -474,7 +474,7 @@ CustomProjectWizard::CustomProjectWizard()
Core::BaseFileWizard *CustomProjectWizard::create(QWidget *parent,
const Core::WizardDialogParameters &parameters) const
{
BaseProjectWizardDialog *projectDialog = new BaseProjectWizardDialog(this, parent, parameters);
auto projectDialog = new BaseProjectWizardDialog(this, parent, parameters);
initProjectWizardDialog(projectDialog,
parameters.defaultPath(),
projectDialog->extensionPages());

View File

@@ -74,7 +74,7 @@ template <class Wizard> class CustomWizardMetaFactory : public ICustomWizardMeta
public:
CustomWizardMetaFactory(const QString &klass, Core::IWizardFactory::WizardKind kind) : ICustomWizardMetaFactory(klass, kind) { }
CustomWizardMetaFactory(Core::IWizardFactory::WizardKind kind) : ICustomWizardMetaFactory(QString(), kind) { }
CustomWizard *create() const { return new Wizard; }
CustomWizard *create() const override { return new Wizard; }
};
// Documentation inside.
@@ -86,7 +86,7 @@ public:
typedef QMap<QString, QString> FieldReplacementMap;
CustomWizard();
~CustomWizard();
~CustomWizard() override;
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
// called.
@@ -130,7 +130,7 @@ class PROJECTEXPLORER_EXPORT CustomProjectWizard : public CustomWizard
public:
CustomProjectWizard();
static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0);
static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = nullptr);
signals:
void projectLocationChanged(const QString &path);

View File

@@ -69,17 +69,17 @@ namespace Internal {
\sa ProjectExplorer::CustomWizard
*/
CustomWizardFieldPage::LineEditData::LineEditData(QLineEdit* le, const QString &defText, const QString &pText) :
CustomWizardFieldPage::LineEditData::LineEditData(QLineEdit *le, const QString &defText, const QString &pText) :
lineEdit(le), defaultText(defText), placeholderText(pText)
{
}
CustomWizardFieldPage::TextEditData::TextEditData(QTextEdit* le, const QString &defText) :
CustomWizardFieldPage::TextEditData::TextEditData(QTextEdit *le, const QString &defText) :
textEdit(le), defaultText(defText)
{
}
CustomWizardFieldPage::PathChooserData::PathChooserData(PathChooser* pe, const QString &defText) :
CustomWizardFieldPage::PathChooserData::PathChooserData(PathChooser *pe, const QString &defText) :
pathChooser(pe), defaultText(defText)
{
}
@@ -93,7 +93,7 @@ CustomWizardFieldPage::CustomWizardFieldPage(const QSharedPointer<CustomWizardCo
m_formLayout(new QFormLayout),
m_errorLabel(new QLabel)
{
QVBoxLayout *vLayout = new QVBoxLayout;
auto vLayout = new QVBoxLayout;
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
if (debug)
qDebug() << Q_FUNC_INFO << parameters->fields.size();
@@ -109,10 +109,6 @@ CustomWizardFieldPage::CustomWizardFieldPage(const QSharedPointer<CustomWizardCo
setTitle(parameters->fieldPageTitle);
}
CustomWizardFieldPage::~CustomWizardFieldPage()
{
}
void CustomWizardFieldPage::addRow(const QString &name, QWidget *w)
{
m_formLayout->addRow(name, w);
@@ -144,7 +140,7 @@ void CustomWizardFieldPage::addField(const CustomWizardField &field)\
bool spansRow = false;
// Check known classes: QComboBox
const QString className = field.controlAttributes.value(QLatin1String("class"));
QWidget *fieldWidget = 0;
QWidget *fieldWidget = nullptr;
if (className == QLatin1String("QComboBox")) {
fieldWidget = registerComboBox(fieldName, field);
} else if (className == QLatin1String("QTextEdit")) {
@@ -196,7 +192,7 @@ static void comboChoices(const CustomWizardField::ControlAttributeMap &controlAt
QWidget *CustomWizardFieldPage::registerComboBox(const QString &fieldName,
const CustomWizardField &field)
{
TextFieldComboBox *combo = new TextFieldComboBox;
auto combo = new TextFieldComboBox;
do { // Set up items and current index
QStringList values;
QStringList displayTexts;
@@ -220,7 +216,7 @@ QWidget *CustomWizardFieldPage::registerComboBox(const QString &fieldName,
QWidget *CustomWizardFieldPage::registerTextEdit(const QString &fieldName,
const CustomWizardField &field)
{
QTextEdit *textEdit = new QTextEdit;
auto textEdit = new QTextEdit;
// Suppress formatting by default (inverting QTextEdit's default value) when
// pasting from Bug tracker, etc.
const bool acceptRichText = field.controlAttributes.value(QLatin1String("acceptRichText")) == QLatin1String("true");
@@ -236,7 +232,7 @@ QWidget *CustomWizardFieldPage::registerTextEdit(const QString &fieldName,
QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName,
const CustomWizardField &field)
{
PathChooser *pathChooser = new PathChooser;
auto pathChooser = new PathChooser;
const QString expectedKind = field.controlAttributes.value(QLatin1String("expectedkind")).toLower();
if (expectedKind == QLatin1String("existingdirectory"))
pathChooser->setExpectedKind(PathChooser::ExistingDirectory);
@@ -266,7 +262,7 @@ QWidget *CustomWizardFieldPage::registerCheckBox(const QString &fieldName,
{
typedef CustomWizardField::ControlAttributeMap::const_iterator AttributeMapConstIt;
TextFieldCheckBox *checkBox = new TextFieldCheckBox(fieldDescription);
auto checkBox = new TextFieldCheckBox(fieldDescription);
const bool defaultValue = field.controlAttributes.value(QLatin1String("defaultvalue")) == QLatin1String("true");
checkBox->setChecked(defaultValue);
const AttributeMapConstIt trueTextIt = field.controlAttributes.constFind(QLatin1String("truevalue"));
@@ -284,7 +280,7 @@ QWidget *CustomWizardFieldPage::registerCheckBox(const QString &fieldName,
QWidget *CustomWizardFieldPage::registerLineEdit(const QString &fieldName,
const CustomWizardField &field)
{
QLineEdit *lineEdit = new QLineEdit;
auto lineEdit = new QLineEdit;
const QString validationRegExp = field.controlAttributes.value(QLatin1String("validator"));
if (!validationRegExp.isEmpty()) {

View File

@@ -54,12 +54,11 @@ public:
explicit CustomWizardFieldPage(const QSharedPointer<CustomWizardContext> &ctx,
const QSharedPointer<CustomWizardParameters> &parameters,
QWidget *parent = 0);
virtual ~CustomWizardFieldPage();
QWidget *parent = nullptr);
virtual bool validatePage();
virtual void initializePage();
virtual void cleanupPage();
bool validatePage() override;
void initializePage() override;
void cleanupPage() override;
static QMap<QString, QString> replacementMap(const QWizard *w,
const QSharedPointer<CustomWizardContext> &ctx,
@@ -72,23 +71,23 @@ protected:
private:
class LineEditData {
public:
explicit LineEditData(QLineEdit* le = 0, const QString &defText = QString(), const QString &pText = QString());
QLineEdit* lineEdit;
explicit LineEditData(QLineEdit *le = nullptr, const QString &defText = QString(), const QString &pText = QString());
QLineEdit *lineEdit;
QString defaultText;
QString placeholderText;
QString userChange;
};
class TextEditData {
public:
explicit TextEditData(QTextEdit* le = 0, const QString &defText = QString());
QTextEdit* textEdit;
explicit TextEditData(QTextEdit *le = nullptr, const QString &defText = QString());
QTextEdit *textEdit;
QString defaultText;
QString userChange;
};
class PathChooserData {
public:
explicit PathChooserData(Utils::PathChooser* pe = 0, const QString &defText = QString());
Utils::PathChooser* pathChooser;
explicit PathChooserData(Utils::PathChooser *pe = nullptr, const QString &defText = QString());
Utils::PathChooser *pathChooser;
QString defaultText;
QString userChange;
};
@@ -121,12 +120,12 @@ class CustomWizardPage : public CustomWizardFieldPage {
public:
explicit CustomWizardPage(const QSharedPointer<CustomWizardContext> &ctx,
const QSharedPointer<CustomWizardParameters> &parameters,
QWidget *parent = 0);
QWidget *parent = nullptr);
QString path() const;
void setPath(const QString &path);
virtual bool isComplete() const;
bool isComplete() const override;
private:
Utils::PathChooser *m_pathChooser;

View File

@@ -105,7 +105,7 @@ bool DependenciesModel::setData(const QModelIndex &index, const QVariant &value,
{
if (role == Qt::CheckStateRole) {
Project *p = m_projects.at(index.row());
const Qt::CheckState c = static_cast<Qt::CheckState>(value.toInt());
auto c = static_cast<const Qt::CheckState>(value.toInt());
if (c == Qt::Checked) {
if (SessionManager::addDependency(m_project, p)) {
@@ -206,22 +206,21 @@ void DependenciesView::updateSizeHint()
// DependenciesWidget
//
DependenciesWidget::DependenciesWidget(Project *project, QWidget *parent)
: QWidget(parent)
, m_project(project)
, m_model(new DependenciesModel(project, this))
DependenciesWidget::DependenciesWidget(Project *project, QWidget *parent) : QWidget(parent),
m_project(project),
m_model(new DependenciesModel(project, this))
{
QVBoxLayout *vbox = new QVBoxLayout(this);
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
m_detailsContainer = new Utils::DetailsWidget(this);
m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);
vbox->addWidget(m_detailsContainer);
QWidget *detailsWidget = new QWidget(m_detailsContainer);
auto detailsWidget = new QWidget(m_detailsContainer);
m_detailsContainer->setWidget(detailsWidget);
QGridLayout *layout = new QGridLayout(detailsWidget);
auto layout = new QGridLayout(detailsWidget);
layout->setContentsMargins(0, -1, 0, -1);
DependenciesView *treeView = new DependenciesView(this);
auto treeView = new DependenciesView(this);
treeView->setModel(m_model);
treeView->setHeaderHidden(true);
layout->addWidget(treeView, 0 ,0);

View File

@@ -50,7 +50,7 @@ class DependenciesModel : public QAbstractListModel
Q_OBJECT
public:
explicit DependenciesModel(Project *project, QObject *parent = 0);
explicit DependenciesModel(Project *project, QObject *parent = nullptr);
int rowCount(const QModelIndex &index) const override;
int columnCount(const QModelIndex &index) const override;

View File

@@ -33,20 +33,13 @@ using namespace Utils;
namespace ProjectExplorer {
DeployableFile::DeployableFile()
: m_type(TypeNormal)
{
}
DeployableFile::DeployableFile(const QString &localFilePath, const QString &remoteDir, Type type)
: m_localFilePath(FileName::fromUserInput(localFilePath)), m_remoteDir(remoteDir), m_type(type)
{
}
{ }
DeployableFile::DeployableFile(const FileName &localFilePath, const QString &remoteDir, Type type)
: m_localFilePath(localFilePath), m_remoteDir(remoteDir), m_type(type)
{
}
{ }
QString DeployableFile::remoteFilePath() const
{

View File

@@ -42,7 +42,7 @@ public:
TypeExecutable
};
DeployableFile();
DeployableFile() = default;
DeployableFile(const QString &m_localFilePath, const QString &m_remoteDir,
Type type = TypeNormal);
DeployableFile(const Utils::FileName &localFilePath, const QString &remoteDir,
@@ -59,7 +59,7 @@ public:
private:
Utils::FileName m_localFilePath;
QString m_remoteDir;
Type m_type;
Type m_type = TypeNormal;
};

View File

@@ -40,8 +40,7 @@ const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildSt
const char BUILD_STEP_LIST_PREFIX[] = "ProjectExplorer.BuildConfiguration.BuildStepList.";
DeployConfiguration::DeployConfiguration(Target *target, Core::Id id) :
ProjectConfiguration(target, id),
m_stepList(0)
ProjectConfiguration(target, id)
{
Q_ASSERT(target);
m_stepList = new BuildStepList(this, Core::Id(Constants::BUILDSTEPS_DEPLOY));
@@ -53,8 +52,7 @@ DeployConfiguration::DeployConfiguration(Target *target, Core::Id id) :
}
DeployConfiguration::DeployConfiguration(Target *target, DeployConfiguration *source) :
ProjectConfiguration(target, source),
m_stepList(0)
ProjectConfiguration(target, source)
{
Q_ASSERT(target);
// Do not clone stepLists here, do that in the derived constructor instead
@@ -94,7 +92,7 @@ QVariantMap DeployConfiguration::toMap() const
NamedWidget *DeployConfiguration::createConfigWidget()
{
return 0;
return nullptr;
}
bool DeployConfiguration::isEnabled() const
@@ -227,7 +225,7 @@ bool DefaultDeployConfigurationFactory::canCreate(Target *parent, Core::Id id) c
DeployConfiguration *DefaultDeployConfigurationFactory::create(Target *parent, Core::Id id)
{
if (!canCreate(parent, id))
return 0;
return nullptr;
return new DefaultDeployConfiguration(parent, id);
}
@@ -239,11 +237,11 @@ bool DefaultDeployConfigurationFactory::canRestore(Target *parent, const QVarian
DeployConfiguration *DefaultDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map)
{
if (!canRestore(parent, map))
return 0;
DefaultDeployConfiguration *dc = new DefaultDeployConfiguration(parent, idFromMap(map));
return nullptr;
auto dc = new DefaultDeployConfiguration(parent, idFromMap(map));
if (!dc->fromMap(map)) {
delete dc;
return 0;
return nullptr;
}
return dc;
}
@@ -256,7 +254,7 @@ bool DefaultDeployConfigurationFactory::canClone(Target *parent, DeployConfigura
DeployConfiguration *DefaultDeployConfigurationFactory::clone(Target *parent, DeployConfiguration *product)
{
if (!canClone(parent, product))
return 0;
return nullptr;
return new DefaultDeployConfiguration(parent, product);
}

View File

@@ -72,7 +72,7 @@ protected:
private:
void ctor();
BuildStepList *m_stepList;
BuildStepList *m_stepList = nullptr;
};
class PROJECTEXPLORER_EXPORT DefaultDeployConfiguration : public DeployConfiguration
@@ -90,7 +90,7 @@ class PROJECTEXPLORER_EXPORT DeployConfigurationFactory : public QObject
Q_OBJECT
public:
explicit DeployConfigurationFactory(QObject *parent = 0);
explicit DeployConfigurationFactory(QObject *parent = nullptr);
// used to show the list of possible additons to a target, returns a list of types
virtual QList<Core::Id> availableCreationIds(Target *parent) const = 0;

View File

@@ -50,9 +50,9 @@ public:
}
};
DeployConfigurationModel::DeployConfigurationModel(Target *target, QObject *parent)
: QAbstractListModel(parent),
m_target(target)
DeployConfigurationModel::DeployConfigurationModel(Target *target, QObject *parent) :
QAbstractListModel(parent),
m_target(target)
{
m_deployConfigurations = m_target->deployConfigurations();
Utils::sort(m_deployConfigurations, DeployConfigurationComparer());
@@ -62,9 +62,10 @@ DeployConfigurationModel::DeployConfigurationModel(Target *target, QObject *pare
connect(target, &Target::removedDeployConfiguration,
this, &DeployConfigurationModel::removedDeployConfiguration);
foreach (DeployConfiguration *dc, m_deployConfigurations)
foreach (DeployConfiguration *dc, m_deployConfigurations) {
connect(dc, &ProjectConfiguration::displayNameChanged,
this, &DeployConfigurationModel::displayNameChanged);
}
}
int DeployConfigurationModel::rowCount(const QModelIndex &parent) const
@@ -79,7 +80,7 @@ int DeployConfigurationModel::columnCount(const QModelIndex &parent) const
void DeployConfigurationModel::displayNameChanged()
{
DeployConfiguration *dc = qobject_cast<DeployConfiguration *>(sender());
auto dc = qobject_cast<DeployConfiguration *>(sender());
if (!dc)
return;
@@ -135,14 +136,14 @@ QVariant DeployConfigurationModel::data(const QModelIndex &index, int role) cons
DeployConfiguration *DeployConfigurationModel::deployConfigurationAt(int i)
{
if (i > m_deployConfigurations.size() || i < 0)
return 0;
return nullptr;
return m_deployConfigurations.at(i);
}
DeployConfiguration *DeployConfigurationModel::deployConfigurationFor(const QModelIndex &idx)
{
if (idx.row() > m_deployConfigurations.size() || idx.row() < 0)
return 0;
return nullptr;
return m_deployConfigurations.at(idx.row());
}

View File

@@ -37,7 +37,7 @@ class DeployConfigurationModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit DeployConfigurationModel(Target *target, QObject *parent = 0);
explicit DeployConfigurationModel(Target *target, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;

View File

@@ -27,10 +27,8 @@
namespace ProjectExplorer {
DeploymentDataModel::DeploymentDataModel(QObject *parent)
: QAbstractTableModel(parent)
{
}
DeploymentDataModel::DeploymentDataModel(QObject *parent) : QAbstractTableModel(parent)
{ }
void DeploymentDataModel::setDeploymentData(const DeploymentData &deploymentData)
{

View File

@@ -36,7 +36,7 @@ class PROJECTEXPLORER_EXPORT DeploymentDataModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit DeploymentDataModel(QObject *parent = 0);
explicit DeploymentDataModel(QObject *parent = nullptr);
void setDeploymentData(const DeploymentData &deploymentData);

View File

@@ -44,8 +44,8 @@ public:
using namespace Internal;
DeploymentDataView::DeploymentDataView(Target *target, QWidget *parent) :
NamedWidget(parent), d(new DeploymentDataViewPrivate)
DeploymentDataView::DeploymentDataView(Target *target, QWidget *parent) : NamedWidget(parent),
d(new DeploymentDataViewPrivate)
{
d->ui.setupUi(this);
d->ui.deploymentDataView->setTextElideMode(Qt::ElideMiddle);

View File

@@ -38,7 +38,7 @@ class PROJECTEXPLORER_EXPORT DeploymentDataView : public NamedWidget
Q_OBJECT
public:
explicit DeploymentDataView(Target *target, QWidget *parent = 0);
explicit DeploymentDataView(Target *target, QWidget *parent = nullptr);
~DeploymentDataView() override;
private:

View File

@@ -27,6 +27,7 @@
#include "ui_doubletabwidget.h"
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
#include <utils/stylehelper.h>
#include <utils/theme/theme.h>
@@ -37,8 +38,6 @@
#include <QMenu>
#include <QToolTip>
#include <QDebug>
using namespace ProjectExplorer::Internal;
using namespace Utils;
@@ -96,9 +95,7 @@ static void drawSecondLevelSeparator(QPainter *painter, QPoint top, QPoint botto
DoubleTabWidget::DoubleTabWidget(QWidget *parent) :
QWidget(parent),
m_selection(StyleHelper::dpiSpecificImageFile(QLatin1String(":/projectexplorer/images/selection.png"))),
ui(new Ui::DoubleTabWidget),
m_currentIndex(-1),
m_lastVisibleIndex(-1)
ui(new Ui::DoubleTabWidget)
{
ui->setupUi(this);
}
@@ -170,7 +167,7 @@ QSize DoubleTabWidget::minimumSizeHint() const
void DoubleTabWidget::updateNameIsUniqueAdd(Tab *tab)
{
tab->nameIsUnique = true;
for (int i=0; i < m_tabs.size(); ++i) {
for (int i = 0; i < m_tabs.size(); ++i) {
if (m_tabs.at(i).name == tab->name) {
m_tabs[i].nameIsUnique = false;
tab->nameIsUnique = false;
@@ -183,15 +180,16 @@ void DoubleTabWidget::updateNameIsUniqueRemove(const Tab &tab)
{
if (tab.nameIsUnique)
return;
int index;
int index = -1;
int count = 0;
for (int i=0; i < m_tabs.size(); ++i) {
for (int i = 0; i < m_tabs.size(); ++i) {
if (m_tabs.at(i).name == tab.name) {
++count;
index = i;
}
}
QTC_ASSERT(index >= 0, return);
if (count == 1)
m_tabs[index].nameIsUnique = true;
}
@@ -544,7 +542,7 @@ void DoubleTabWidget::paintEvent(QPaintEvent *event)
bool DoubleTabWidget::event(QEvent *event)
{
if (event->type() == QEvent::ToolTip) {
QHelpEvent *helpevent = static_cast<QHelpEvent*>(event);
auto helpevent = static_cast<QHelpEvent*>(event);
QPair<HitArea, int> hit = convertPosToTab(helpevent->pos());
if (hit.first == HITTAB && m_tabs.at(m_currentTabIndices.at(hit.second)).nameIsUnique) {
const QString &fileName = m_tabs.at(m_currentTabIndices.at(hit.second)).fullName;

View File

@@ -38,7 +38,7 @@ class DoubleTabWidget : public QWidget
{
Q_OBJECT
public:
explicit DoubleTabWidget(QWidget *parent = 0);
explicit DoubleTabWidget(QWidget *parent = nullptr);
~DoubleTabWidget() override;
void setTitle(const QString &title);
@@ -68,7 +68,8 @@ protected:
QSize minimumSizeHint() const override;
private:
struct Tab {
class Tab {
public:
QString name;
QString fullName;
bool nameIsUnique;
@@ -86,12 +87,11 @@ private:
Ui::DoubleTabWidget *ui;
QString m_title;
QList<Tab> m_tabs;
int m_currentIndex;
int m_currentIndex = -1;
int m_lastVisibleIndex = -1;
QVector<int> m_currentTabIndices;
int m_lastVisibleIndex;
};
} // namespace Internal

View File

@@ -62,21 +62,19 @@ namespace ProjectExplorer {
struct EditorConfigurationPrivate
{
EditorConfigurationPrivate()
: m_useGlobal(true)
, m_typingSettings(TextEditorSettings::typingSettings())
, m_storageSettings(TextEditorSettings::storageSettings())
, m_behaviorSettings(TextEditorSettings::behaviorSettings())
, m_extraEncodingSettings(TextEditorSettings::extraEncodingSettings())
, m_textCodec(Core::EditorManager::defaultTextCodec())
{
}
EditorConfigurationPrivate() :
m_typingSettings(TextEditorSettings::typingSettings()),
m_storageSettings(TextEditorSettings::storageSettings()),
m_behaviorSettings(TextEditorSettings::behaviorSettings()),
m_extraEncodingSettings(TextEditorSettings::extraEncodingSettings()),
m_textCodec(Core::EditorManager::defaultTextCodec())
{ }
bool m_useGlobal;
ICodeStylePreferences *m_defaultCodeStyle;
ICodeStylePreferences *m_defaultCodeStyle = nullptr;
TypingSettings m_typingSettings;
StorageSettings m_storageSettings;
BehaviorSettings m_behaviorSettings;
bool m_useGlobal = true;
ExtraEncodingSettings m_extraEncodingSettings;
MarginSettings m_marginSettings;
QTextCodec *m_textCodec;
@@ -277,7 +275,7 @@ void EditorConfiguration::setUseGlobalSettings(bool use)
d->m_useGlobal = use;
d->m_defaultCodeStyle->setCurrentDelegate(use ? TextEditorSettings::codeStyle() : 0);
foreach (Core::IEditor *editor, Core::DocumentModel::editorsForOpenedDocuments()) {
if (TextEditorWidget *widget = qobject_cast<TextEditorWidget *>(editor->widget())) {
if (auto widget = qobject_cast<TextEditorWidget *>(editor->widget())) {
Project *project = SessionManager::projectForFile(editor->document()->filePath());
if (project && project->editorConfiguration() == this)
switchSettings(widget);

View File

@@ -39,8 +39,8 @@ namespace ProjectExplorer {
// EnvironmentAspect:
// --------------------------------------------------------------------
EnvironmentAspect::EnvironmentAspect(RunConfiguration *runConfig)
: IRunConfigurationAspect(runConfig), m_base(-1)
EnvironmentAspect::EnvironmentAspect(RunConfiguration *runConfig) :
IRunConfigurationAspect(runConfig), m_base(-1)
{
setDisplayName(tr("Run Environment"));
setId("EnvironmentAspect");

View File

@@ -50,13 +50,13 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid
QTC_CHECK(m_aspect);
setContentsMargins(0, 0, 0, 0);
QVBoxLayout *topLayout = new QVBoxLayout(this);
auto topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
QWidget *baseEnvironmentWidget = new QWidget;
QHBoxLayout *baseLayout = new QHBoxLayout(baseEnvironmentWidget);
auto baseEnvironmentWidget = new QWidget;
auto baseLayout = new QHBoxLayout(baseEnvironmentWidget);
baseLayout->setMargin(0);
QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this);
auto label = new QLabel(tr("Base environment for this run configuration:"), this);
baseLayout->addWidget(label);
m_baseEnvironmentComboBox = new QComboBox;
QList<int> bases = m_aspect->possibleBaseEnvironments();

View File

@@ -67,7 +67,7 @@ EnvironmentItemsWidget::EnvironmentItemsWidget(QWidget *parent) :
QWidget(parent), d(new EnvironmentItemsWidgetPrivate)
{
d->m_editor = new TextEditor::SnippetEditorWidget(this);
QVBoxLayout *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->addWidget(d->m_editor);
}
@@ -104,11 +104,10 @@ EnvironmentItemsDialog::EnvironmentItemsDialog(QWidget *parent) :
{
resize(640, 480);
d->m_editor = new EnvironmentItemsWidget(this);
QDialogButtonBox *box = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
auto box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
connect(box, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(box, &QDialogButtonBox::rejected, this, &QDialog::reject);
QVBoxLayout *layout = new QVBoxLayout(this);
auto layout = new QVBoxLayout(this);
layout->addWidget(d->m_editor);
layout->addWidget(box);
setWindowTitle(tr("Edit Environment"));

View File

@@ -36,7 +36,7 @@ class EnvironmentItemsWidget : public QWidget
{
Q_OBJECT
public:
explicit EnvironmentItemsWidget(QWidget *parent = 0);
explicit EnvironmentItemsWidget(QWidget *parent = nullptr);
~EnvironmentItemsWidget() override;
void setEnvironmentItems(const QList<Utils::EnvironmentItem> &items);
@@ -53,14 +53,15 @@ class EnvironmentItemsDialog : public QDialog
{
Q_OBJECT
public:
explicit EnvironmentItemsDialog(QWidget *parent = 0);
explicit EnvironmentItemsDialog(QWidget *parent = nullptr);
~EnvironmentItemsDialog() override;
void setEnvironmentItems(const QList<Utils::EnvironmentItem> &items);
QList<Utils::EnvironmentItem> environmentItems() const;
static QList<Utils::EnvironmentItem>
getEnvironmentItems(QWidget *parent, const QList<Utils::EnvironmentItem> &initial, bool *ok = 0);
getEnvironmentItems(QWidget *parent, const QList<Utils::EnvironmentItem> &initial,
bool *ok = nullptr);
private:
EnvironmentItemsDialogPrivate *d;

View File

@@ -50,10 +50,9 @@ class EnvironmentValidator : public QValidator
{
Q_OBJECT
public:
EnvironmentValidator(QWidget *parent, Utils::EnvironmentModel *model,
QTreeView *view,
const QModelIndex &index)
: QValidator(parent), m_model(model), m_view(view), m_index(index)
EnvironmentValidator(QWidget *parent, Utils::EnvironmentModel *model, QTreeView *view,
const QModelIndex &index) :
QValidator(parent), m_model(model), m_view(view), m_index(index)
{
m_hideTipTimer.setInterval(2000);
m_hideTipTimer.setSingleShot(true);
@@ -103,7 +102,7 @@ public:
if (index.column() != 0)
return w;
if (QLineEdit *edit = qobject_cast<QLineEdit *>(w))
if (auto edit = qobject_cast<QLineEdit *>(w))
edit->setValidator(new EnvironmentValidator(edit, m_model, m_view, index));
return w;
}
@@ -144,22 +143,22 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
connect(d->m_model, &Utils::EnvironmentModel::focusIndex,
this, &EnvironmentWidget::focusIndex);
QVBoxLayout *vbox = new QVBoxLayout(this);
auto vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
d->m_detailsContainer = new Utils::DetailsWidget(this);
QWidget *details = new QWidget(d->m_detailsContainer);
auto details = new QWidget(d->m_detailsContainer);
d->m_detailsContainer->setWidget(details);
details->setVisible(false);
QVBoxLayout *vbox2 = new QVBoxLayout(details);
auto vbox2 = new QVBoxLayout(details);
vbox2->setMargin(0);
if (additionalDetailsWidget)
vbox2->addWidget(additionalDetailsWidget);
QHBoxLayout *horizontalLayout = new QHBoxLayout();
auto horizontalLayout = new QHBoxLayout();
horizontalLayout->setMargin(0);
auto tree = new Utils::TreeView(this);
connect(tree, &QAbstractItemView::activated,
@@ -178,7 +177,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
findWrapper->setFrameStyle(QFrame::StyledPanel);
horizontalLayout->addWidget(findWrapper);
QVBoxLayout *buttonLayout = new QVBoxLayout();
auto buttonLayout = new QVBoxLayout();
d->m_editButton = new QPushButton(this);
d->m_editButton->setText(tr("&Edit"));
@@ -235,7 +234,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
EnvironmentWidget::~EnvironmentWidget()
{
delete d->m_model;
d->m_model = 0;
d->m_model = nullptr;
delete d;
}

View File

@@ -45,7 +45,7 @@ class PROJECTEXPLORER_EXPORT EnvironmentWidget : public QWidget
Q_OBJECT
public:
explicit EnvironmentWidget(QWidget *parent, QWidget *additionalDetailsWidget = 0);
explicit EnvironmentWidget(QWidget *parent, QWidget *additionalDetailsWidget = nullptr);
~EnvironmentWidget() override;
void setBaseEnvironmentText(const QString &text);

View File

@@ -28,9 +28,9 @@
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
ExpandData::ExpandData(const QString &path_, const QString &displayName_)
: path(path_), displayName(displayName_)
{}
ExpandData::ExpandData(const QString &path_, const QString &displayName_) :
path(path_), displayName(displayName_)
{ }
bool ExpandData::operator==(const ExpandData &other) const
{

View File

@@ -317,8 +317,7 @@ void ExtraCompilerPrivate::updateIssues()
if (!lastEditor)
return;
TextEditor::TextEditorWidget *widget =
qobject_cast<TextEditor::TextEditorWidget *>(lastEditor->widget());
auto widget = qobject_cast<TextEditor::TextEditorWidget *>(lastEditor->widget());
if (!widget)
return;

View File

@@ -69,15 +69,14 @@ class DotRemovalFilter : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit DotRemovalFilter(QObject *parent = 0);
explicit DotRemovalFilter(QObject *parent = nullptr);
protected:
virtual bool filterAcceptsRow(int source_row, const QModelIndex &parent) const;
Qt::DropActions supportedDragActions() const;
};
DotRemovalFilter::DotRemovalFilter(QObject *parent) : QSortFilterProxyModel(parent)
{
}
{ }
bool DotRemovalFilter::filterAcceptsRow(int source_row, const QModelIndex &parent) const
{
@@ -97,15 +96,13 @@ Qt::DropActions DotRemovalFilter::supportedDragActions() const
class FolderNavigationModel : public QFileSystemModel
{
public:
explicit FolderNavigationModel(QObject *parent = 0);
explicit FolderNavigationModel(QObject *parent = nullptr);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
Qt::DropActions supportedDragActions() const;
};
FolderNavigationModel::FolderNavigationModel(QObject *parent) :
QFileSystemModel(parent)
{
}
FolderNavigationModel::FolderNavigationModel(QObject *parent) : QFileSystemModel(parent)
{ }
QVariant FolderNavigationModel::data(const QModelIndex &index, int role) const
{
@@ -125,15 +122,13 @@ Qt::DropActions FolderNavigationModel::supportedDragActions() const
Shows a file system folder
*/
FolderNavigationWidget::FolderNavigationWidget(QWidget *parent)
: QWidget(parent),
m_listView(new Utils::ListView(this)),
m_fileSystemModel(new FolderNavigationModel(this)),
m_filterHiddenFilesAction(new QAction(tr("Show Hidden Files"), this)),
m_filterModel(new DotRemovalFilter(this)),
m_title(new Utils::ElidingLabel(this)),
m_autoSync(false),
m_toggleSync(new QToolButton(this))
FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent),
m_listView(new Utils::ListView(this)),
m_fileSystemModel(new FolderNavigationModel(this)),
m_filterHiddenFilesAction(new QAction(tr("Show Hidden Files"), this)),
m_filterModel(new DotRemovalFilter(this)),
m_title(new Utils::ElidingLabel(this)),
m_toggleSync(new QToolButton(this))
{
m_fileSystemModel->setResolveSymlinks(false);
m_fileSystemModel->setIconProvider(Core::FileIconProvider::iconProvider());
@@ -154,7 +149,7 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent)
m_listView->setDragDropMode(QAbstractItemView::DragOnly);
setFocusProxy(m_listView);
QVBoxLayout *layout = new QVBoxLayout();
auto layout = new QVBoxLayout();
layout->addWidget(m_title);
layout->addWidget(m_listView);
m_title->setMargin(5);
@@ -424,14 +419,14 @@ FolderNavigationWidgetFactory::FolderNavigationWidgetFactory()
Core::NavigationView FolderNavigationWidgetFactory::createWidget()
{
Core::NavigationView n;
FolderNavigationWidget *fnw = new FolderNavigationWidget;
auto fnw = new FolderNavigationWidget;
n.widget = fnw;
QToolButton *filter = new QToolButton;
auto filter = new QToolButton;
filter->setIcon(Core::Icons::FILTER.icon());
filter->setToolTip(tr("Filter Files"));
filter->setPopupMode(QToolButton::InstantPopup);
filter->setProperty("noArrow", true);
QMenu *filterMenu = new QMenu(filter);
auto filterMenu = new QMenu(filter);
filterMenu->addAction(fnw->m_filterHiddenFilesAction);
filter->setMenu(filterMenu);
n.dockToolBarWidgets << filter << fnw->m_toggleSync;
@@ -440,7 +435,7 @@ Core::NavigationView FolderNavigationWidgetFactory::createWidget()
void FolderNavigationWidgetFactory::saveSettings(int position, QWidget *widget)
{
FolderNavigationWidget *fnw = qobject_cast<FolderNavigationWidget *>(widget);
auto fnw = qobject_cast<FolderNavigationWidget *>(widget);
QTC_ASSERT(fnw, return);
QSettings *settings = Core::ICore::settings();
const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position);
@@ -450,7 +445,7 @@ void FolderNavigationWidgetFactory::saveSettings(int position, QWidget *widget)
void FolderNavigationWidgetFactory::restoreSettings(int position, QWidget *widget)
{
FolderNavigationWidget *fnw = qobject_cast<FolderNavigationWidget *>(widget);
auto fnw = qobject_cast<FolderNavigationWidget *>(widget);
QTC_ASSERT(fnw, return);
QSettings *settings = Core::ICore::settings();
const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position);

View File

@@ -48,7 +48,7 @@ class FolderNavigationWidget : public QWidget
Q_OBJECT
Q_PROPERTY(bool autoSynchronization READ autoSynchronization WRITE setAutoSynchronization)
public:
explicit FolderNavigationWidget(QWidget *parent = 0);
explicit FolderNavigationWidget(QWidget *parent = nullptr);
static QStringList projectFilesInDirectory(const QString &path);
@@ -80,8 +80,9 @@ private:
QAction *m_filterHiddenFilesAction;
QSortFilterProxyModel *m_filterModel;
QLabel *m_title;
bool m_autoSync;
bool m_autoSync = false;
QToolButton *m_toggleSync;
// FolderNavigationWidgetFactory needs private members to build a menu
friend class FolderNavigationWidgetFactory;
};
@@ -89,6 +90,7 @@ private:
class FolderNavigationWidgetFactory : public Core::INavigationWidgetFactory
{
Q_OBJECT
public:
FolderNavigationWidgetFactory();

View File

@@ -734,7 +734,7 @@ bool GccToolChain::operator ==(const ToolChain &other) const
if (!ToolChain::operator ==(other))
return false;
const GccToolChain *gccTc = static_cast<const GccToolChain *>(&other);
auto gccTc = static_cast<const GccToolChain *>(&other);
return m_compilerCommand == gccTc->m_compilerCommand && m_targetAbi == gccTc->m_targetAbi
&& m_platformCodeGenFlags == gccTc->m_platformCodeGenFlags
&& m_platformLinkerFlags == gccTc->m_platformLinkerFlags;
@@ -817,7 +817,7 @@ ToolChain *GccToolChainFactory::restore(const QVariantMap &data)
return tc;
delete tc;
return 0;
return nullptr;
}
GccToolChain *GccToolChainFactory::createToolChain(bool autoDetect)
@@ -883,8 +883,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp
GccToolChainConfigWidget::GccToolChainConfigWidget(GccToolChain *tc) :
ToolChainConfigWidget(tc),
m_compilerCommand(new PathChooser),
m_abiWidget(new AbiWidget),
m_isReadOnly(false)
m_abiWidget(new AbiWidget)
{
Q_ASSERT(tc);
@@ -920,7 +919,7 @@ void GccToolChainConfigWidget::applyImpl()
if (toolChain()->isAutoDetected())
return;
GccToolChain *tc = static_cast<GccToolChain *>(toolChain());
auto tc = static_cast<GccToolChain *>(toolChain());
Q_ASSERT(tc);
QString displayName = tc->displayName();
tc->setCompilerCommand(m_compilerCommand->fileName());
@@ -937,7 +936,7 @@ void GccToolChainConfigWidget::setFromToolchain()
{
// subwidgets are not yet connected!
bool blocked = blockSignals(true);
GccToolChain *tc = static_cast<GccToolChain *>(toolChain());
auto tc = static_cast<GccToolChain *>(toolChain());
m_compilerCommand->setFileName(tc->compilerCommand());
m_platformCodeGenFlagsLineEdit->setText(QtcProcess::joinArgs(tc->platformCodeGenFlags()));
m_platformLinkerFlagsLineEdit->setText(QtcProcess::joinArgs(tc->platformLinkerFlags()));
@@ -949,7 +948,7 @@ void GccToolChainConfigWidget::setFromToolchain()
bool GccToolChainConfigWidget::isDirtyImpl() const
{
GccToolChain *tc = static_cast<GccToolChain *>(toolChain());
auto tc = static_cast<GccToolChain *>(toolChain());
Q_ASSERT(tc);
return m_compilerCommand->fileName() != tc->compilerCommand()
|| m_platformCodeGenFlagsLineEdit->text() != QtcProcess::joinArgs(tc->platformCodeGenFlags())
@@ -1315,8 +1314,7 @@ GccToolChain *LinuxIccToolChainFactory::createToolChain(bool autoDetect)
}
GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFlags &flags) :
m_flags(flags),
m_triggered(false)
m_flags(flags)
{
if (!flag.startsWith(QLatin1String("-W"))) {
m_triggered = true;

View File

@@ -94,10 +94,10 @@ public:
public:
DetectedAbisResult() = default;
DetectedAbisResult(const QList<Abi> &supportedAbis,
const QString &originalTargetTriple = QString())
: supportedAbis(supportedAbis)
, originalTargetTriple(originalTargetTriple)
{}
const QString &originalTargetTriple = QString()) :
supportedAbis(supportedAbis),
originalTargetTriple(originalTargetTriple)
{ }
QList<Abi> supportedAbis;
QString originalTargetTriple;
@@ -132,15 +132,16 @@ protected:
class WarningFlagAdder
{
QByteArray m_flagUtf8;
WarningFlags &m_flags;
bool m_doesEnable;
bool m_triggered;
public:
WarningFlagAdder(const QString &flag, WarningFlags &flags);
void operator ()(const char name[], WarningFlags flagsSet);
bool triggered() const;
private:
QByteArray m_flagUtf8;
WarningFlags &m_flags;
bool m_doesEnable;
bool m_triggered = false;
};
private:

View File

@@ -94,7 +94,7 @@ private:
QLineEdit *m_platformLinkerFlagsLineEdit;
AbiWidget *m_abiWidget;
bool m_isReadOnly;
bool m_isReadOnly = false;
QByteArray m_macros;
};

View File

@@ -41,9 +41,7 @@ namespace {
const char * const MAKEFILE_PATTERN("^((.*?[/\\\\])?[Mm]akefile(\\.[a-zA-Z]+)?):(\\d+):\\s");
}
GnuMakeParser::GnuMakeParser() :
m_suppressIssues(false),
m_fatalErrorCount(0)
GnuMakeParser::GnuMakeParser()
{
setObjectName(QLatin1String("GnuMakeParser"));
m_makeDir.setPattern(QLatin1String(MAKEEXEC_PATTERN) +

View File

@@ -61,12 +61,13 @@ private:
QStringList m_directories;
bool m_suppressIssues = false;
int m_fatalErrorCount = 0;
#if defined WITH_TESTS
friend class ProjectExplorerPlugin;
#endif
bool m_suppressIssues;
int m_fatalErrorCount;
};
#if defined WITH_TESTS

View File

@@ -39,9 +39,7 @@ public:
FrameworkHeaderPath
};
HeaderPath() : m_kind(GlobalHeaderPath)
{ }
HeaderPath() = default;
HeaderPath(const QString &path, Kind kind) : m_path(path), m_kind(kind)
{ }
@@ -55,7 +53,7 @@ public:
private:
QString m_path;
Kind m_kind;
Kind m_kind = GlobalHeaderPath;
};
} // namespace ProjectExplorer

View File

@@ -39,24 +39,24 @@ ImportWidget::ImportWidget(QWidget *parent) :
m_pathChooser(new Utils::PathChooser)
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
QVBoxLayout *vboxLayout = new QVBoxLayout();
auto vboxLayout = new QVBoxLayout();
setLayout(vboxLayout);
vboxLayout->setContentsMargins(0, 0, 0, 0);
Utils::DetailsWidget *detailsWidget = new Utils::DetailsWidget(this);
auto detailsWidget = new Utils::DetailsWidget(this);
detailsWidget->setUseCheckBox(false);
detailsWidget->setSummaryText(tr("Import Build From..."));
detailsWidget->setSummaryFontBold(true);
// m_detailsWidget->setIcon(); // FIXME: Set icon!
vboxLayout->addWidget(detailsWidget);
QWidget *widget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout(widget);
auto widget = new QWidget;
auto layout = new QVBoxLayout(widget);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_pathChooser);
m_pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
m_pathChooser->setHistoryCompleter(QLatin1String("Import.SourceDir.History"));
QPushButton *importButton = new QPushButton(tr("Import"), widget);
auto importButton = new QPushButton(tr("Import"), widget);
layout->addWidget(importButton);
connect(importButton, &QAbstractButton::clicked, this, &ImportWidget::handleImportRequest);

View File

@@ -40,7 +40,7 @@ class ImportWidget : public QWidget
Q_OBJECT
public:
explicit ImportWidget(QWidget *parent = 0);
explicit ImportWidget(QWidget *parent = nullptr);
void setCurrentDirectory(const Utils::FileName &dir);

View File

@@ -224,4 +224,4 @@ QString IOutputParser::rightTrimmed(const QString &in)
return in.mid(0, pos);
}
}
} // namespace ProjectExplorer

View File

@@ -70,7 +70,7 @@ public slots:
private:
virtual void doFlush();
IOutputParser *m_parser = 0;
IOutputParser *m_parser = nullptr;
};
} // namespace ProjectExplorer

View File

@@ -44,6 +44,8 @@ class PROJECTEXPLORER_EXPORT ITaskHandler : public QObject
Q_OBJECT
public:
virtual ~ITaskHandler() { }
virtual bool isDefaultHandler() const { return false; }
virtual bool canHandle(const Task &) const = 0;
virtual void handle(const Task &) = 0;

View File

@@ -34,18 +34,14 @@
namespace ProjectExplorer {
JournaldWatcher *JournaldWatcher::m_instance = 0;
JournaldWatcher *JournaldWatcher::m_instance = nullptr;
namespace Internal {
class JournaldWatcherPrivate
{
public:
JournaldWatcherPrivate() :
m_journalContext(0),
m_notifier(0)
{ }
JournaldWatcherPrivate() = default;
~JournaldWatcherPrivate()
{
teardown();
@@ -67,8 +63,8 @@ public:
};
QList<SubscriberInformation> m_subscriptions;
sd_journal *m_journalContext;
QSocketNotifier *m_notifier;
sd_journal *m_journalContext = nullptr;
QSocketNotifier *m_notifier = nullptr;
};
bool JournaldWatcherPrivate::setup()
@@ -96,11 +92,11 @@ bool JournaldWatcherPrivate::setup()
void JournaldWatcherPrivate::teardown()
{
delete m_notifier;
m_notifier = 0;
m_notifier = nullptr;
if (m_journalContext) {
sd_journal_close(m_journalContext);
m_journalContext = 0;
m_journalContext = nullptr;
}
}
@@ -130,16 +126,16 @@ JournaldWatcher::LogEntry JournaldWatcherPrivate::retrieveEntry()
using namespace Internal;
static JournaldWatcherPrivate *d = 0;
static JournaldWatcherPrivate *d = nullptr;
JournaldWatcher::~JournaldWatcher()
{
d->teardown();
m_instance = 0;
m_instance = nullptr;
delete d;
d = 0;
d = nullptr;
}
JournaldWatcher *JournaldWatcher::instance()

View File

@@ -662,8 +662,7 @@ void PathChooserField::initializeData(MacroExpander *expander)
CheckBoxField::CheckBoxField() :
m_checkedValue(QLatin1String("0")),
m_uncheckedValue(QLatin1String("1")),
m_isModified(false)
m_uncheckedValue(QLatin1String("1"))
{ }
bool CheckBoxField::parseData(const QVariant &data, QString *errorMessage)
@@ -732,9 +731,6 @@ void CheckBoxField::initializeData(MacroExpander *expander)
// ComboBoxFieldData:
// --------------------------------------------------------------------
ComboBoxField::ComboBoxField() : m_index(-1), m_disabledIndex(-1), m_savedIndex(-1)
{ }
struct ComboBoxItem {
ComboBoxItem(const QString &k = QString(), const QString &v = QString(), const QVariant &c = true) :
key(k), value(v), condition(c)

View File

@@ -107,16 +107,16 @@ public:
};
JsonFieldPage(Utils::MacroExpander *expander, QWidget *parent = 0);
~JsonFieldPage();
~JsonFieldPage() override;
typedef std::function<Field *()> FieldFactory;
static void registerFieldFactory(const QString &id, const FieldFactory &ff);
bool setup(const QVariant &data);
bool isComplete() const;
void initializePage();
void cleanupPage();
bool isComplete() const override;
void initializePage() override;
void cleanupPage() override;
QFormLayout *layout() const { return m_formLayout; }

View File

@@ -53,7 +53,7 @@ public:
QVariant m_isCompleteExpando;
QString m_isCompleteExpandoMessage;
QWidget *m_widget = 0;
QWidget *m_widget = nullptr;
};
// --------------------------------------------------------------------
@@ -66,8 +66,8 @@ public:
LabelField();
private:
QWidget *createWidget(const QString &displayName, JsonFieldPage *page);
bool parseData(const QVariant &data, QString *errorMessage);
QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override;
bool parseData(const QVariant &data, QString *errorMessage) override;
bool m_wordWrap;
QString m_text;
@@ -78,11 +78,11 @@ class SpacerField : public JsonFieldPage::Field
public:
SpacerField();
bool suppressName() const { return true; }
bool suppressName() const override { return true; }
private:
bool parseData(const QVariant &data, QString *errorMessage);
QWidget *createWidget(const QString &displayName, JsonFieldPage *page);
bool parseData(const QVariant &data, QString *errorMessage) override;
QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override;
int m_factor;
};
@@ -93,13 +93,13 @@ public:
LineEditField();
private:
bool parseData(const QVariant &data, QString *errorMessage);
QWidget *createWidget(const QString &displayName, JsonFieldPage *page);
bool parseData(const QVariant &data, QString *errorMessage) override;
QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override;
void setup(JsonFieldPage *page, const QString &name);
void setup(JsonFieldPage *page, const QString &name) override;
bool validate(Utils::MacroExpander *expander, QString *message);
void initializeData(Utils::MacroExpander *expander);
bool validate(Utils::MacroExpander *expander, QString *message) override;
void initializeData(Utils::MacroExpander *expander) override;
bool m_isModified;
bool m_isValidating;
@@ -119,13 +119,13 @@ public:
TextEditField();
private:
bool parseData(const QVariant &data, QString *errorMessage);
QWidget *createWidget(const QString &displayName, JsonFieldPage *page);
bool parseData(const QVariant &data, QString *errorMessage) override;
QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override;
void setup(JsonFieldPage *page, const QString &name);
void setup(JsonFieldPage *page, const QString &name) override;
bool validate(Utils::MacroExpander *expander, QString *message);
void initializeData(Utils::MacroExpander *expander);
bool validate(Utils::MacroExpander *expander, QString *message) override;
void initializeData(Utils::MacroExpander *expander) override;
QString m_defaultText;
bool m_acceptRichText;
@@ -140,15 +140,15 @@ public:
PathChooserField();
private:
bool parseData(const QVariant &data, QString *errorMessage);
bool parseData(const QVariant &data, QString *errorMessage) override;
QWidget *createWidget(const QString &displayName, JsonFieldPage *page);
void setEnabled(bool e);
QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override;
void setEnabled(bool e) override;
void setup(JsonFieldPage *page, const QString &name);
void setup(JsonFieldPage *page, const QString &name) override;
bool validate(Utils::MacroExpander *expander, QString *message);
void initializeData(Utils::MacroExpander *expander);
bool validate(Utils::MacroExpander *expander, QString *message) override;
void initializeData(Utils::MacroExpander *expander) override;
QString m_path;
QString m_basePath;
@@ -163,47 +163,47 @@ class CheckBoxField : public JsonFieldPage::Field
public:
CheckBoxField();
bool suppressName() const { return true; }
bool suppressName() const override { return true; }
private:
bool parseData(const QVariant &data, QString *errorMessage);
bool parseData(const QVariant &data, QString *errorMessage) override;
QWidget *createWidget(const QString &displayName, JsonFieldPage *page);
QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override;
void setup(JsonFieldPage *page, const QString &name);
void setup(JsonFieldPage *page, const QString &name) override;
bool validate(Utils::MacroExpander *expander, QString *message);
void initializeData(Utils::MacroExpander *expander);
bool validate(Utils::MacroExpander *expander, QString *message) override;
void initializeData(Utils::MacroExpander *expander) override;
QString m_checkedValue;
QString m_uncheckedValue;
QVariant m_checkedExpression;
bool m_isModified;
bool m_isModified = false;
};
class ComboBoxField : public JsonFieldPage::Field
{
public:
ComboBoxField();
ComboBoxField() = default;
private:
bool parseData(const QVariant &data, QString *errorMessage);
bool parseData(const QVariant &data, QString *errorMessage) override;
QWidget *createWidget(const QString &displayName, JsonFieldPage *page);
QWidget *createWidget(const QString &displayName, JsonFieldPage *page) override;
void setup(JsonFieldPage *page, const QString &name);
void setup(JsonFieldPage *page, const QString &name) override;
bool validate(Utils::MacroExpander *expander, QString *message);
void initializeData(Utils::MacroExpander *expander);
bool validate(Utils::MacroExpander *expander, QString *message) override;
void initializeData(Utils::MacroExpander *expander) override;
QStringList m_itemList;
QStringList m_itemDataList;
QVariantList m_itemConditionList;
int m_index;
int m_disabledIndex;
int m_index = -1;
int m_disabledIndex = -1;
mutable int m_savedIndex;
mutable int m_savedIndex = -1;
};
} // namespace ProjectExplorer

View File

@@ -32,13 +32,12 @@
namespace ProjectExplorer {
JsonFilePage::JsonFilePage(QWidget *parent) :
Utils::FileWizardPage(parent)
JsonFilePage::JsonFilePage(QWidget *parent) : Utils::FileWizardPage(parent)
{ }
void JsonFilePage::initializePage()
{
JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard());
auto wiz = qobject_cast<JsonWizard *>(wizard());
if (!wiz)
return;

View File

@@ -35,10 +35,10 @@ class JsonFilePage : public Utils::FileWizardPage
Q_OBJECT
public:
JsonFilePage(QWidget *parent = 0);
JsonFilePage(QWidget *parent = nullptr);
void initializePage();
bool validatePage();
void initializePage() override;
bool validatePage() override;
};
} // namespace ProjectExplorer

View File

@@ -52,7 +52,7 @@ JsonKitsPage::JsonKitsPage(QWidget *parent) : TargetSetupPage(parent)
void JsonKitsPage::initializePage()
{
JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard());
auto wiz = qobject_cast<JsonWizard *>(wizard());
QTC_ASSERT(wiz, return);
connect(wiz, &JsonWizard::filesPolished, this, &JsonKitsPage::setupProjectFiles);
@@ -72,10 +72,10 @@ void JsonKitsPage::initializePage()
void JsonKitsPage::cleanupPage()
{
JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard());
auto wiz = qobject_cast<JsonWizard *>(wizard());
QTC_ASSERT(wiz, return);
disconnect(wiz, &JsonWizard::allDone, this, 0);
disconnect(wiz, &JsonWizard::allDone, this, nullptr);
TargetSetupPage::cleanupPage();
}
@@ -102,7 +102,7 @@ void JsonKitsPage::setPreferredFeatures(const QVariant &data)
void JsonKitsPage::setupProjectFiles(const JsonWizard::GeneratorFiles &files)
{
Project *project = 0;
Project *project = nullptr;
QList<IProjectManager *> managerList = ExtensionSystem::PluginManager::getObjects<IProjectManager>();
foreach (const JsonWizard::GeneratorFile &f, files) {
@@ -122,7 +122,7 @@ void JsonKitsPage::setupProjectFiles(const JsonWizard::GeneratorFiles &files)
if (setupProject(project))
project->saveSettings();
delete project;
project = 0;
project = nullptr;
}
}
}

View File

@@ -38,10 +38,10 @@ class JsonKitsPage : public TargetSetupPage
Q_OBJECT
public:
JsonKitsPage(QWidget *parent = 0);
JsonKitsPage(QWidget *parent = nullptr);
void initializePage();
void cleanupPage();
void initializePage() override;
void cleanupPage() override;
void setUnexpandedProjectPath(const QString &path);
QString unexpandedProjectPath() const;
@@ -70,7 +70,7 @@ private:
QVector<ConditionalFeature> m_preferredFeatures;
QSet<Core::Id> evaluate(const QVector<ConditionalFeature> &list, const QVariant &defaultSet,
JsonWizard *wiz);
JsonWizard *wiz);
};
} // namespace ProjectExplorer

View File

@@ -35,13 +35,12 @@
namespace ProjectExplorer {
JsonProjectPage::JsonProjectPage(QWidget *parent) :
Utils::ProjectIntroPage(parent)
JsonProjectPage::JsonProjectPage(QWidget *parent) : Utils::ProjectIntroPage(parent)
{ }
void JsonProjectPage::initializePage()
{
JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard());
auto wiz = qobject_cast<JsonWizard *>(wizard());
QTC_ASSERT(wiz, return);
setPath(wiz->stringValue(QLatin1String("InitialPath")));
@@ -81,7 +80,6 @@ QString JsonProjectPage::uniqueProjectName(const QString &path)
if (!pathDir.exists(name))
return name;
}
return prefix;
}
} // namespace ProjectExplorer

View File

@@ -35,10 +35,10 @@ class JsonProjectPage : public Utils::ProjectIntroPage
Q_OBJECT
public:
JsonProjectPage(QWidget *parent = 0);
JsonProjectPage(QWidget *parent = nullptr);
void initializePage();
bool validatePage();
void initializePage() override;
bool validatePage() override;
static QString uniqueProjectName(const QString &path);
};

View File

@@ -80,7 +80,7 @@ static IWizardFactory::WizardKind wizardKind(JsonWizard *wiz)
JsonSummaryPage::JsonSummaryPage(QWidget *parent) :
Internal::ProjectWizardPage(parent),
m_wizard(0)
m_wizard(nullptr)
{
connect(this, &Internal::ProjectWizardPage::projectNodeChanged,
this, &JsonSummaryPage::summarySettingsHaveChanged);
@@ -96,6 +96,7 @@ void JsonSummaryPage::setHideProjectUiValue(const QVariant &hideProjectUiValue)
void JsonSummaryPage::initializePage()
{
m_wizard = qobject_cast<JsonWizard *>(wizard());
QTC_ASSERT(m_wizard, return);
m_wizard->setValue(QLatin1String(KEY_SELECTED_PROJECT), QVariant());
m_wizard->setValue(QLatin1String(KEY_SELECTED_NODE), QVariant());
@@ -147,7 +148,7 @@ bool JsonSummaryPage::validatePage()
void JsonSummaryPage::cleanupPage()
{
disconnect(m_wizard, &JsonWizard::filesReady, this, 0);
disconnect(m_wizard, &JsonWizard::filesReady, this, nullptr);
}
void JsonSummaryPage::triggerCommit(const JsonWizard::GeneratorFiles &files)

View File

@@ -40,12 +40,12 @@ class JsonSummaryPage : public Internal::ProjectWizardPage
Q_OBJECT
public:
JsonSummaryPage(QWidget *parent = 0);
JsonSummaryPage(QWidget *parent = nullptr);
void setHideProjectUiValue(const QVariant &hideProjectUiValue);
void initializePage();
bool validatePage();
void cleanupPage();
void initializePage() override;
bool validatePage() override;
void cleanupPage() override;
public slots:
void triggerCommit(const JsonWizard::GeneratorFiles &files);

View File

@@ -44,8 +44,7 @@
namespace ProjectExplorer {
JsonWizard::JsonWizard(QWidget *parent) :
Utils::Wizard(parent)
JsonWizard::JsonWizard(QWidget *parent) : Utils::Wizard(parent)
{
setMinimumSize(800, 500);
m_expander.registerExtraResolver([this](const QString &name, QString *ret) -> bool {
@@ -298,7 +297,7 @@ void JsonWizard::reject()
void JsonWizard::handleNewPages(int pageId)
{
Utils::WizardPage *wp = qobject_cast<Utils::WizardPage *>(page(pageId));
auto wp = qobject_cast<Utils::WizardPage *>(page(pageId));
if (!wp)
return;

View File

@@ -46,7 +46,7 @@ class PROJECTEXPLORER_EXPORT JsonWizard : public Utils::Wizard
public:
class GeneratorFile {
public:
GeneratorFile() : generator(0) { }
GeneratorFile() : generator(nullptr) { }
GeneratorFile(const Core::GeneratedFile &f, JsonWizardGenerator *g) :
file(f), generator(g)
{ }
@@ -59,8 +59,8 @@ public:
typedef QList<GeneratorFile> GeneratorFiles;
Q_PROPERTY(GeneratorFiles generateFileList READ generateFileList)
explicit JsonWizard(QWidget *parent = 0);
~JsonWizard();
explicit JsonWizard(QWidget *parent = nullptr);
~JsonWizard() override;
void addGenerator(JsonWizardGenerator *gen);

View File

@@ -308,7 +308,7 @@ JsonWizardFactory *JsonWizardFactory::createWizardFactory(const QVariantMap &dat
JsonWizardFactory *factory = new JsonWizardFactory;
if (!factory->initialize(data, baseDir, errorMessage)) {
delete factory;
factory = 0;
factory = nullptr;
}
return factory;
}
@@ -350,9 +350,6 @@ void JsonWizardFactory::registerGeneratorFactory(JsonWizardGeneratorFactory *fac
s_generatorFactories.append(factory);
}
JsonWizardFactory::~JsonWizardFactory()
{ }
Utils::Wizard *JsonWizardFactory::runWizardImpl(const QString &path, QWidget *parent,
Core::Id platform,
const QVariantMap &variables)

View File

@@ -81,8 +81,6 @@ public:
static void registerPageFactory(JsonWizardPageFactory *factory);
static void registerGeneratorFactory(JsonWizardGeneratorFactory *factory);
~JsonWizardFactory();
static QList<QVariant> objectOrList(const QVariant &data, QString *errorMessage);
static QString localizedString(const QVariant &value);

View File

@@ -40,9 +40,9 @@ public:
Core::GeneratedFiles fileList(Utils::MacroExpander *expander,
const QString &wizardDir, const QString &projectDir,
QString *errorMessage);
QString *errorMessage) override;
bool writeFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage);
bool writeFile(const JsonWizard *wizard, Core::GeneratedFile *file, QString *errorMessage) override;
private:
class File {
@@ -60,7 +60,7 @@ private:
};
Core::GeneratedFile generateFile(const File &file, Utils::MacroExpander *expander,
QString *errorMessage);
QString *errorMessage);
QList<File> m_fileList;
};

View File

@@ -92,10 +92,10 @@ bool JsonWizardGenerator::formatFile(const JsonWizard *wizard, GeneratedFile *fi
if (!languageId.isValid())
return true; // don't modify files like *.ui, *.pro
Project *baseProject = qobject_cast<Project *>(wizard->property("SelectedProject").value<QObject *>());
auto baseProject = qobject_cast<Project *>(wizard->property("SelectedProject").value<QObject *>());
ICodeStylePreferencesFactory *factory = TextEditorSettings::codeStyleFactory(languageId);
Indenter *indenter = 0;
Indenter *indenter = nullptr;
if (factory)
indenter = factory->createIndenter();
if (!indenter)

Some files were not shown because too many files have changed in this diff Show More