diff options
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r-- | src/mainwin.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc index 1ac96fa..a7b7a30 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -615,7 +615,9 @@ void MainWindow::refreshDocument() */ bool MainWindow::compile(bool reload, bool procevents) { + PRINT("compile"); if (!compileTopLevelDocument(reload)) return false; + PRINT("init render"); // Invalidate renderers before we kill the CSG tree this->qglview->setRenderer(NULL); @@ -1018,22 +1020,18 @@ bool MainWindow::fileChangedOnDisk() return false; } -// FIXME: The following two methods are duplicated in ModuleCache.cc - refactor -static bool is_modified(const std::string &filename, const time_t &mtime) -{ - struct stat st; - memset(&st, 0, sizeof(struct stat)); - stat(filename.c_str(), &st); - return (st.st_mtime > mtime); -} - bool MainWindow::includesChanged() { + PRINT("includes changed?"); if (this->root_module) { BOOST_FOREACH(const FileModule::IncludeContainer::value_type &item, this->root_module->includes) { - if (is_modified(item.first, item.second)) return true; + //std::cout<< item.first << "second" << item.second << "\n"; + //std::cout<< (is_modified(item.first, item.second)) <<"\n"; + if (this->root_module->include_modified(item.second)) + return true; } } + PRINT("includes not changed"); return false; } @@ -1046,6 +1044,7 @@ bool MainWindow::includesChanged() */ bool MainWindow::compileTopLevelDocument(bool reload) { + PRINT("compile top level"); bool shouldcompiletoplevel = !reload; if (includesChanged()) shouldcompiletoplevel = true; @@ -1056,6 +1055,7 @@ bool MainWindow::compileTopLevelDocument(bool reload) } if (shouldcompiletoplevel) { + PRINT("shouldcompile top level"); console->clear(); updateTemporalVariables(); |