summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMake.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2012-01-02 18:07:43 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2012-01-02 18:07:43 (GMT)
commit131eed660716a2a8b52a6956f8e8a136425c404e (patch)
tree99ba06a0196fc4bc6e8eb84b1ff75fc984e89b92 /Source/QtDialog/QCMake.cxx
parent40aedcbbaeddcb7e088c56e30f4252171e920baa (diff)
downloadCMake-131eed660716a2a8b52a6956f8e8a136425c404e.zip
CMake-131eed660716a2a8b52a6956f8e8a136425c404e.tar.gz
CMake-131eed660716a2a8b52a6956f8e8a136425c404e.tar.bz2
cmake-gui: Improve interrupt granularity to fix bug 12649.
Instead of enabling interrupt only when a progress or message callback is called, add a new callback specifically for interrupt. This new callback is called from GetFatalErrorOccured() so cmake-gui can immediately report interrupt status instead of calling queuing a call to cmSystemTools::SetFatalErrorOccured() and waiting for the progress or message callback to be called to process that queued call.
Diffstat (limited to 'Source/QtDialog/QCMake.cxx')
-rw-r--r--Source/QtDialog/QCMake.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index a40a175..73050f3 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -63,6 +63,8 @@ QCMake::QCMake(QObject* p)
#endif
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
+ cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);
+
std::vector<std::string> generators;
this->CMakeInstance->GetRegisteredGenerators(generators);
std::vector<std::string>::iterator iter;
@@ -170,6 +172,7 @@ void QCMake::configure()
this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode);
this->CMakeInstance->PreLoadCMakeFiles();
+ InterruptFlag = 0;
cmSystemTools::ResetErrorOccuredFlag();
int err = this->CMakeInstance->Configure();
@@ -188,7 +191,9 @@ void QCMake::generate()
UINT lastErrorMode = SetErrorMode(0);
#endif
+ InterruptFlag = 0;
cmSystemTools::ResetErrorOccuredFlag();
+
int err = this->CMakeInstance->Generate();
#ifdef Q_OS_WIN
@@ -337,7 +342,13 @@ QCMakePropertyList QCMake::properties() const
void QCMake::interrupt()
{
- cmSystemTools::SetFatalErrorOccured();
+ this->InterruptFlag.ref();
+}
+
+bool QCMake::interruptCallback(void* cd)
+{
+ QCMake* self = reinterpret_cast<QCMake*>(cd);
+ return self->InterruptFlag;
}
void QCMake::progressCallback(const char* msg, float percent, void* cd)