]> Dogcows Code - chaz/openbox/commitdiff
check to make sure the style config could be loaded
authorDana Jansens <danakj@orodu.net>
Sat, 16 Nov 2002 12:12:38 +0000 (12:12 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 16 Nov 2002 12:12:38 +0000 (12:12 +0000)
otk/application.cc

index 490486ecd21e9e88d2ec09a44e5439ea24328285..16b9e0f5cbe57915c24da28b2799c4d071476817 100644 (file)
@@ -1,6 +1,12 @@
 #include "application.hh"
 #include "eventhandler.hh"
 
+extern "C" {
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+}
+
 #include <iostream>
 
 namespace otk {
@@ -35,8 +41,12 @@ OtkApplication::~OtkApplication()
 void OtkApplication::loadStyle(void)
 {
   // find the style name as a property
-  _style_conf->setFile("/usr/local/share/openbox/styles/artwiz");
-  _style_conf->load();
+  std::string style = "/usr/local/share/openbox/styles/artwiz";
+  _style_conf->setFile(style);
+  if (!_style_conf->load()) {
+    std::cerr << "Unable to load style \"" << style << "\". Aborting.\n";
+    ::exit(1);
+  }
   _style->load(*_style_conf);
 }
 
This page took 0.024309 seconds and 4 git commands to generate.