diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2012-12-30 20:33:58 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2012-12-30 20:33:58 +0100 |
| commit | 571790ba31a48c108e42c4ae10f8e63ae734c376 (patch) | |
| tree | 89496b45ad6777abd4eced4b860e6b3ae9df0d60 /src | |
| parent | 6dd7e0f9073e366cb7420e8b61eacbc6c05faae5 (diff) | |
| download | cataract-571790ba31a48c108e42c4ae10f8e63ae734c376.tar.xz | |
setup: Introduce location section and reorganize
More and more we need to know local and public locations for various
features. Let's introduce general keys once and for all.
Diffstat (limited to 'src')
| -rw-r--r-- | src/atom-writer.c | 2 | ||||
| -rw-r--r-- | src/cgg.c | 6 | ||||
| -rw-r--r-- | src/setup.c | 8 | ||||
| -rw-r--r-- | src/setup.h | 5 |
4 files changed, 14 insertions, 7 deletions
diff --git a/src/atom-writer.c b/src/atom-writer.c index 8fa1ec8..51609bb 100644 --- a/src/atom-writer.c +++ b/src/atom-writer.c @@ -187,7 +187,7 @@ atom_writer_write_to_file (TAtomFeed *feed, const gchar *filename, TGallerySetup else { fprintf (f, " <entry>\n"); fprintf (f, " <title>%s</title>\n", item->title); - s = g_build_path ("/", setup->feed_base_url, item->path, "/", NULL); + s = g_build_path ("/", setup->location_base_url, item->path, "/", NULL); fprintf (f, " <link rel=\"alternate\" type=\"text/html\" href=\"%s\"/>\n", s); g_free (s); @@ -192,14 +192,14 @@ main (int argc, char* argv[]) if (news_feed) { if (verbose) printf ("Writing Atom feed: %s\n", setup->feed_filename); - if (setup->feed_base_url == NULL || strlen (setup->feed_base_url) == 0) + if (setup->location_base_url == NULL || strlen (setup->location_base_url) == 0) log_error ("Error: feed base URL not defined!\n"); else if (setup->feed_filename == NULL || strlen (setup->feed_filename) == 0) log_error ("Error: feed file name not defined!\n"); else { - atom_writer_set_base_url (news_feed, setup->feed_base_url); - s = g_build_filename (setup->feed_base_url, setup->feed_filename, NULL); + atom_writer_set_base_url (news_feed, setup->location_base_url); + s = g_build_filename (setup->location_base_url, setup->feed_filename, NULL); atom_writer_set_feed_url (news_feed, s); g_free (s); diff --git a/src/setup.c b/src/setup.c index f053555..c78b15f 100644 --- a/src/setup.c +++ b/src/setup.c @@ -122,7 +122,10 @@ parse_setup_xml (const gchar *filename) setup->feed_enabled = xml_file_get_node_attribute_boolean (xml, "/gallery_setup/feed", "enable", FALSE); setup->feed_filename = xml_file_get_node_value (xml, "/gallery_setup/feed/filename/text()"); setup->feed_title = xml_file_get_node_value (xml, "/gallery_setup/feed/title/text()"); - setup->feed_base_url = xml_file_get_node_value (xml, "/gallery_setup/feed/base_url/text()"); + + /* location section */ + setup->location_base_url = xml_file_get_node_value (xml, "/gallery_setup/location/base_url/text()"); + setup->location_local_path = xml_file_get_node_value (xml, "/gallery_setup/location/local_path/text()"); /* footer section */ setup->footer = xml_file_get_node_value (xml, "/gallery_setup/footer/text()"); @@ -379,7 +382,8 @@ free_setup_data (TGallerySetup *setup) g_free (setup->favicon_type); g_free (setup->feed_filename); g_free (setup->feed_title); - g_free (setup->feed_base_url); + g_free (setup->location_base_url); + g_free (setup->location_local_path); g_free (setup->footer); free_design_setup_data (setup->design); g_free (setup); diff --git a/src/setup.h b/src/setup.h index 7e4ce1e..c34d861 100644 --- a/src/setup.h +++ b/src/setup.h @@ -78,7 +78,10 @@ typedef struct { gboolean feed_enabled; gchar *feed_filename; gchar *feed_title; - gchar *feed_base_url; + + /* location section */ + gchar *location_base_url; + gchar *location_local_path; /* footer section */ gchar *footer; |
