[Cmake-commits] CMake branch, master, updated. v3.13.0-518-g5bc3322
Kitware Robot
kwrobot at kitware.com
Mon Nov 26 08:03:02 EST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 5bc33226b2a0e8ff3c80b292abbfbc6f6b2c405b (commit)
via ada104175454f8e393083f116e200344fe846f34 (commit)
via ce2570b2071360c0b4bb4cd3c62ed8cccab26513 (commit)
via 9175a378f5d8786a54e35576853e7e6b068f17b0 (commit)
from af2960e0fdd8be7cd3ab8b2b894e18a0d3056db9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5bc33226b2a0e8ff3c80b292abbfbc6f6b2c405b
commit 5bc33226b2a0e8ff3c80b292abbfbc6f6b2c405b
Merge: ada1041 9175a37
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 26 13:00:20 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Nov 26 08:00:36 2018 -0500
Merge topic 'windows-taskbar-progress'
9175a378f5 QtDialog: Add windows taskbar progress
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2628
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ada104175454f8e393083f116e200344fe846f34
commit ada104175454f8e393083f116e200344fe846f34
Merge: af2960e ce2570b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 26 12:59:53 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Nov 26 08:00:01 2018 -0500
Merge topic 'clang-tidy-bugprone'
ce2570b207 clang-tidy: Enable checks from bugprone set
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !2642
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ce2570b2071360c0b4bb4cd3c62ed8cccab26513
commit ce2570b2071360c0b4bb4cd3c62ed8cccab26513
Author: Regina Pfeifer <regina at mailbox.org>
AuthorDate: Tue Nov 20 09:13:58 2018 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Nov 21 07:47:40 2018 -0500
clang-tidy: Enable checks from bugprone set
diff --git a/.clang-tidy b/.clang-tidy
index cec7d03..0ba4b0b 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,5 +1,8 @@
---
Checks: "-*,\
+bugprone-*,\
+-bugprone-macro-parentheses,\
+-bugprone-misplaced-widening-cast,\
google-readability-casting,\
misc-*,\
-misc-incorrect-roundings,\
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 1d938e6..2e1bb0a 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -3,6 +3,7 @@
#include "cmCTestTestHandler.h"
#include <algorithm>
#include <chrono>
+#include <cmath>
#include <cmsys/Base64.h>
#include <cmsys/Directory.hxx>
#include <cmsys/RegularExpression.hxx>
@@ -544,8 +545,7 @@ int cmCTestTestHandler::ProcessHandler()
}
cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::endl
- << passColorCode << static_cast<int>(percent + .5f)
- << "% tests passed"
+ << passColorCode << std::lround(percent) << "% tests passed"
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
<< ", " << failedColorCode << failed.size() << " tests failed"
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 3012b0a..fa2a3e1 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -10,6 +10,7 @@
#include <algorithm>
#include <assert.h>
+#include <cmath>
#include <ctype.h>
#include <memory> // IWYU pragma: keep
#include <sstream>
@@ -2602,10 +2603,10 @@ public:
bool UpdatePercentage(double value, double total, std::string& status)
{
- int OldPercentage = this->CurrentPercentage;
+ long OldPercentage = this->CurrentPercentage;
if (total > 0.0) {
- this->CurrentPercentage = static_cast<int>(value / total * 100.0 + 0.5);
+ this->CurrentPercentage = std::lround(value / total * 100.0);
if (this->CurrentPercentage > 100) {
// Avoid extra progress reports for unexpected data beyond total.
this->CurrentPercentage = 100;
@@ -2627,7 +2628,7 @@ public:
cmFileCommand* GetFileCommand() { return this->FileCommand; }
private:
- int CurrentPercentage;
+ long CurrentPercentage;
cmFileCommand* FileCommand;
std::string Text;
};
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9175a378f5d8786a54e35576853e7e6b068f17b0
commit 9175a378f5d8786a54e35576853e7e6b068f17b0
Author: Julien Jomier <julien.jomier at kitware.com>
AuthorDate: Sat Nov 17 14:01:23 2018 +0100
Commit: Julien Jomier <julien.jomier at kitware.com>
CommitDate: Tue Nov 20 17:16:08 2018 +0100
QtDialog: Add windows taskbar progress
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 330b747..9ce0323 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -19,9 +19,20 @@ if (Qt5Widgets_FOUND)
macro(qt4_add_resources)
qt5_add_resources(${ARGN})
endmacro()
+
set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES})
+ # Try to find the package WinExtras for the task bar progress
+ if(WIN32)
+ find_package(Qt5WinExtras QUIET)
+ if (Qt5WinExtras_FOUND)
+ include_directories(${Qt5WinExtras_INCLUDE_DIRS})
+ add_definitions(-DQT_WINEXTRAS)
+ list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES})
+ endif()
+ endif()
+
# Remove this when the minimum version of Qt is 4.6.
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 3761bd3..444a980 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -21,6 +21,11 @@
#include <QToolButton>
#include <QUrl>
+#ifdef QT_WINEXTRAS
+# include <QWinTaskbarButton>
+# include <QWinTaskbarProgress>
+#endif
+
#include "AddCacheEntry.h"
#include "FirstConfigure.h"
#include "QCMake.h"
@@ -294,6 +299,12 @@ void CMakeSetupDialog::initialize()
} else {
this->onBinaryDirectoryChanged(this->BinaryDirectory->lineEdit()->text());
}
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton = new QWinTaskbarButton(this);
+ this->TaskbarButton->setWindow(this->windowHandle());
+ this->TaskbarButton->setOverlayIcon(QIcon(":/loading.png"));
+#endif
}
CMakeSetupDialog::~CMakeSetupDialog()
@@ -381,6 +392,10 @@ void CMakeSetupDialog::doConfigure()
this->CacheValues->scrollToTop();
}
this->ProgressBar->reset();
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
}
bool CMakeSetupDialog::doConfigureInternal()
@@ -495,6 +510,9 @@ void CMakeSetupDialog::doGenerate()
this->enterState(ReadyConfigure);
this->ProgressBar->reset();
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
this->ConfigureNeeded = true;
}
@@ -674,6 +692,12 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
{
percent = (percent * ProgressFactor) + ProgressOffset;
this->ProgressBar->setValue(qRound(percent * 100));
+
+#ifdef QT_WINEXTRAS
+ QWinTaskbarProgress* progress = this->TaskbarButton->progress();
+ progress->setVisible(true);
+ progress->setValue(qRound(percent * 100));
+#endif
}
void CMakeSetupDialog::error(const QString& msg)
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 1cce35c..39c1053 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -15,6 +15,10 @@ class CMakeCacheModel;
class QProgressBar;
class QToolButton;
+#ifdef QT_WINEXTRAS
+class QWinTaskbarButton;
+#endif
+
/// Qt user interface for CMake
class CMakeSetupDialog
: public QMainWindow
@@ -118,6 +122,10 @@ protected:
QEventLoop LocalLoop;
+#ifdef QT_WINEXTRAS
+ QWinTaskbarButton* TaskbarButton;
+#endif
+
float ProgressOffset;
float ProgressFactor;
};
-----------------------------------------------------------------------
Summary of changes:
.clang-tidy | 3 +++
Source/CTest/cmCTestTestHandler.cxx | 4 ++--
Source/QtDialog/CMakeLists.txt | 11 +++++++++++
Source/QtDialog/CMakeSetupDialog.cxx | 24 ++++++++++++++++++++++++
Source/QtDialog/CMakeSetupDialog.h | 8 ++++++++
Source/cmFileCommand.cxx | 7 ++++---
6 files changed, 52 insertions(+), 5 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list