summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/designercore/imagecache/timestampprovider.cpp
blob: c456d7048cce1e0af988ff10d733e3d8b288c5aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "timestampprovider.h"

#include <QDateTime>
#include <QFileInfo>

#include <limits>

namespace QmlDesigner {

Sqlite::TimeStamp TimeStampProvider::timeStamp(Utils::SmallStringView name) const
{
    QFileInfo info{QString{name}};
    if (info.exists())
        return info.lastModified().toSecsSinceEpoch();

    return {std::numeric_limits<long long>::max()};
}

} // namespace QmlDesigner