mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
GtkCalendar: some functions always return TRUE, so change them to void
Certain functions for GtkCalendar always return the same value. Therefore they do not actually need to return a value at all. Bug #621136.
This commit is contained in:
parent
e9fc660d7e
commit
e19c50b538
@ -3660,22 +3660,20 @@ gtk_calendar_set_display_options (GtkCalendar *calendar,
|
||||
* @calendar: a #GtkCalendar
|
||||
* @month: a month number between 0 and 11.
|
||||
* @year: the year the month is in.
|
||||
*
|
||||
*
|
||||
* Shifts the calendar to a different month.
|
||||
*
|
||||
* Return value: %TRUE, always
|
||||
**/
|
||||
gboolean
|
||||
void
|
||||
gtk_calendar_select_month (GtkCalendar *calendar,
|
||||
guint month,
|
||||
guint year)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
|
||||
g_return_val_if_fail (month <= 11, FALSE);
|
||||
|
||||
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
||||
g_return_if_fail (month <= 11);
|
||||
|
||||
calendar->month = month;
|
||||
calendar->year = year;
|
||||
|
||||
|
||||
calendar_compute_days (calendar);
|
||||
calendar_queue_refresh (calendar);
|
||||
|
||||
@ -3687,7 +3685,6 @@ gtk_calendar_select_month (GtkCalendar *calendar,
|
||||
g_signal_emit (calendar,
|
||||
gtk_calendar_signals[MONTH_CHANGED_SIGNAL],
|
||||
0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3756,52 +3753,44 @@ gtk_calendar_clear_marks (GtkCalendar *calendar)
|
||||
|
||||
/**
|
||||
* gtk_calendar_mark_day:
|
||||
* @calendar: a #GtkCalendar
|
||||
* @calendar: a #GtkCalendar
|
||||
* @day: the day number to mark between 1 and 31.
|
||||
*
|
||||
*
|
||||
* Places a visual marker on a particular day.
|
||||
*
|
||||
* Return value: %TRUE, always
|
||||
**/
|
||||
gboolean
|
||||
*/
|
||||
void
|
||||
gtk_calendar_mark_day (GtkCalendar *calendar,
|
||||
guint day)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
|
||||
|
||||
if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == FALSE)
|
||||
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
||||
|
||||
if (day >= 1 && day <= 31 && !calendar->marked_date[day-1])
|
||||
{
|
||||
calendar->marked_date[day - 1] = TRUE;
|
||||
calendar->num_marked_dates++;
|
||||
calendar_invalidate_day_num (calendar, day);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_calendar_unmark_day:
|
||||
* @calendar: a #GtkCalendar.
|
||||
* @day: the day number to unmark between 1 and 31.
|
||||
*
|
||||
*
|
||||
* Removes the visual marker from a particular day.
|
||||
*
|
||||
* Return value: %TRUE, always
|
||||
**/
|
||||
gboolean
|
||||
*/
|
||||
void
|
||||
gtk_calendar_unmark_day (GtkCalendar *calendar,
|
||||
guint day)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
|
||||
|
||||
if (day >= 1 && day <= 31 && calendar->marked_date[day-1] == TRUE)
|
||||
g_return_if_fail (GTK_IS_CALENDAR (calendar));
|
||||
|
||||
if (day >= 1 && day <= 31 && calendar->marked_date[day-1])
|
||||
{
|
||||
calendar->marked_date[day - 1] = FALSE;
|
||||
calendar->num_marked_dates--;
|
||||
calendar_invalidate_day_num (calendar, day);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,15 +156,15 @@ struct _GtkCalendarClass
|
||||
GType gtk_calendar_get_type (void) G_GNUC_CONST;
|
||||
GtkWidget* gtk_calendar_new (void);
|
||||
|
||||
gboolean gtk_calendar_select_month (GtkCalendar *calendar,
|
||||
void gtk_calendar_select_month (GtkCalendar *calendar,
|
||||
guint month,
|
||||
guint year);
|
||||
void gtk_calendar_select_day (GtkCalendar *calendar,
|
||||
guint day);
|
||||
|
||||
gboolean gtk_calendar_mark_day (GtkCalendar *calendar,
|
||||
void gtk_calendar_mark_day (GtkCalendar *calendar,
|
||||
guint day);
|
||||
gboolean gtk_calendar_unmark_day (GtkCalendar *calendar,
|
||||
void gtk_calendar_unmark_day (GtkCalendar *calendar,
|
||||
guint day);
|
||||
void gtk_calendar_clear_marks (GtkCalendar *calendar);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user