diff options
author | Marius Kintel <marius@kintel.net> | 2013-05-28 20:29:53 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-05-28 20:29:53 (GMT) |
commit | 5722dd9e411ed52a0b840afc47b468c3ed1970c1 (patch) | |
tree | 7871561c0a2a83a6c86886442ebe3e7ddb36049c /src/mainwin.cc | |
parent | c0fa353e063c2075f6e1920f483bfa7142c4345e (diff) |
Minor refactoring, no longer automatically reloads if a dependency disappears
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r-- | src/mainwin.cc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc index 52b432c..9652d6c 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -636,11 +636,12 @@ void MainWindow::compile(bool reload, bool forcedone) shouldcompiletoplevel = true; } - if (!shouldcompiletoplevel && includesChanged()) { + if (!shouldcompiletoplevel && this->root_module && this->root_module->includesChanged()) { shouldcompiletoplevel = true; } if (shouldcompiletoplevel) { + console->clear(); compileTopLevelDocument(); didcompile = true; } @@ -655,8 +656,8 @@ void MainWindow::compile(bool reload, bool forcedone) // If we're auto-reloading, listen for a cascade of changes by starting a timer // if something changed _and_ there are any external dependencies if (reload && didcompile && this->root_module) { - if (this->root_module->includes.size() > 0 || - this->root_module->usedlibs.size() > 0) { + if (this->root_module->hasIncludes() || + this->root_module->usesLibraries()) { this->waitAfterReloadTimer->start(); return; } @@ -1116,23 +1117,11 @@ bool MainWindow::fileChangedOnDisk() return false; } -bool MainWindow::includesChanged() -{ - if (this->root_module) { - BOOST_FOREACH(const FileModule::IncludeContainer::value_type &item, this->root_module->includes) { - if (this->root_module->include_modified(item.second)) return true; - } - } - return false; -} - /*! Returns true if anything was compiled. */ void MainWindow::compileTopLevelDocument() { - console->clear(); - updateTemporalVariables(); this->last_compiled_doc = editor->toPlainText(); @@ -1233,7 +1222,6 @@ void MainWindow::actionRenderCSG() GuiLocker::lock(); autoReloadTimer->stop(); setCurrentOutput(); - console->clear(); PRINT("Parsing design (AST generation)..."); QApplication::processEvents(); @@ -1278,7 +1266,6 @@ void MainWindow::actionRenderCGAL() GuiLocker::lock(); autoReloadTimer->stop(); setCurrentOutput(); - console->clear(); PRINT("Parsing design (AST generation)..."); QApplication::processEvents(); |