171 void LDDocument::setImplicit (bool const& a) |
171 void LDDocument::setImplicit (bool const& a) |
172 { |
172 { |
173 if (m_isImplicit != a) |
173 if (m_isImplicit != a) |
174 { |
174 { |
175 m_isImplicit = a; |
175 m_isImplicit = a; |
|
176 print ("Setting implicity of %1 to %2\n", this, a ? "true" : "false"); |
176 |
177 |
177 if (a == false) |
178 if (a == false) |
178 { |
179 { |
179 g_explicitDocuments << self().toStrongRef(); |
180 g_explicitDocuments << self().toStrongRef(); |
180 print ("Opened %1", name()); |
181 print ("Opened %1", name()); |
184 if (g_win != null) |
185 if (g_win != null) |
185 g_win->R()->compiler()->compileDocument (self()); |
186 g_win->R()->compiler()->compileDocument (self()); |
186 } |
187 } |
187 else |
188 else |
188 { |
189 { |
|
190 print ("Removing %1 from explicit documents...\n", this); |
189 g_explicitDocuments.removeOne (self().toStrongRef()); |
191 g_explicitDocuments.removeOne (self().toStrongRef()); |
|
192 print ("Removed %1", this); |
190 print ("Closed %1", name()); |
193 print ("Closed %1", name()); |
191 int count = 0; |
|
192 |
|
193 for (LDObjectWeakPtr obj : g_allObjects) |
|
194 { |
|
195 if (obj == null) |
|
196 continue; |
|
197 |
|
198 LDSubfilePtr ref = obj.toStrongRef().dynamicCast<LDSubfile>(); |
|
199 |
|
200 if (ref != null and ref->fileInfo() == self()) |
|
201 count++; |
|
202 } |
|
203 } |
194 } |
204 |
195 |
205 if (g_win != null) |
196 if (g_win != null) |
206 g_win->updateDocumentList(); |
197 g_win->updateDocumentList(); |
207 |
198 |
1452 if (g_explicitDocuments.size() == 2 and |
1443 if (g_explicitDocuments.size() == 2 and |
1453 g_explicitDocuments[0]->name().isEmpty() and |
1444 g_explicitDocuments[0]->name().isEmpty() and |
1454 not g_explicitDocuments[1]->name().isEmpty() and |
1445 not g_explicitDocuments[1]->name().isEmpty() and |
1455 not g_explicitDocuments[0]->hasUnsavedChanges()) |
1446 not g_explicitDocuments[0]->hasUnsavedChanges()) |
1456 { |
1447 { |
1457 g_explicitDocuments[0]->dismiss(); |
1448 LDDocumentPtr filetoclose = g_explicitDocuments.first(); |
|
1449 filetoclose->dismiss(); |
1458 } |
1450 } |
1459 } |
1451 } |
1460 |
1452 |
1461 // ============================================================================= |
1453 // ============================================================================= |
1462 // |
1454 // |