Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Serein207 committed Dec 7, 2023
1 parent da9d8ef commit 8109a30
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
21 changes: 6 additions & 15 deletions qml/page/T_EventoEdit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ FluScrollablePage {
width: 6
height: 30
radius: [3, 3, 3, 3]
color: ListView.isCurrentItem ? FluTheme.primaryColor.normal :
color: model.id == LocationModel.selected ? FluTheme.primaryColor.normal :
FluColors.Grey110

anchors {
Expand Down Expand Up @@ -434,6 +434,7 @@ FluScrollablePage {
id: area
height: 40
width: 180
property bool checked: false
FluRectangle {
id: rect_division
width: 6
Expand All @@ -446,15 +447,6 @@ FluScrollablePage {
}
}

Connections {
target: area
function onCheckedChanged() {
rect_division.color = rect_department.departmentIds.indexOf(model.id) < 0 ?
FluColors.Grey110 :
FluTheme.primaryColor.normal
}
}

FluText {
anchors {
left: rect_division.right
Expand All @@ -467,7 +459,6 @@ FluScrollablePage {

MouseArea {
id: item_mouse
property bool checked: false
anchors.fill: parent
hoverEnabled: true
onClicked: {
Expand All @@ -476,13 +467,13 @@ FluScrollablePage {
else
rect_department.departmentIds.splice(rect_department.departmentIds.indexOf(model.id), 1)

checked = !checked
area.checkedChanged()
area.checked = !area.checked
rect_division.color = rect_department.departmentIds.indexOf(model.id) < 0 ?
FluColors.Grey110 :
FluTheme.primaryColor.normal
}
}

signal checkedChanged()

Rectangle {
anchors.fill: parent
radius: 8
Expand Down
1 change: 1 addition & 0 deletions src/controller/evento_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ void EventoService::load_History() {
}

void EventoService::load_Block(QDate date) {
CalendarController::getInstance();
date = getMonday(date);
getRepo()->getEventListAfterTime(date).then([=](EventoResult<std::vector<DTO_Evento>> result) {
if (!result) {
Expand Down
1 change: 1 addition & 0 deletions src/controller/information_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void InformationService::load_EditInfo() {
}

void InformationService::load_DepartmentInfo() {
DepartmentEventsController::getInstance();
getRepo()->getDepartmentListWithSubscriptionInfo().then(
[this](EventoResult<std::vector<Department>> result) {
if (!result) {
Expand Down
11 changes: 8 additions & 3 deletions src/domain/model/type_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ QHash<int, QByteArray> TypeModel::roleNames() const {
}

void TypeModel::resetModel(std::vector<EventType>&& model) {
beginResetModel();
m_data = std::move(model);
endResetModel();
QMetaObject::invokeMethod(
this,
[&]() {
beginResetModel();
m_data = std::move(model);
endResetModel();
},
Qt::BlockingQueuedConnection);
}

0 comments on commit 8109a30

Please sign in to comment.