Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [ RESOLVED ] New in 4.7.4: QDir::homePath() gives out empty string
Forum Updated to NodeBB v4.3 + New Features

[ RESOLVED ] New in 4.7.4: QDir::homePath() gives out empty string

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 3.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ronM71
    wrote on last edited by
    #1

    @QString path = QDir::homePath(); // <-- "path" is always ""@

    Is this a new bug in 4.7.4? use to work well in 4.7.3.
    I'm on OSX Lion (4.7.3 worked on Lion well).

    1 Reply Last reply
    0
    • R Offline
      R Offline
      ronM71
      wrote on last edited by
      #2

      Hmmm It seems the problem is resolved if I don't use the "Clear System Environment". I unchecked it, then re-built and it worked fine.

      could it be the "SHELL" definitions? I can't think of anything other than that that's remotely related to this. I guess something caused Qt to have "QT_NO_FSFILEENGINE" defined and thus to return an empty string:

      @// from Qt source: QDir.cpp

      QString QDirPrivate()
      {
      #ifdef QT_NO_FSFILEENGINE
      return QString();
      #else
      return cleanPath(QFSFileEngine::homePath());
      #endif
      }@

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        The homePath is the content of the HOME environment variable on unix-like systems (this includes Mac OS X). If you clear the environment, that variable is reset too, so the home path is empty.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ronM71
          wrote on last edited by
          #4

          So, the "Clear system Environment" in Qt-Creator, causes those environment parameters to be "invisible" at runtime, for my system? If I deployed that same app on another machine, it would have been able to figure out the HOME string, right?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            [quote author="ronM71" date="1315349947"]So, the "Clear system Environment" in Qt-Creator, causes those environment parameters to be "invisible" at runtime, for my system? If I deployed that same app on another machine, it would have been able to figure out the HOME string, right?[/quote]

            Yes, so it is.

            Instead of "Clear system Environment" you could just override it and reset or adjust the settings of some of the variables. Or just set the HOME variable to its original value (usually /Users/username on the Mac, with username being the short name, not the full name).

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved