just use the FbTk API
This commit is contained in:
parent
1b4596ee85
commit
80e8cd071e
2 changed files with 8 additions and 4 deletions
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "FbTk/EventManager.hh"
|
#include "FbTk/EventManager.hh"
|
||||||
#include "FbTk/StringUtil.hh"
|
#include "FbTk/StringUtil.hh"
|
||||||
|
#include "FbTk/FileUtil.hh"
|
||||||
#include "FbTk/App.hh"
|
#include "FbTk/App.hh"
|
||||||
#include "FbTk/Command.hh"
|
#include "FbTk/Command.hh"
|
||||||
#include "FbTk/RefCount.hh"
|
#include "FbTk/RefCount.hh"
|
||||||
|
@ -276,6 +277,10 @@ void Keys::reload() {
|
||||||
|
|
||||||
FbTk::App::instance()->sync(false);
|
FbTk::App::instance()->sync(false);
|
||||||
|
|
||||||
|
if (! FbTk::FileUtil::isRegularFile(m_filename.c_str())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// open the file
|
// open the file
|
||||||
ifstream infile(m_filename.c_str());
|
ifstream infile(m_filename.c_str());
|
||||||
if (!infile) {
|
if (!infile) {
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "../src/FbTk/I18n.hh"
|
#include "../src/FbTk/I18n.hh"
|
||||||
#include "../src/FbTk/Resource.hh"
|
#include "../src/FbTk/Resource.hh"
|
||||||
#include "../src/FbTk/StringUtil.hh"
|
#include "../src/FbTk/StringUtil.hh"
|
||||||
|
#include "../src/FbTk/FileUtil.hh"
|
||||||
|
|
||||||
#include "defaults.hh"
|
#include "defaults.hh"
|
||||||
|
|
||||||
|
@ -473,11 +474,9 @@ string read_file(const string& filename) {
|
||||||
if (it != file_cache.end())
|
if (it != file_cache.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
struct stat s;
|
if (!FbTk::FileUtil::isRegularFile(filename.c_str())) {
|
||||||
stat(filename.c_str(), &s);
|
|
||||||
|
|
||||||
if (! (s.st_mode & S_IFREG))
|
|
||||||
return "";
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
// nope, we'll have to read the file
|
// nope, we'll have to read the file
|
||||||
ifstream infile(filename.c_str());
|
ifstream infile(filename.c_str());
|
||||||
|
|
Loading…
Reference in a new issue