Ticket #50 (new defect)

Opened 3 months ago

Reconsider implementation of QString QDir::canonicalPath()

Reported by: rudi Owned by: dmik
Priority: normal Milestone:
Component: 3rdparty Version:
Severity: normal Keywords:
Cc: Blocking:
Blocked By:

Description

The current implementation temporary changes the current directory. This can lead to problems in a multithreaded environment. Suggested workaround:

QString QDir::canonicalPath() const
{
  QString r;
  char tmp[PATH_MAX];

  if( DosQueryPathInfo( QFile::encodeName( dPath ),
                    FIL_QUERYFULLNAME, tmp, sizeof(tmp) ) == 0 )
    r = QFile::decodeName( tmp );
  else
    r = dPath;

  slashify( r );
  return r;
}

Note: See TracTickets for help on using tickets.