compressedfilemaxkbs had no default in the sample conf which created some weirdness in the index config GUI (but no actual problem). Add default in sample conf + a way to set a default value in the c++ code
This commit is contained in:
parent
d6cd7dad78
commit
77211c0db3
@ -112,8 +112,9 @@ ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink cflink,
|
||||
const QString& lbltxt,
|
||||
const QString& tltptxt,
|
||||
int minvalue,
|
||||
int maxvalue)
|
||||
: ConfParamW(parent, cflink)
|
||||
int maxvalue,
|
||||
int defaultvalue)
|
||||
: ConfParamW(parent, cflink), m_defaultvalue(defaultvalue)
|
||||
{
|
||||
if (!createCommon(lbltxt, tltptxt))
|
||||
return;
|
||||
@ -144,8 +145,10 @@ ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink cflink,
|
||||
void ConfParamIntW::loadValue()
|
||||
{
|
||||
string s;
|
||||
m_cflink->get(s);
|
||||
m_sb->setValue(atoi(s.c_str()));
|
||||
if (m_cflink->get(s))
|
||||
m_sb->setValue(atoi(s.c_str()));
|
||||
else
|
||||
m_sb->setValue(m_defaultvalue);
|
||||
}
|
||||
|
||||
ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink cflink,
|
||||
|
||||
@ -104,16 +104,20 @@ namespace confgui {
|
||||
class ConfParamIntW : public ConfParamW {
|
||||
Q_OBJECT
|
||||
public:
|
||||
// The default value is only used if none exists in the sample
|
||||
// configuration file. Defaults are normally set in there.
|
||||
ConfParamIntW(QWidget *parent, ConfLink cflink,
|
||||
const QString& lbltxt,
|
||||
const QString& tltptxt,
|
||||
int minvalue = INT_MIN,
|
||||
int maxvalue = INT_MAX);
|
||||
int maxvalue = INT_MAX,
|
||||
int defaultvalue = 0);
|
||||
virtual void loadValue();
|
||||
public slots:
|
||||
virtual void setEnabled(bool i) {if(m_sb) ((QWidget*)m_sb)->setEnabled(i);}
|
||||
protected:
|
||||
QSpinBox *m_sb;
|
||||
int m_defaultvalue;
|
||||
};
|
||||
|
||||
// Arbitrary string
|
||||
|
||||
@ -439,7 +439,7 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config)
|
||||
tr("This value sets a threshold beyond which compressed"
|
||||
"files will not be processed. Set to -1 for no "
|
||||
"limit, to 0 for no decompression ever."),
|
||||
-1, 1000000);
|
||||
-1, 1000000, -1);
|
||||
m_widgets.push_back(ezfmaxkbs);
|
||||
|
||||
ConfLink lnktxtmaxmbs(new ConfLinkRclRep(config, "textfilemaxmbs"));
|
||||
|
||||
@ -106,7 +106,7 @@ indexallfilenames = 1
|
||||
# temporary directory for identification, which can be wasteful in some
|
||||
# cases. Limit the waste. Negative means no limit. 0 results in no
|
||||
# processing of any compressed file
|
||||
# compressedfilemaxkbs = -1
|
||||
compressedfilemaxkbs = -1
|
||||
|
||||
# Size limit for text files. This is for skipping monster logs
|
||||
textfilemaxmbs = 20
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user