Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Pim
Commits
ff9eadfe
Commit
ff9eadfe
authored
Mar 07, 2014
by
Sergio Martins
Browse files
korg: Refresh Marcus Bains line after waking from suspend.
BUG: 286421 FIXED-IN: 4.13
parent
f4a951ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
calendarviews/agenda/agenda.cpp
View file @
ff9eadfe
...
...
@@ -68,7 +68,7 @@ class MarcusBains::Private
public:
Private
(
EventView
*
eventView
,
Agenda
*
agenda
)
:
mEventView
(
eventView
),
mAgenda
(
agenda
),
mTimer
(
0
),
mTimeBox
(
0
),
mOldTime
(
0
,
0
),
mOldTodayCol
(
-
1
)
mTimer
(
0
),
mTimeBox
(
0
),
mOldTodayCol
(
-
1
)
{
}
...
...
@@ -79,7 +79,7 @@ class MarcusBains::Private
Agenda
*
mAgenda
;
QTimer
*
mTimer
;
QLabel
*
mTimeBox
;
// Label showing the current time
Q
Time
mOldTime
;
KDate
Time
mOld
Date
Time
;
int
mOldTodayCol
;
};
...
...
@@ -126,10 +126,11 @@ void MarcusBains::updateLocationRecalc( bool recalculate )
const
bool
showSeconds
=
d
->
mEventView
->
preferences
()
->
marcusBainsShowSeconds
();
const
QColor
color
=
d
->
mEventView
->
preferences
()
->
agendaMarcusBainsLineLineColor
();
const
QTime
time
=
QTime
::
currentTime
();
if
(
(
time
.
hour
()
==
0
)
&&
(
d
->
mOldTime
.
hour
()
==
23
)
)
{
// We are on a new day
recalculate
=
true
;
const
KDateTime
now
=
KDateTime
::
currentLocalDateTime
();
const
QTime
time
=
now
.
time
();
if
(
now
.
date
()
!=
d
->
mOldDateTime
.
date
())
{
recalculate
=
true
;
// New day
}
const
int
todayCol
=
recalculate
?
d
->
todayColumn
()
:
d
->
mOldTodayCol
;
...
...
@@ -137,7 +138,7 @@ void MarcusBains::updateLocationRecalc( bool recalculate )
const
int
minutes
=
time
.
hour
()
*
60
+
time
.
minute
();
const
int
minutesPerCell
=
24
*
60
/
d
->
mAgenda
->
rows
();
d
->
mOldTime
=
time
;
d
->
mOld
Date
Time
=
now
;
d
->
mOldTodayCol
=
todayCol
;
int
y
=
int
(
minutes
*
d
->
mAgenda
->
gridSpacingY
()
/
minutesPerCell
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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