Skip to content

Commit 8dcbd96

Browse files
author
ThePBone
committed
Fix slider min/max bug
1 parent 9253249 commit 8dcbd96

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

config/container.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ float ConfigContainer::getFloat(QString key){
3939
}
4040
return getVariant(key).toFloat();
4141
}
42-
bool ConfigContainer::getBool(QString key){
42+
bool ConfigContainer::getBool(QString key, bool setToDefaultIfMissing){
4343
if(!map.contains(key)){
4444
qWarning().noquote().nospace() << "[W] Requested key '" << key << "' not found";
45-
map[key] = false;
45+
if(setToDefaultIfMissing)map[key] = false;
4646
return false;
4747
}
4848
return getVariant(key).toBool();

config/container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ConfigContainer
2727
QString getString(QString key,bool setToDefaultIfMissing=true);
2828
int getInt(QString key);
2929
float getFloat(QString key);
30-
bool getBool(QString key);
30+
bool getBool(QString key, bool setToDefaultIfMissing=true);
3131

3232
QVariantMap getConfigMap();
3333
void setConfigMap(QVariantMap newmap);

dialog/qanimatedslider.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ QAnimatedSlider::QAnimatedSlider(QWidget *parent)
2929
: QSlider(parent)
3030
{
3131
anim = new QPropertyAnimation(this,"value");
32-
connect(this,&QSlider::sliderMoved,[this]{
32+
connect(this,&QSlider::sliderReleased,[this]{
3333
cValue = value();
3434
emit valueChangedA(cValue);
3535
});
36+
connect(this,&QSlider::sliderMoved,[this](int position){
37+
cValue = position;
38+
emit valueChangedA(cValue);
39+
});
3640
}
3741

3842
QAnimatedSlider::~QAnimatedSlider()

mainwindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,9 @@ void MainWindow::ApplyConfig(bool restart){
818818
dbus_template.setValue("conv_ir_path",activeirs);
819819
m_dbus->SubmitPropertyMap(dbus_template.getConfigMap());
820820
if(restart){
821-
if(conf->getString("conv_ir_path",false).contains('$') && m_irsNeedUpdate)
821+
if(conf->getString("conv_ir_path",false).contains('$') &&
822+
conf->getBool("conv_enable",false) &&
823+
m_irsNeedUpdate)
822824
Restart();
823825
else
824826
if(m_appwrapper->getReloadMethod() == ReloadMethod::DIRECT_DBUS){

0 commit comments

Comments
 (0)