]> sigrok.org Git - pulseview.git/commitdiff
Prevent log length to be set to 0
authorSoeren Apel <redacted>
Thu, 14 Jun 2018 15:41:02 +0000 (17:41 +0200)
committerUwe Hermann <redacted>
Sat, 16 Jun 2018 10:56:31 +0000 (12:56 +0200)
Doing so prevents PV from starting up, so disallow it

pv/dialogs/settings.cpp
pv/logging.cpp
pv/logging.hpp

index 04565a3f850446da9966a942e5bce2a2ae1aa368..5b33272bc11111c5589b86c1af338a15a9f6f2ef 100644 (file)
@@ -493,6 +493,7 @@ QWidget *Settings::get_logging_page(QWidget *parent) const
        // Background buffer size
        QSpinBox *buffersize_sb = new QSpinBox();
        buffersize_sb->setSuffix(tr(" lines"));
+       buffersize_sb->setMinimum(Logging::MIN_BUFFER_SIZE);
        buffersize_sb->setMaximum(Logging::MAX_BUFFER_SIZE);
        buffersize_sb->setValue(
                settings.value(GlobalSettings::Key_Log_BufferSize).toInt());
index ab0594c342e5b58a0d7bf63ec91693640adbba50..dea333e534489b78bae632da28ccad90c56e35bd 100644 (file)
@@ -34,6 +34,7 @@ namespace pv {
 
 Logging logging;
 
+const int Logging::MIN_BUFFER_SIZE = 10;
 const int Logging::MAX_BUFFER_SIZE = 50000;
 
 Logging::~Logging()
index fe05c5439ecf52d30c663614c08948d1c2b9ef53..28f2107437ec966cd2e6545dca9ade9aea469d5c 100644 (file)
@@ -44,6 +44,7 @@ public:
                LogSource_srd
        };
 
+       static const int MIN_BUFFER_SIZE;
        static const int MAX_BUFFER_SIZE;
 
 public: