month-cell: Cleanup unused function
We handle weather internally now, no need to expose a function to set that.
This commit is contained in:
@@ -24,8 +24,9 @@
|
|||||||
#include "gcal-clock.h"
|
#include "gcal-clock.h"
|
||||||
#include "gcal-debug.h"
|
#include "gcal-debug.h"
|
||||||
#include "gcal-event-widget.h"
|
#include "gcal-event-widget.h"
|
||||||
#include "gcal-utils.h"
|
|
||||||
#include "gcal-month-cell.h"
|
#include "gcal-month-cell.h"
|
||||||
|
#include "gcal-utils.h"
|
||||||
|
#include "gcal-weather-info.h"
|
||||||
|
|
||||||
struct _GcalMonthCell
|
struct _GcalMonthCell
|
||||||
{
|
{
|
||||||
@@ -445,46 +446,6 @@ gcal_month_cell_set_date (GcalMonthCell *self,
|
|||||||
update_weather (self);
|
update_weather (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gcal_month_cell_set_weather:
|
|
||||||
* @self: The #GcalMonthCell instance.
|
|
||||||
* @info: (nullable): The weather information to display.
|
|
||||||
*
|
|
||||||
* Sets the weather information to display for this day.
|
|
||||||
*
|
|
||||||
* Note that this function does not check dates nor
|
|
||||||
* manages weather information changes on its own.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gcal_month_cell_set_weather (GcalMonthCell *self,
|
|
||||||
GcalWeatherInfo *info)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GCAL_IS_MONTH_CELL (self));
|
|
||||||
g_return_if_fail (!info || GCAL_IS_WEATHER_INFO (info));
|
|
||||||
|
|
||||||
if (self->weather_info == info)
|
|
||||||
return;
|
|
||||||
|
|
||||||
self->weather_info = info;
|
|
||||||
|
|
||||||
if (!info)
|
|
||||||
{
|
|
||||||
gtk_image_clear (self->weather_icon);
|
|
||||||
gtk_label_set_text (self->temp_label, "");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const gchar* icon_name; /* unowned */
|
|
||||||
const gchar* temp_str; /* unwoned */
|
|
||||||
|
|
||||||
icon_name = gcal_weather_info_get_icon_name (info);
|
|
||||||
temp_str = gcal_weather_info_get_temperature (info);
|
|
||||||
|
|
||||||
gtk_image_set_from_icon_name (self->weather_icon, icon_name);
|
|
||||||
gtk_label_set_text (self->temp_label, temp_str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gcal_month_cell_get_different_month (GcalMonthCell *self)
|
gcal_month_cell_get_different_month (GcalMonthCell *self)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#define GCAL_MONTH_CELL_H
|
#define GCAL_MONTH_CELL_H
|
||||||
|
|
||||||
#include "gcal-context.h"
|
#include "gcal-context.h"
|
||||||
#include "gcal-weather-info.h"
|
|
||||||
|
|
||||||
#include <adwaita.h>
|
#include <adwaita.h>
|
||||||
|
|
||||||
@@ -37,9 +36,6 @@ GDateTime* gcal_month_cell_get_date (GcalMonthCell
|
|||||||
void gcal_month_cell_set_date (GcalMonthCell *self,
|
void gcal_month_cell_set_date (GcalMonthCell *self,
|
||||||
GDateTime *date);
|
GDateTime *date);
|
||||||
|
|
||||||
void gcal_month_cell_set_weather (GcalMonthCell *self,
|
|
||||||
GcalWeatherInfo *info);
|
|
||||||
|
|
||||||
gboolean gcal_month_cell_get_different_month (GcalMonthCell *self);
|
gboolean gcal_month_cell_get_different_month (GcalMonthCell *self);
|
||||||
|
|
||||||
void gcal_month_cell_set_different_month (GcalMonthCell *self,
|
void gcal_month_cell_set_different_month (GcalMonthCell *self,
|
||||||
|
|||||||
Reference in New Issue
Block a user