glom r1877 - in trunk: . glom glom/libglom/document



Author: murrayc
Date: Tue Feb  3 17:25:13 2009
New Revision: 1877
URL: http://svn.gnome.org/viewvc/glom?rev=1877&view=rev

Log:
2009-02-03  Murray Cumming  <murrayc murrayc com>

* glom/glom_document.dtd: Mention the new self_hosted <connection> 
attribute.

Modified:
   trunk/ChangeLog
   trunk/glom/glom_document.dtd
   trunk/glom/libglom/document/document_glom.cc
   trunk/glom/libglom/document/document_glom.h

Modified: trunk/glom/glom_document.dtd
==============================================================================
--- trunk/glom/glom_document.dtd	(original)
+++ trunk/glom/glom_document.dtd	Tue Feb  3 17:25:13 2009
@@ -24,14 +24,16 @@
      server: The hostname of the PostgreSQL server.
      user: The PostgreSQL user.
      database: The name of the database to connect to on the PostgreSQL server.
-     self_hosted: Whether a local instance of Postgres should be started, to serve the data that is in a glom_postgres_data directory.      
+     self_hosted: Whether a local instance of PostgreSQL should be started, to serve the data that is in a glom_postgres_data directory. Deprecated in favor of host_mode.
+     hosting_mode: Can be "postgres_central" (self hosted via a local instance of PostgreSQL), "postgres_self" (a central PostgreSQL instance is used) or "sqlite" (self-hosted via a SQLite file).   
 -->
     <!ELEMENT connection EMPTY >
     <!ATTLIST connection
         server CDATA "localhost"
         user CDATA #IMPLIED
         database CDATA #REQUIRED
-        self_hosted (true|false) "false" >
+        self_hosted (true|false) "false" 
+        hosting_mode CDATA #IMPLIED>
 
 <!-- group(s) and table_privs are the permissions for each table.
       However, these are just initial permissions for examples. The real permissions are 

Modified: trunk/glom/libglom/document/document_glom.cc
==============================================================================
--- trunk/glom/libglom/document/document_glom.cc	(original)
+++ trunk/glom/libglom/document/document_glom.cc	Tue Feb  3 17:25:13 2009
@@ -48,8 +48,8 @@
 {
 
 #define GLOM_NODE_CONNECTION "connection"
-#define GLOM_ATTRIBUTE_CONNECTION_SELF_HOSTED "self_hosted"
-#define GLOM_ATTRIBUTE_CONNECTION_HOSTING_MODE "hosting_mode"
+#define GLOM_ATTRIBUTE_CONNECTION_SELF_HOSTED "self_hosted" //deprecated.
+#define GLOM_ATTRIBUTE_CONNECTION_HOSTING_MODE "hosting_mode" 
 #define GLOM_ATTRIBUTE_CONNECTION_HOSTING_POSTGRES_CENTRAL "postgres_central"
 #define GLOM_ATTRIBUTE_CONNECTION_HOSTING_POSTGRES_SELF "postgres_self"
 #define GLOM_ATTRIBUTE_CONNECTION_HOSTING_SQLITE "sqlite"
@@ -2294,8 +2294,8 @@
         if(attr_mode.empty())
         {
           // If no hosting mode is set, then try the self_hosted flag which
-          // was used before sqlite support has been implemented.
-          bool self_hosted = get_node_attribute_value_as_bool(nodeConnection, GLOM_ATTRIBUTE_CONNECTION_SELF_HOSTED);
+          // was used before sqlite support was implemented.
+          const bool self_hosted = get_node_attribute_value_as_bool(nodeConnection, GLOM_ATTRIBUTE_CONNECTION_SELF_HOSTED);
           mode = self_hosted ? POSTGRES_SELF_HOSTED : POSTGRES_CENTRAL_HOSTED;
         }
         else

Modified: trunk/glom/libglom/document/document_glom.h
==============================================================================
--- trunk/glom/libglom/document/document_glom.h	(original)
+++ trunk/glom/libglom/document/document_glom.h	Tue Feb  3 17:25:13 2009
@@ -110,13 +110,11 @@
 
   static guint get_latest_known_document_format_version();
 
-  enum HostingMode {
-    /* The database is hosted on an external postgresql server */
-    POSTGRES_CENTRAL_HOSTED,
-    /* A new postgres database process is spawned that hosts the data */
-    POSTGRES_SELF_HOSTED,
-    /* A sqlite database file is used */
-    SQLITE_HOSTED
+  enum HostingMode
+  {
+    POSTGRES_CENTRAL_HOSTED, /*!< The database is hosted on an external postgresql server. */
+    POSTGRES_SELF_HOSTED, /*!< A new postgres database process is spawned that hosts the data. */
+    SQLITE_HOSTED /*!< A sqlite database file is used. */
   };
 
   /** Set the hosting mode of the database.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]