Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-15695

Remove Model::possibleImports

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • Model and Rewriter
    • None

      We do some filtering in the item library, which is already done in the project storage. There is simply no need for that, and it makes the code complex and slow.

      For example, the following code collects information we already have in the project storage.

      QmlDesigner::Imports createPossibleFileImports(const Utils::FilePath &path)
      {
          auto folder = path.parentDir();
          QmlDesigner::Imports imports;
      
          /* Creates imports for all sub folder that contain a qml file. */
          folder.iterateDirectory(
              [&](const Utils::FilePath &item) {
                  bool append = false;
      
                  item.iterateDirectory(
                      [&](const Utils::FilePath &) {
                          append = true;
                          return Utils::IterationPolicy::Stop;
                      },
                      {{"*.qml"}, QDir::Files});
                  if (append)
                      imports.append(QmlDesigner::Import::createFileImport(item.fileName()));
                  return Utils::IterationPolicy::Continue;
              },
              {{}, QDir::Dirs | QDir::NoDotAndDotDot});
      
          return imports;
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thohartm Thomas Hartmann
            bubke Marco Bubke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes