Skip to content

Commit

Permalink
Fixed #139 (libraries not reassigned to GDS when loading file from co…
Browse files Browse the repository at this point in the history
…mmand line).
  • Loading branch information
klayoutmatthias committed Jun 27, 2018
1 parent cef5a41 commit b47c0fc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/lay/lay/layLibraryController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ LibraryController::can_exit (lay::PluginRoot * /*root*/) const
void
LibraryController::sync_files ()
{
if (! m_file_watcher) {
return;
if (m_file_watcher) {
m_file_watcher->clear ();
m_file_watcher->enable (false);
}

m_file_watcher->clear ();
m_file_watcher->enable (false);

std::map<std::string, std::pair<std::string, QDateTime> > new_lib_files;

// build a list of paths vs. technology
Expand Down Expand Up @@ -158,7 +156,9 @@ LibraryController::sync_files ()
QDir lp = QDir (tl::to_qstring (p->first)).filePath (tl::to_qstring ("libraries"));
if (lp.exists ()) {

m_file_watcher->add_file (tl::to_string (lp.absolutePath ()));
if (m_file_watcher) {
m_file_watcher->add_file (tl::to_string (lp.absolutePath ()));
}

QStringList name_filters;
name_filters << QString::fromUtf8 ("*");
Expand Down Expand Up @@ -222,7 +222,9 @@ LibraryController::sync_files ()

}

m_file_watcher->enable (true);
if (m_file_watcher) {
m_file_watcher->enable (true);
}

// remove libraries which are no longer present

Expand Down

0 comments on commit b47c0fc

Please sign in to comment.