summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-05-19 20:14:05 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-05-19 20:14:05 (GMT)
commit24e726fb58d2eca9e18575ffb76e547f958608de (patch)
tree18ca1837beb4bfea67c3d5a46f3cc4fee4689165 /src/mainwin.cc
parente25fff81af72a31f6118f4840b65193aa0ec1d0a (diff)
first refactoring towards fixing issue364
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 5f9d633..e1369bf 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -1021,16 +1021,23 @@ bool MainWindow::fileChangedOnDisk()
// FIXME: The following two methods are duplicated in ModuleCache.cc - refactor
static bool is_modified(const std::string &filename, const time_t &mtime)
{
+ bool modified = false;
struct stat st;
memset(&st, 0, sizeof(struct stat));
- stat(filename.c_str(), &st);
- return (st.st_mtime > mtime);
+ bool success = stat(filename.c_str(), &st)==0;
+ std::cout <<"success" << success << ":" << filename << "\n";
+ if (success) modified = st.st_mtime > mtime;
+ else modified = true;
+ return modified;
}
+#include <iostream>
bool MainWindow::includesChanged()
{
if (this->root_module) {
BOOST_FOREACH(const FileModule::IncludeContainer::value_type &item, this->root_module->includes) {
+ std::cout<< item.first << "second" << item.second << "\n";
+ std::cout<< (is_modified(item.first, item.second)) <<"\n";
if (is_modified(item.first, item.second)) return true;
}
}
contact: Jan Huwald // Impressum