aboutsummaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2017-11-19 17:34:27 +0300
committerJake Petroules <jake.petroules@qt.io>2017-11-30 06:08:50 +0000
commit4f6ec935e3abe5c918c320501a75786cce5d2ed0 (patch)
treeab22024081f6e4d693ad988efa136eefe4410c41 /src/app
parenta3c85aa9f267c156cd9b71a389eb4efe460439c8 (diff)
Modernize variable declarations
Use 'const' and 'auto' keywords more where static_cast is used. Change-Id: I60152b90fe5e44aa1ca513b43f133e604ed6417f Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config-ui/mainwindow.cpp2
-rw-r--r--src/app/qbs/parser/commandlineparser.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/app/config-ui/mainwindow.cpp b/src/app/config-ui/mainwindow.cpp
index 836f2539b..2affa990b 100644
--- a/src/app/config-ui/mainwindow.cpp
+++ b/src/app/config-ui/mainwindow.cpp
@@ -180,7 +180,7 @@ extern "C" void qt_macos_forceTransformProcessToForegroundApplicationAndActivate
bool MainWindow::eventFilter(QObject *watched, QEvent *event)
{
if (ui->treeView->hasFocus() && event->type() == QEvent::KeyPress) {
- QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+ const auto keyEvent = static_cast<const QKeyEvent *>(event);
if (keyEvent->matches(QKeySequence::Delete)) {
const QModelIndexList indexes = ui->treeView->selectionModel()->selectedRows();
if (indexes.size() == 1) {
diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp
index 2fe477418..feb69b207 100644
--- a/src/app/qbs/parser/commandlineparser.cpp
+++ b/src/app/qbs/parser/commandlineparser.cpp
@@ -125,7 +125,7 @@ void CommandLineParser::printHelp() const
QTextStream stream(stdout);
Q_ASSERT(d->command == d->commandPool.getCommand(HelpCommandType));
- const HelpCommand * const helpCommand = static_cast<HelpCommand *>(d->command);
+ const auto helpCommand = static_cast<const HelpCommand *>(d->command);
if (helpCommand->commandToDescribe().isEmpty()) {
stream << "Qbs " QBS_VERSION ", a cross-platform build tool.\n";
stream << d->generalHelp();