summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2009-10-02 06:38:24 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2009-10-02 06:38:24 (GMT)
commit80e8cd071e05305d0fc70fa6d78991cf9b50d7e4 (patch)
tree9d7e2966cdd25d88418cef9d4e0b0e3490991c26
parent1b4596ee852eaa770064f2711a1b6445a6c4303d (diff)
downloadfluxbox_lack-80e8cd071e05305d0fc70fa6d78991cf9b50d7e4.zip
fluxbox_lack-80e8cd071e05305d0fc70fa6d78991cf9b50d7e4.tar.bz2
just use the FbTk API
-rw-r--r--src/Keys.cc5
-rw-r--r--util/fluxbox-update_configs.cc7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/Keys.cc b/src/Keys.cc
index 84e5eb8..0b8efe5 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -28,6 +28,7 @@
28 28
29#include "FbTk/EventManager.hh" 29#include "FbTk/EventManager.hh"
30#include "FbTk/StringUtil.hh" 30#include "FbTk/StringUtil.hh"
31#include "FbTk/FileUtil.hh"
31#include "FbTk/App.hh" 32#include "FbTk/App.hh"
32#include "FbTk/Command.hh" 33#include "FbTk/Command.hh"
33#include "FbTk/RefCount.hh" 34#include "FbTk/RefCount.hh"
@@ -276,6 +277,10 @@ void Keys::reload() {
276 277
277 FbTk::App::instance()->sync(false); 278 FbTk::App::instance()->sync(false);
278 279
280 if (! FbTk::FileUtil::isRegularFile(m_filename.c_str())) {
281 return;
282 }
283
279 // open the file 284 // open the file
280 ifstream infile(m_filename.c_str()); 285 ifstream infile(m_filename.c_str());
281 if (!infile) { 286 if (!infile) {
diff --git a/util/fluxbox-update_configs.cc b/util/fluxbox-update_configs.cc
index fcb9bc2..85bbbfe 100644
--- a/util/fluxbox-update_configs.cc
+++ b/util/fluxbox-update_configs.cc
@@ -22,6 +22,7 @@
22#include "../src/FbTk/I18n.hh" 22#include "../src/FbTk/I18n.hh"
23#include "../src/FbTk/Resource.hh" 23#include "../src/FbTk/Resource.hh"
24#include "../src/FbTk/StringUtil.hh" 24#include "../src/FbTk/StringUtil.hh"
25#include "../src/FbTk/FileUtil.hh"
25 26
26#include "defaults.hh" 27#include "defaults.hh"
27 28
@@ -473,11 +474,9 @@ string read_file(const string& filename) {
473 if (it != file_cache.end()) 474 if (it != file_cache.end())
474 return it->second; 475 return it->second;
475 476
476 struct stat s; 477 if (!FbTk::FileUtil::isRegularFile(filename.c_str())) {
477 stat(filename.c_str(), &s);
478
479 if (! (s.st_mode & S_IFREG))
480 return ""; 478 return "";
479 }
481 480
482 // nope, we'll have to read the file 481 // nope, we'll have to read the file
483 ifstream infile(filename.c_str()); 482 ifstream infile(filename.c_str());