Fixed #139 (libraries not reassigned to GDS when loading file from command line).

This commit is contained in:
Matthias Koefferlein 2018-06-27 23:36:30 +02:00
parent 23842be0e8
commit 89e8fb08ae
1 changed files with 9 additions and 7 deletions

View File

@ -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
@ -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 ("*");
@ -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