aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/designercore/imagecache/timestampprovider.cpp
blob: 81d6e4f5623e9a4291ac160a3267f358cf8ed44c (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+ OR GPL-3.0 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