Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1332

Search paths require all paths to exist to function properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • None
    • Core: I/O
    • None

    Description

      Search paths behave in an unexpected way if not all paths exist. See example below.

      The behaviour came through the /etc/data/myfile.txt did not exits and
      the "data:" was then not resolved.

      Here is an [...] example which shows this behaviour (/home/jryannel/menu.xml exists and /home/jryannel/menu2.xml does not exists).

      – source –
      #include <QtCore>

      int main(int argc, char **argv)
      {
      QDir::addSearchPath("data", "/home/jryannel/");
      qDebug() << "data search path" << QDir::searchPaths("data");
      QFile file("data:menu.xml");
      qDebug() << "data file path" << QFileInfo(file).absoluteFilePath();
      qDebug() << "file exits " << QFile("/home/jryannel/menu.xml").exists();
      qDebug() << "file exits " << QFile("data:menu.xml").exists();
      QFile file2("data:menu2.xml");
      qDebug() << "data file2 path" << QFileInfo(file2).absoluteFilePath();
      qDebug() << "file2 exits " << QFile("/home/jryannel/menu2.xml").exists();
      qDebug() << "file2 exits " << QFile("data:menu2.xml").exists();
      return 0;
      }

      — output
      jryannel@groenland:~/projects/ex/ex5$ ./ex5
      data search path ("/home/jryannel/")
      data file path "/home/jryannel/menu.xml"
      file exits true
      file exits true
      data file2 path "/home/jryannel/projects/ex/ex5/data:menu2.xml" // not resolved, because does not exists
      file2 exits false
      file2 exits false

      Attachments

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

        Activity

          People

            stormols Marius Storm-Olsen
            hanssen Andreas Aardal Hanssen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes