[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] (no subject)
From: |
Greg Chicares |
Subject: |
[lmi-commits] (no subject) |
Date: |
Fri, 3 Jun 2016 21:31:03 +0000 (UTC) |
branch: master
commit 230bc7f31845cfb55f7840e1bd82cde83d4ff829
Author: Gregory W. Chicares <address@hidden>
Date: Fri Jun 3 20:16:07 2016 +0000
Improve default skin name
http://lists.nongnu.org/archive/html/lmi/2016-05/msg00121.html
| adapt the 'ce_product_names' logic, and default to
| 'skin.xrc' if it exists
---
ce_skin_name.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/ce_skin_name.cpp b/ce_skin_name.cpp
index b7f6417..8b26d8c 100644
--- a/ce_skin_name.cpp
+++ b/ce_skin_name.cpp
@@ -22,6 +22,7 @@
#include "ce_skin_name.hpp"
#include "alert.hpp"
+#include "contains.hpp"
#include "facets.hpp"
#include "global_settings.hpp"
#include "miscellany.hpp" // begins_with()
@@ -74,9 +75,16 @@ std::vector<std::string> const& skin_names()
return names;
}
+/// Default skin is 'skin.xrc' if that file exists,
+/// else the first skin file found.
+
std::string const& default_skin_name()
{
- static std::string const default_name("default");
+ static std::string const default_name =
+ contains(skin_names(), "skin.xrc")
+ ? std::string("skin.xrc")
+ : skin_names().front()
+ ;
return default_name;
}
} // Unnamed namespace.