-rw-r--r-- | qmake/tools/qfileinfo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qmake/tools/qfileinfo.cpp b/qmake/tools/qfileinfo.cpp index 3af7932..a78f4fa 100644 --- a/qmake/tools/qfileinfo.cpp +++ b/qmake/tools/qfileinfo.cpp | |||
@@ -626,34 +626,36 @@ QDateTime QFileInfo::lastRead() const | |||
626 | /*! | 626 | /*! |
627 | Returns the absolute path including the file name. | 627 | Returns the absolute path including the file name. |
628 | 628 | ||
629 | The absolute path name consists of the full path and the file | 629 | The absolute path name consists of the full path and the file |
630 | name. On Unix this will always begin with the root, '/', | 630 | name. On Unix this will always begin with the root, '/', |
631 | directory. On Windows this will always begin 'D:/' where D is a | 631 | directory. On Windows this will always begin 'D:/' where D is a |
632 | drive letter, except for network shares that are not mapped to a | 632 | drive letter, except for network shares that are not mapped to a |
633 | drive letter, in which case the path will begin '//sharename/'. | 633 | drive letter, in which case the path will begin '//sharename/'. |
634 | 634 | ||
635 | This function returns the same as filePath(), unless isRelative() | 635 | This function returns the same as filePath(), unless isRelative() |
636 | is TRUE. | 636 | is TRUE. |
637 | 637 | ||
638 | If the QFileInfo is empty it returns QDir::currentDirPath(). | ||
639 | |||
638 | This function can be time consuming under Unix (in the order of | 640 | This function can be time consuming under Unix (in the order of |
639 | milliseconds). | 641 | milliseconds). |
640 | 642 | ||
641 | \sa isRelative(), filePath() | 643 | \sa isRelative(), filePath() |
642 | */ | 644 | */ |
643 | QString QFileInfo::absFilePath() const | 645 | QString QFileInfo::absFilePath() const |
644 | { | 646 | { |
645 | QString tmp; | 647 | QString tmp; |
646 | if ( QDir::isRelativePath(fn) | 648 | if ( QDir::isRelativePath(fn) |
647 | #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) | 649 | #if defined(Q_OS_WIN32) |
648 | && fn[1] != ':' | 650 | && fn[1] != ':' |
649 | #endif | 651 | #endif |
650 | ) { | 652 | ) { |
651 | tmp = QDir::currentDirPath(); | 653 | tmp = QDir::currentDirPath(); |
652 | tmp += '/'; | 654 | tmp += '/'; |
653 | } | 655 | } |
654 | tmp += fn; | 656 | tmp += fn; |
655 | makeAbs( tmp ); | 657 | makeAbs( tmp ); |
656 | return QDir::cleanDirPath( tmp ); | 658 | return QDir::cleanDirPath( tmp ); |
657 | } | 659 | } |
658 | 660 | ||
659 | #endif | 661 | #endif |