1
0
mirror of https://github.com/altlinux/admc.git synced 2025-02-10 05:57:24 +03:00

remove calls to QList::toSet()

it's deprecated
This commit is contained in:
Dmitry Degtyarev 2022-06-09 16:24:45 +04:00
parent 690e66f47c
commit 64ac17bc46
4 changed files with 17 additions and 7 deletions

View File

@ -781,8 +781,13 @@ QList<QString> AdConfig::get_noncontainer_classes() {
bool AdConfig::rights_applies_to_class(const QString &rights_cn, const QList<QString> &class_list) const {
const QByteArray rights_guid = d->rights_name_to_guid_map[rights_cn];
const QSet<QString> applies_to = d->rights_applies_to_map[rights_guid].toSet();
const bool applies = applies_to.intersects(class_list.toSet());
const QList<QString> applies_to_list = d->rights_applies_to_map[rights_guid];
const QSet<QString> applies_to_set = QSet<QString>(applies_to_list.begin(), applies_to_list.end());
const QSet<QString> class_set = QSet<QString>(class_list.begin(), class_list.end());
const bool applies = applies_to_set.intersects(class_set);
return applies;
}

View File

@ -47,10 +47,15 @@ AttributesTabProxy::AttributesTabProxy(AttributesTabFilterMenu *filter_menu_arg,
void AttributesTabProxy::load(const AdObject &object) {
const QList<QString> object_classes = object.get_strings(ATTRIBUTE_OBJECT_CLASS);
mandatory_attributes = g_adconfig->get_mandatory_attributes(object_classes).toSet();
optional_attributes = g_adconfig->get_optional_attributes(object_classes).toSet();
set_attributes = object.attributes().toSet();
const QList<QString> mandatory_attributes_list = g_adconfig->get_mandatory_attributes(object_classes);
mandatory_attributes = QSet<QString>(mandatory_attributes_list.begin(), mandatory_attributes_list.end());
const QList<QString> optional_attributes_list = g_adconfig->get_optional_attributes(object_classes);
optional_attributes = QSet<QString>(optional_attributes_list.begin(), optional_attributes_list.end());
const QList<QString> attributes_list = object.attributes();
set_attributes = QSet<QString>(attributes_list.begin(), attributes_list.end());
}
bool AttributesTabProxy::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {

View File

@ -120,7 +120,7 @@ MembershipTab::~MembershipTab() {
void MembershipTabEdit::load(AdInterface &ad, const AdObject &object) {
const QList<QString> values = object.get_strings(get_membership_attribute());
original_values = values.toSet();
original_values = QSet<QString>(values.begin(), values.end());
current_values = original_values;
// Add primary groups or primary members

View File

@ -110,7 +110,7 @@ void ADMCTestLogonHoursDialog::select() {
utc_time_button->setChecked(true);
const QList<QModelIndex> selected = selection_model->selectedIndexes();
const QSet<QModelIndex> selected_set = selected.toSet();
const QSet<QModelIndex> selected_set = QSet<QModelIndex>(selected.begin(), selected.end());
const QSet<QModelIndex> correct_selected_set = {
model->index(2, 0),