Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kalendar
Commits
befe0508
Unverified
Commit
befe0508
authored
Sep 04, 2022
by
Carl Schwan
🚴
Browse files
Reduce usage of objectName and replace by proper enum
Signed-off-by:
Carl Schwan
<
carl@carlschwan.eu
>
parent
8eb6fb54
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/contents/ui/Drawers/MainDrawer.qml
View file @
befe0508
...
...
@@ -225,10 +225,7 @@ Kirigami.OverlayDrawer {
// in any of the hourly views, at least in desktop mode
checkable
:
true
checked
:
pageStack
.
currentItem
&&
(
pageStack
.
currentItem
.
objectName
==
"
weekView
"
||
pageStack
.
currentItem
.
objectName
==
"
threeDayView
"
||
pageStack
.
currentItem
.
objectName
==
"
dayView
"
)
pageStack
.
currentItem
.
mode
&
(
KalendarApplication
.
Week
|
KalendarApplication
.
ThreeDay
|
KalendarApplication
.
Day
))
onTriggered
:
{
weekViewAction
.
trigger
()
if
(
mainDrawer
.
modal
)
mainDrawer
.
close
()
...
...
src/contents/ui/main.qml
View file @
befe0508
...
...
@@ -380,7 +380,7 @@ Kirigami.ApplicationWindow {
function
onOpenIncidence
(
incidenceData
,
occurrenceDate
)
{
// Switch to an event view if the current view is not compatible with the current incidence type
if
(
(
pageStack
.
currentItem
.
mode
&
(
KalendarApplication
.
Todo
|
KalendarApplication
.
Event
)
||
if
(
pageStack
.
currentItem
.
mode
&
(
KalendarApplication
.
Todo
|
KalendarApplication
.
Event
)
||
(
pageStack
.
currentItem
.
mode
===
KalendarApplication
.
Todo
&&
incidenceData
.
incidenceType
!==
IncidenceWrapper
.
TypeTodo
))
{
Kirigami
.
Settings
.
isMobile
?
dayViewAction
.
trigger
()
:
weekViewAction
.
trigger
();
...
...
@@ -388,7 +388,7 @@ Kirigami.ApplicationWindow {
KalendarUiUtils
.
setUpView
(
incidenceData
);
if
(
pageStack
.
currentItem
.
objectName
!==
"
todoView
"
)
{
if
(
pageStack
.
currentItem
.
mode
!==
KalendarApplication
.
Todo
)
{
pageStack
.
currentItem
.
setToDate
(
occurrenceDate
);
}
}
...
...
@@ -630,7 +630,7 @@ Kirigami.ApplicationWindow {
onStatusChanged
:
if
(
status
===
Loader
.
Ready
)
item
.
open
()
sourceComponent
:
DateChanger
{
y
:
pageStack
.
globalToolBar
.
height
-
1
showDays
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
objectName
!==
"
m
onthView
"
showDays
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
mode
!==
KalendarApplication
.
M
onthView
date
:
root
.
selectedDate
onDateSelected
:
if
(
visible
)
{
pageStack
.
currentItem
.
setToDate
(
date
);
...
...
@@ -1052,21 +1052,21 @@ Kirigami.ApplicationWindow {
actions
:
[
Kirigami.Action
{
text
:
"
Week
"
text
:
i18nc
(
"
@action:inmenu open week view
"
,
"
Week
"
)
checkable
:
true
checked
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
objectName
==
"
weekView
"
checked
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
mode
===
KalendarApplication
.
Week
onTriggered
:
weekViewAction
.
trigger
()
},
Kirigami.Action
{
text
:
"
3 Days
"
text
:
i18nc
(
"
@action:inmenu open 3 days view
"
,
"
3 Days
"
)
checkable
:
true
checked
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
objectName
==
"
t
hreeDay
View
"
checked
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
mode
===
KalendarApplication
.
T
hreeDay
onTriggered
:
threeDayViewAction
.
trigger
()
},
Kirigami.Action
{
text
:
"
Day
"
text
:
i18nc
(
"
@action:inmenu open day view
"
,
"
Day
"
)
checkable
:
true
checked
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
objectName
==
"
dayView
"
checked
:
pageStack
.
currentItem
&&
pageStack
.
currentItem
.
mode
===
KalendarApplication
.
Day
onTriggered
:
dayViewAction
.
trigger
()
}
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment