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

QTemporaryFile - location changed after remove() used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.4.1
    • Fix Version/s: 5.5.1
    • Component/s: Core: Other
    • Labels:
      None
    • Commits:
      02418d1aaa6760e08d55f0f6213d02d56b057fd2

      Description

      Location of temporary file changes from real temp directory to executable directory, when remove function is used.

      #include <QCoreApplication>
      #include <QTemporaryFile>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          QTemporaryFile tmpFile;
      
          if (tmpFile.open())
              qDebug() << tmpFile.fileName();
      
          tmpFile.remove();
      
          if (tmpFile.open())
              qDebug() << tmpFile.fileName();
      
          //return a.exec();
          return 0;
      }
      

      This is result:

      "C:/Users/theuerom/AppData/Local/Temp/tmpfiletest.Hp3912"
      "C:/Qt5_projects/build-tmpfiletest-Desktop_Qt_5_4_1_MinGW_32bit-Debug/.gq3912"
      

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-46156
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              thiago Thiago Macieira
              Reporter:
              rth Roman Theuer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes