diff options
author | albert-github <albert.tests@gmail.com> | 2020-12-16 10:02:47 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-12-16 10:02:47 (GMT) |
commit | f573b414b482a01e87869a277cdb913d173fc925 (patch) | |
tree | 673fcfe296c39129da4c929e332727e40c0ed63d /addon/doxywizard/inputint.cpp | |
parent | 7b2e841b3a3d7d787458f236e2447c890cfbf590 (diff) | |
download | Doxygen-f573b414b482a01e87869a277cdb913d173fc925.zip Doxygen-f573b414b482a01e87869a277cdb913d173fc925.tar.gz Doxygen-f573b414b482a01e87869a277cdb913d173fc925.tar.bz2 |
Improvements of reading the configuration file
- making the parsing of the configuration consistent with the reading of the configuration file a doxygen run
- adding a number of warnings in case of problems in the configuration file
- making the configuration warnings better visible (popping up the "Output log Window").
Diffstat (limited to 'addon/doxywizard/inputint.cpp')
-rw-r--r-- | addon/doxywizard/inputint.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/addon/doxywizard/inputint.cpp b/addon/doxywizard/inputint.cpp index de01862..ce3fa02 100644 --- a/addon/doxywizard/inputint.cpp +++ b/addon/doxywizard/inputint.cpp @@ -12,6 +12,7 @@ #include "inputint.h" #include "helplabel.h" +#include "config_msg.h" #include <QSpinBox> #include <QGridLayout> @@ -59,12 +60,19 @@ void InputInt::help() void InputInt::setValue(int val) { - val = qMax(m_minVal,val); - val = qMin(m_maxVal,val); - if (val!=m_val) + int newVal = val; + newVal = qMax(m_minVal,newVal); + newVal = qMin(m_maxVal,newVal); + if (val != newVal) { - m_val = val; - m_sp->setValue(val); + config_warn("argument '%d' for option %s is not a valid number in the range [%d..%d]!" + " Using the default: %d!\n",val,qPrintable(m_id),m_minVal,m_maxVal,m_default); + newVal = m_default; + } + if (newVal!=m_val) + { + m_val = newVal; + m_sp->setValue(newVal); m_value = m_val; updateDefault(); } @@ -101,7 +109,12 @@ void InputInt::update() { bool ok; int newVal = m_value.toInt(&ok); - if (!ok) newVal = m_default; + if (!ok) + { + config_warn("argument '%s' for option %s is not a valid number in the range [%d..%d]!" + " Using the default: %d!\n",qPrintable(m_value.toString()),qPrintable(m_id),m_minVal,m_maxVal,m_default); + newVal = m_default; + } setValue(newVal); } |