aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-10-23 21:46:16 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-10-23 21:46:16 +0800
commita668b294887993db872ba94f5ecd3f0375b8c398 (patch)
treea53ccca2ab0bdf8ac941ec75ba4c44832f6dbede /calendar/gui
parent96a009288c6eb8cf05a77049662659483dd34f61 (diff)
downloadgsoc2013-evolution-a668b294887993db872ba94f5ecd3f0375b8c398.tar.gz
gsoc2013-evolution-a668b294887993db872ba94f5ecd3f0375b8c398.tar.zst
gsoc2013-evolution-a668b294887993db872ba94f5ecd3f0375b8c398.zip
Fixes #32613
2002-10-23 Rodrigo Moya <rodrigo@ximian.com> Fixes #32613 * gui/component-factory.c (sc_user_create_new_item_cb): use the default calendar/tasks folder to activate the component editor. (get_data_uri): deal correctly with the URIs being used. svn path=/trunk/; revision=18415
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-component.c35
-rw-r--r--calendar/gui/component-factory.c35
2 files changed, 50 insertions, 20 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 82dfc8b575..aa33766260 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -542,10 +542,11 @@ get_data_uri (const char *uri, CalComponentVType vtype)
if (uri) {
if (*uri != '/' && strncmp (uri, "file:", 5) != 0)
return g_strdup (uri);
+
if (vtype == CAL_COMPONENT_EVENT)
- return g_concat_dir_and_file (uri, "calendar.ics");
+ return cal_util_expand_uri ((char *) uri, FALSE);
else if (vtype == CAL_COMPONENT_TODO)
- return g_concat_dir_and_file (uri, "tasks.ics");
+ return cal_util_expand_uri ((char *) uri, TRUE);
else
g_assert_not_reached ();
} else {
@@ -631,34 +632,48 @@ sc_user_create_new_item_cb (EvolutionShellComponent *shell_component,
const char *parent_folder_physical_uri,
const char *parent_folder_type)
{
+ char *tmp_uri;
+
if (strcmp (id, CREATE_EVENT_ID) == 0) {
if (type_is_calendar (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_calendar_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT);
+ g_free (tmp_uri);
+ }
} else if (strcmp (id, CREATE_ALLDAY_EVENT_ID) == 0) {
if (type_is_calendar (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_ALLDAY_EVENT);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_calendar_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_ALLDAY_EVENT);
+ g_free (tmp_uri);
+ }
} else if (strcmp (id, CREATE_MEETING_ID) == 0) {
if (type_is_calendar (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_calendar_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING);
+ g_free (tmp_uri);
+ }
} else if (strcmp (id, CREATE_TASK_ID) == 0) {
if (type_is_tasks (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_tasks_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO);
+ g_free (tmp_uri);
+ }
} else
g_assert_not_reached ();
}
diff --git a/calendar/gui/component-factory.c b/calendar/gui/component-factory.c
index 82dfc8b575..aa33766260 100644
--- a/calendar/gui/component-factory.c
+++ b/calendar/gui/component-factory.c
@@ -542,10 +542,11 @@ get_data_uri (const char *uri, CalComponentVType vtype)
if (uri) {
if (*uri != '/' && strncmp (uri, "file:", 5) != 0)
return g_strdup (uri);
+
if (vtype == CAL_COMPONENT_EVENT)
- return g_concat_dir_and_file (uri, "calendar.ics");
+ return cal_util_expand_uri ((char *) uri, FALSE);
else if (vtype == CAL_COMPONENT_TODO)
- return g_concat_dir_and_file (uri, "tasks.ics");
+ return cal_util_expand_uri ((char *) uri, TRUE);
else
g_assert_not_reached ();
} else {
@@ -631,34 +632,48 @@ sc_user_create_new_item_cb (EvolutionShellComponent *shell_component,
const char *parent_folder_physical_uri,
const char *parent_folder_type)
{
+ char *tmp_uri;
+
if (strcmp (id, CREATE_EVENT_ID) == 0) {
if (type_is_calendar (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_calendar_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT);
+ g_free (tmp_uri);
+ }
} else if (strcmp (id, CREATE_ALLDAY_EVENT_ID) == 0) {
if (type_is_calendar (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_ALLDAY_EVENT);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_calendar_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_ALLDAY_EVENT);
+ g_free (tmp_uri);
+ }
} else if (strcmp (id, CREATE_MEETING_ID) == 0) {
if (type_is_calendar (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_calendar_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING);
+ g_free (tmp_uri);
+ }
} else if (strcmp (id, CREATE_TASK_ID) == 0) {
if (type_is_tasks (parent_folder_type))
create_component (parent_folder_physical_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO);
- else
- create_component (NULL,
+ else {
+ tmp_uri = calendar_config_default_tasks_folder ();
+ create_component (tmp_uri,
GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO);
+ g_free (tmp_uri);
+ }
} else
g_assert_not_reached ();
}