! * returns the model containing the structure of the current project used for the preview in the import project dialog. * The caller takes over the ownership of the model. */
| 51 | * The caller takes over the ownership of the model. |
| 52 | */ |
| 53 | QAbstractItemModel* ProjectParser::model() { |
| 54 | WAIT_CURSOR; |
| 55 | PERFTRACE(QStringLiteral("project model for preview created")); |
| 56 | delete m_previewProject; |
| 57 | m_previewProject = new Project(); |
| 58 | |
| 59 | bool rc = load(m_previewProject, true); |
| 60 | AspectTreeModel* model = nullptr; |
| 61 | if (rc) { |
| 62 | model = new AspectTreeModel(m_previewProject); |
| 63 | model->setReadOnly(true); |
| 64 | } |
| 65 | |
| 66 | RESET_CURSOR; |
| 67 | return model; |
| 68 | } |
| 69 | |
| 70 | void ProjectParser::importTo(Folder* targetFolder, const QStringList& selectedPathes) { |
| 71 | DEBUG(Q_FUNC_INFO << ", starting import of " << STDSTRING(m_projectFileName)); |