Skip to content

Commit

Permalink
Fixed the displaying optional attributes after reset action
Browse files Browse the repository at this point in the history
Now optional attributes stay visible after reset action
  • Loading branch information
DimDone committed Jul 24, 2024
1 parent 06ae16c commit fb0558b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/adldap/ad_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <QList>
#include <QString>
#include <algorithm>
#include <QTextStream>

const qint64 SECONDS_TO_MILLIS = 1000LL;
const qint64 MINUTES_TO_SECONDS = 60LL;
Expand Down
6 changes: 3 additions & 3 deletions src/admc/tabs/attributes_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ AttributesTabEdit::AttributesTabEdit(QTreeView *view_arg, QPushButton *filter_bu
QItemSelectionModel *selection_model = view->selectionModel();

bool load_optional_is_set = settings_get_variant(SETTING_load_optional_attribute_values).toBool();
optional_attrs_values_is_loaded = load_optional_is_set;
load_optional_attrs_button->setVisible(!load_optional_is_set);

connect(
Expand Down Expand Up @@ -235,7 +236,7 @@ void AttributesTabEdit::load_optional_attribute_values(AdInterface &ad) {
}
}
}

optional_attrs_values_is_loaded = true;
proxy->update_set_attributes(optional_set_attrs);
}

Expand Down Expand Up @@ -290,8 +291,7 @@ void AttributesTabEdit::load(AdInterface &ad, const AdObject &object) {

proxy->load(object);

bool load_optional = settings_get_variant(SETTING_load_optional_attribute_values).toBool();
if (load_optional) {
if (optional_attrs_values_is_loaded) {
load_optional_attribute_values(ad);
}
else {
Expand Down
1 change: 1 addition & 0 deletions src/admc/tabs/attributes_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class AttributesTabEdit final : public AttributeEdit {
QHash<QString, QList<QByteArray>> current;
QList<QString> not_specified_optional_attributes;
QString object_dn;
bool optional_attrs_values_is_loaded;

void update_edit_and_view_buttons();
void on_double_click();
Expand Down

0 comments on commit fb0558b

Please sign in to comment.