|
From: <br...@us...> - 2009-05-29 03:23:46
|
Revision: 3915
http://openvrml.svn.sourceforge.net/openvrml/?rev=3915&view=rev
Author: braden
Date: 2009-05-29 03:23:40 +0000 (Fri, 29 May 2009)
Log Message:
-----------
Don't propagate an exception if OpenVRML's registry key has not been set.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/libopenvrml/openvrml/local/conf.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-05-28 05:07:50 UTC (rev 3914)
+++ trunk/ChangeLog 2009-05-29 03:23:40 UTC (rev 3915)
@@ -1,5 +1,18 @@
2009-05-28 Braden McDaniel <br...@en...>
+ Don't propagate an exception if OpenVRML's registry key has not
+ been set.
+
+ * src/libopenvrml/openvrml/local/conf.cpp
+ (no_registry_key): Exception to indicate that a registry key was
+ not found.
+ (get_registry_setting(const std::string &): Throw no_registry_key
+ if OpenVRML's key is not found.
+ (openvrml::local::conf::node_path()): Swallow no_registry_key.
+ (openvrml::local::conf::script_path()): Swallow no_registry_key.
+
+2009-05-28 Braden McDaniel <br...@en...>
+
Link with the /MD variant of FreeType.
* ide-projects/Windows/VisualC9_0/OpenVRML/vrml97/vrml97.vcproj
Modified: trunk/src/libopenvrml/openvrml/local/conf.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/local/conf.cpp 2009-05-28 05:07:50 UTC (rev 3914)
+++ trunk/src/libopenvrml/openvrml/local/conf.cpp 2009-05-29 03:23:40 UTC (rev 3915)
@@ -107,6 +107,11 @@
return std::string(&data.front(), &data.front() + size - 1);
}
+ class no_registry_key : public std::runtime_error {
+ public:
+ no_registry_key(): std::runtime_error("no registry key") {}
+ };
+
const std::string get_registry_setting(const std::string & name)
OPENVRML_THROW2(std::runtime_error, std::bad_alloc)
{
@@ -118,6 +123,7 @@
KEY_READ,
&key);
if (result != ERROR_SUCCESS) {
+ if (result == ERROR_FILE_NOT_FOUND) { throw no_registry_key(); }
throw_runtime_error(result);
}
@@ -171,7 +177,9 @@
std::string system_path;
# ifdef _WIN32
- system_path = get_registry_setting("NodePath");
+ try {
+ system_path = get_registry_setting("NodePath");
+ } catch (no_registry_key &) {}
# else
system_path = OPENVRML_PKGLIBDIR_ "/node";
# endif
@@ -191,7 +199,9 @@
std::string system_path;
# ifdef _WIN32
- system_path = get_registry_setting("ScriptPath");
+ try {
+ system_path = get_registry_setting("ScriptPath");
+ } catch (no_registry_key &) {}
# else
system_path = OPENVRML_PKGLIBDIR_ "/script";
# endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|