aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-08-21 18:59:03 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 10:04:03 (GMT)
commitf8167651d152cbeea67ecec29a3676adde016b9f (patch)
tree3e3f79cc54397022590df3cb24502f1d184dbc3d
parent2d7bb686dabee9863bce55b929357a93e5eae2d6 (diff)
downloadfluxbox_paul-f8167651d152cbeea67ecec29a3676adde016b9f.zip
fluxbox_paul-f8167651d152cbeea67ecec29a3676adde016b9f.tar.bz2
Don't spam with the "Unable to convert ... from nil" messages
-rw-r--r--src/FbTk/Resource.hh10
-rw-r--r--src/Slit.cc6
2 files changed, 11 insertions, 5 deletions
diff --git a/src/FbTk/Resource.hh b/src/FbTk/Resource.hh
index b729ad4..e3e8cc1 100644
--- a/src/FbTk/Resource.hh
+++ b/src/FbTk/Resource.hh
@@ -257,9 +257,13 @@ public:
257 257
258 virtual void setFromLua(lua::state &l) { 258 virtual void setFromLua(lua::state &l) {
259 try { 259 try {
260 m_value = Traits::fromLua(l); 260 if(l.isnil(-1))
261 m_rm->resourceChanged(*this); 261 setDefaultValue();
262 m_modified_sig.emit(m_value); 262 else {
263 m_value = Traits::fromLua(l);
264 m_rm->resourceChanged(*this);
265 m_modified_sig.emit(m_value);
266 }
263 } 267 }
264 catch(ConversionError &e) { 268 catch(ConversionError &e) {
265 std::cerr << name() << ": " << e.what() << std::endl; 269 std::cerr << name() << ": " << e.what() << std::endl;
diff --git a/src/Slit.cc b/src/Slit.cc
index 1cf13cf..3c90eed 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -153,8 +153,10 @@ void Slit::SlitClientsRes::setFromLua(lua::state &l) {
153 SlitClients t; 153 SlitClients t;
154 154
155 if(l.type(-1) != lua::TTABLE) { 155 if(l.type(-1) != lua::TTABLE) {
156 std::cerr << "Cannot convert to a client list from lua type " 156 if(! l.isnil(-1)) {
157 << l.type_name(l.type(-1)) << std::endl; 157 std::cerr << "Cannot convert to a client list from lua type "
158 << l.type_name(l.type(-1)) << std::endl;
159 }
158 return; 160 return;
159 } 161 }
160 for(size_t i = 1; l.rawgeti(-1, i), !l.isnil(-1); l.pop(), ++i) { 162 for(size_t i = 1; l.rawgeti(-1, i), !l.isnil(-1); l.pop(), ++i) {