glom r1941 - in trunk: . glom



Author: arminb
Date: Fri Feb 27 13:13:34 2009
New Revision: 1941
URL: http://svn.gnome.org/viewvc/glom?rev=1941&view=rev

Log:
2009-02-27  Armin Burgmeier  <armin openismus com>

	* glom/frame_glom.cc:
	(connection_request_password_and_choose_new_database_name): When
	creating a new self-hosting postgres database, then store the port it
	uses within the document, so that remote connections (using browse
	network) can connect to the newly created database. Bug #572982.


Modified:
   trunk/ChangeLog
   trunk/glom/frame_glom.cc

Modified: trunk/glom/frame_glom.cc
==============================================================================
--- trunk/glom/frame_glom.cc	(original)
+++ trunk/glom/frame_glom.cc	Fri Feb 27 13:13:34 2009
@@ -1880,6 +1880,20 @@
 
           document->set_connection_server(central->get_host());
         }
+        // Remember port if the document is self-hosted, so that remote
+        // connections to the database (usinc browse network) know what port to use.
+        // TODO: There is already similar code in
+        // connect_to_server_with_connection_settings, which is just not
+        // executed because it failed with no database present. We should
+        // somehow avoid this code duplication.
+        else if(document->get_hosting_mode() == Document_Glom::POSTGRES_SELF_HOSTED)
+        {
+          ConnectionPool::Backend* backend = connection_pool->get_backend();
+          ConnectionPoolBackends::PostgresSelfHosted* self = dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
+          g_assert(self != NULL);
+
+          document->set_connection_port(self->get_port());
+        }
 
         return true;
       }



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