diff options
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 14 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 89061a4..3fe1834 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -490,14 +490,14 @@ void cmCursesMainForm::UpdateStatusBar(const char* message) pos_form_cursor(this->Form); } -void cmCursesMainForm::UpdateProgress(const char* msg, float prog) +void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) { char tmp[1024]; const char* cmsg = tmp; if (prog >= 0) { - sprintf(tmp, "%s %i%%", msg, static_cast<int>(100 * prog)); + sprintf(tmp, "%s %i%%", msg.c_str(), static_cast<int>(100 * prog)); } else { - cmsg = msg; + cmsg = msg.c_str(); } this->UpdateStatusBar(cmsg); this->PrintKeys(1); @@ -517,7 +517,9 @@ int cmCursesMainForm::Configure(int noconfigure) touchwin(stdscr); refresh(); this->CMakeInstance->SetProgressCallback( - [this](const char* msg, float prog) { this->UpdateProgress(msg, prog); }); + [this](const std::string& msg, float prog) { + this->UpdateProgress(msg, prog); + }); // always save the current gui values to disk this->FillCacheManagerFromUI(); @@ -587,7 +589,9 @@ int cmCursesMainForm::Generate() touchwin(stdscr); refresh(); this->CMakeInstance->SetProgressCallback( - [this](const char* msg, float prog) { this->UpdateProgress(msg, prog); }); + [this](const std::string& msg, float prog) { + this->UpdateProgress(msg, prog); + }); // Get rid of previous errors this->Errors = std::vector<std::string>(); diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index c09ce2a..d379975 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -102,7 +102,7 @@ public: /** * Progress callback */ - void UpdateProgress(const char* msg, float prog); + void UpdateProgress(const std::string& msg, float prog); protected: // Copy the cache values from the user interface to the actual |