summaryrefslogtreecommitdiff
path: root/qmake/tools/qfileinfo.cpp
Unidiff
Diffstat (limited to 'qmake/tools/qfileinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/tools/qfileinfo.cpp4
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
@@ -614,46 +614,48 @@ QDateTime QFileInfo::lastRead() const
614 if ( !fic || !cache ) 614 if ( !fic || !cache )
615 doStat(); 615 doStat();
616 if ( fic && fic->st.st_atime != 0 ) { 616 if ( fic && fic->st.st_atime != 0 ) {
617 dt.setTime_t( fic->st.st_atime ); 617 dt.setTime_t( fic->st.st_atime );
618 return dt; 618 return dt;
619 } else { 619 } else {
620 return lastModified(); 620 return lastModified();
621 } 621 }
622} 622}
623 623
624#ifndef QT_NO_DIR 624#ifndef QT_NO_DIR
625 625
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*/
643QString QFileInfo::absFilePath() const 645QString 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