Commit 1f634a70 authored by Ahmed Baïzid's avatar Ahmed Baïzid Committed by Andrew Miloradovsky
parent e9ecdb4e
......@@ -1073,7 +1073,7 @@ parser_build_xml_doc (MrpStorageMrproject *module,
gboolean
mrp_parser_save (MrpStorageMrproject *module,
const gchar *filename,
const gchar *uri,
gboolean force,
GError **error)
{
......@@ -1083,12 +1083,12 @@ mrp_parser_save (MrpStorageMrproject *module,
xmlDocPtr doc;
g_return_val_if_fail (MRP_IS_STORAGE_MRPROJECT (module), FALSE);
g_return_val_if_fail (filename != NULL && filename[0] != 0, FALSE);
g_return_val_if_fail (uri != NULL && uri[0] != 0, FALSE);
if (!strstr (filename, ".mrproject") && !strstr (filename, ".planner")) {
real_filename = g_strconcat (filename, ".planner", NULL);
if (!strstr (uri, ".mrproject") && !strstr (uri, ".planner")) {
real_filename = g_strconcat (uri, ".planner", NULL);
} else {
real_filename = g_strdup (filename);
real_filename = g_strdup (uri);
}
file_exist = g_file_test (
......
......@@ -56,17 +56,17 @@ typedef struct _MrpProjectPriv MrpProjectPriv;
/**
* MrpTaskTraverseFunc:
* @Param1:
* @Param2:
* @task: an #MrpTask
* @user_data: user data
*
* A function to use with mrp_project_task_traverse(). @task is the
* currently traversed task, and @data is the user data passed to the
* currently traversed task, and @user_data is the user data passed to the
* mrp_project_task_traverse(). The traversal can be stopped by returning
* %TRUE.
*
* Returns: %TRUE if the traversal is to be stopped.
*/
typedef gboolean (*MrpTaskTraverseFunc) (MrpTask*, gpointer);
typedef gboolean (*MrpTaskTraverseFunc) (MrpTask* task, gpointer user_data);
struct _MrpProject {
MrpObject parent;
......
......@@ -693,15 +693,15 @@ mrp_resource_get_short_name (MrpResource *resource)
/**
* mrp_resource_set_short_name:
* @resource: an #MrpResource
* @name: new short name of @resource
* @short_name: new short name of @resource
*
* Sets the short name of @resource.
**/
void mrp_resource_set_short_name (MrpResource *resource, const gchar *name)
void mrp_resource_set_short_name (MrpResource *resource, const gchar *short_name)
{
g_return_if_fail (MRP_IS_RESOURCE (resource));
mrp_object_set (MRP_OBJECT (resource), "short_name", name, NULL);
mrp_object_set (MRP_OBJECT (resource), "short_name", short_name, NULL);
}
/**
......
......@@ -1351,10 +1351,10 @@ stolen_g_date_get_iso8601_week_of_year (const GDate *d)
}
gint
mrp_time2_get_week_number (MrpTime *t, gint *y)
mrp_time2_get_week_number (MrpTime *t, gint *year)
{
gint week;
gint year;
gint y;
g_return_val_if_fail (t != NULL, 0);
......@@ -1363,25 +1363,25 @@ mrp_time2_get_week_number (MrpTime *t, gint *y)
/* Calculate the year this week belongs to as it can be different than
* the year of the date (e.g. December 31 2002 is in week 1 of 2003).
*/
if(y != NULL) {
year = g_date_get_year (&t->date);
if(year != NULL) {
y = g_date_get_year (&t->date);
switch(g_date_get_month (&t->date)) {
case G_DATE_JANUARY:
if(week > 50) {
year--;
y--;
}
break;
case G_DATE_DECEMBER:
if(week == 1) {
year++;
y++;
}
break;
default:
break;
}
*y = year;
*year = y;
}
return week;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment