#include "qatomic.h"
#include "qlist.h"
#include "qstring.h"
+#include "qdatetime.h"
#include <poll.h>
#include <string.h>
{ return m_uid; }
inline gid_t groupId() const
{ return m_gid; }
+ inline QDateTime lastModified() const
+ { return QDateTime::fromTime_t(m_mtime); }
inline bool exists() const
{ return (m_mode != 0); }
inline bool isFile() const
#include "qurlinfo.h"
#include "qdir.h"
#include "qnoncontiguousbytedevice_p.h"
-
-#include <QtCore/QCoreApplication>
+#include "qcoreapplication.h"
+#include "qcore_unix_p.h"
QT_BEGIN_NAMESPACE
bool QNetworkAccessFileBackend::loadFileInfo()
{
- QFileInfo fi(file);
- setHeader(QNetworkRequest::LastModifiedHeader, fi.lastModified());
- setHeader(QNetworkRequest::ContentLengthHeader, fi.size());
+ QStatInfo si(file.fileName());
+ setHeader(QNetworkRequest::LastModifiedHeader, si.lastModified());
+ setHeader(QNetworkRequest::ContentLengthHeader, qint64(si.size()));
// signal we're open
metaDataChanged();
- if (fi.isDir()) {
+ if (si.isDir()) {
error(QNetworkReply::ContentOperationNotPermittedError,
QCoreApplication::translate("QNetworkAccessFileBackend", "Cannot open %1: Path is a directory").arg(url().toString()));
finished();
****************************************************************************/
#include "qnetworkreplyfileimpl_p.h"
-
-#include "QtCore/qdatetime.h"
-#include <QtCore/QCoreApplication>
-#include <QtCore/QFileInfo>
-#include <QDebug>
+#include "qdatetime.h"
+#include "qcoreapplication.h"
+#include "qdebug.h"
+#include "qcore_unix_p.h"
QT_BEGIN_NAMESPACE
fileName = url.toString(QUrl::RemoveAuthority | QUrl::RemoveFragment | QUrl::RemoveQuery);
}
- QFileInfo fi(fileName);
- if (fi.isDir()) {
+ QStatInfo si(fileName);
+ if (si.isDir()) {
QString msg = QCoreApplication::translate("QNetworkAccessFileBackend", "Cannot open %1: Path is a directory").arg(url.toString());
setError(QNetworkReply::ContentOperationNotPermittedError, msg);
QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
return;
}
- setHeader(QNetworkRequest::LastModifiedHeader, fi.lastModified());
- d->realFileSize = fi.size();
+ setHeader(QNetworkRequest::LastModifiedHeader, si.lastModified());
+ d->realFileSize = si.size();
setHeader(QNetworkRequest::ContentLengthHeader, d->realFileSize);
QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection);