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 cef5a416e9
commit b47c0fc3a3
1 changed files with 9 additions and 7 deletions

View File

@ -117,13 +117,11 @@ LibraryController::can_exit (lay::PluginRoot * /*root*/) const
void void
LibraryController::sync_files () LibraryController::sync_files ()
{ {
if (! m_file_watcher) { if (m_file_watcher) {
return; 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; std::map<std::string, std::pair<std::string, QDateTime> > new_lib_files;
// build a list of paths vs. technology // 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")); QDir lp = QDir (tl::to_qstring (p->first)).filePath (tl::to_qstring ("libraries"));
if (lp.exists ()) { 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; QStringList name_filters;
name_filters << QString::fromUtf8 ("*"); 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 // remove libraries which are no longer present