-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 | |||
@@ -542,118 +542,120 @@ bool QFileInfo::convertToAbs() | |||
542 | if the size is 0 or if the size cannot be fetched. | 542 | if the size is 0 or if the size cannot be fetched. |
543 | */ | 543 | */ |
544 | #if defined(QT_ABI_QT4) | 544 | #if defined(QT_ABI_QT4) |
545 | QIODevice::Offset QFileInfo::size() const | 545 | QIODevice::Offset QFileInfo::size() const |
546 | #else | 546 | #else |
547 | uint QFileInfo::size() const | 547 | uint QFileInfo::size() const |
548 | #endif | 548 | #endif |
549 | { | 549 | { |
550 | if ( !fic || !cache ) | 550 | if ( !fic || !cache ) |
551 | doStat(); | 551 | doStat(); |
552 | if ( fic ) | 552 | if ( fic ) |
553 | #if defined(QT_ABI_QT4) | 553 | #if defined(QT_ABI_QT4) |
554 | return (QIODevice::Offset)fic->st.st_size; | 554 | return (QIODevice::Offset)fic->st.st_size; |
555 | #elif defined(QT_LARGEFILE_SUPPORT) | 555 | #elif defined(QT_LARGEFILE_SUPPORT) |
556 | return (uint)fic->st.st_size > UINT_MAX ? UINT_MAX : (uint)fic->st.st_size; | 556 | return (uint)fic->st.st_size > UINT_MAX ? UINT_MAX : (uint)fic->st.st_size; |
557 | #else | 557 | #else |
558 | return (uint)fic->st.st_size; | 558 | return (uint)fic->st.st_size; |
559 | #endif | 559 | #endif |
560 | else | 560 | else |
561 | return 0; | 561 | return 0; |
562 | } | 562 | } |
563 | 563 | ||
564 | /*! | 564 | /*! |
565 | Returns the date and time when the file was created. | 565 | Returns the date and time when the file was created. |
566 | 566 | ||
567 | On platforms where this information is not available, returns the | 567 | On platforms where this information is not available, returns the |
568 | same as lastModified(). | 568 | same as lastModified(). |
569 | 569 | ||
570 | \sa created() lastModified() lastRead() | 570 | \sa created() lastModified() lastRead() |
571 | */ | 571 | */ |
572 | 572 | ||
573 | QDateTime QFileInfo::created() const | 573 | QDateTime QFileInfo::created() const |
574 | { | 574 | { |
575 | QDateTime dt; | 575 | QDateTime dt; |
576 | if ( !fic || !cache ) | 576 | if ( !fic || !cache ) |
577 | doStat(); | 577 | doStat(); |
578 | if ( fic && fic->st.st_ctime != 0 ) { | 578 | if ( fic && fic->st.st_ctime != 0 ) { |
579 | dt.setTime_t( fic->st.st_ctime ); | 579 | dt.setTime_t( fic->st.st_ctime ); |
580 | return dt; | 580 | return dt; |
581 | } else { | 581 | } else { |
582 | return lastModified(); | 582 | return lastModified(); |
583 | } | 583 | } |
584 | } | 584 | } |
585 | 585 | ||
586 | /*! | 586 | /*! |
587 | Returns the date and time when the file was last modified. | 587 | Returns the date and time when the file was last modified. |
588 | 588 | ||
589 | \sa created() lastModified() lastRead() | 589 | \sa created() lastModified() lastRead() |
590 | */ | 590 | */ |
591 | 591 | ||
592 | QDateTime QFileInfo::lastModified() const | 592 | QDateTime QFileInfo::lastModified() const |
593 | { | 593 | { |
594 | QDateTime dt; | 594 | QDateTime dt; |
595 | if ( !fic || !cache ) | 595 | if ( !fic || !cache ) |
596 | doStat(); | 596 | doStat(); |
597 | if ( fic ) | 597 | if ( fic ) |
598 | dt.setTime_t( fic->st.st_mtime ); | 598 | dt.setTime_t( fic->st.st_mtime ); |
599 | return dt; | 599 | return dt; |
600 | } | 600 | } |
601 | 601 | ||
602 | /*! | 602 | /*! |
603 | Returns the date and time when the file was last read (accessed). | 603 | Returns the date and time when the file was last read (accessed). |
604 | 604 | ||
605 | On platforms where this information is not available, returns the | 605 | On platforms where this information is not available, returns the |
606 | same as lastModified(). | 606 | same as lastModified(). |
607 | 607 | ||
608 | \sa created() lastModified() lastRead() | 608 | \sa created() lastModified() lastRead() |
609 | */ | 609 | */ |
610 | 610 | ||
611 | QDateTime QFileInfo::lastRead() const | 611 | QDateTime QFileInfo::lastRead() const |
612 | { | 612 | { |
613 | QDateTime dt; | 613 | QDateTime dt; |
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 | */ |
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 |