2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2012-08-20 12:41:52 +02:00
|
|
|
|
|
|
|
|
#include "deployablefile.h"
|
|
|
|
|
|
2015-01-10 23:40:32 +02:00
|
|
|
#include <utils/fileutils.h>
|
|
|
|
|
|
2012-08-20 12:41:52 +02:00
|
|
|
#include <QHash>
|
|
|
|
|
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
DeployableFile::DeployableFile(const FilePath &localFilePath, const QString &remoteDir, Type type)
|
2012-10-08 15:46:38 +02:00
|
|
|
: m_localFilePath(localFilePath), m_remoteDir(remoteDir), m_type(type)
|
2016-04-13 15:52:14 +02:00
|
|
|
{ }
|
2012-08-20 12:41:52 +02:00
|
|
|
|
|
|
|
|
QString DeployableFile::remoteFilePath() const
|
|
|
|
|
{
|
|
|
|
|
return m_remoteDir.isEmpty()
|
2015-01-10 23:40:32 +02:00
|
|
|
? QString() : m_remoteDir + QLatin1Char('/') + m_localFilePath.fileName();
|
2012-08-20 12:41:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool DeployableFile::isValid() const
|
|
|
|
|
{
|
|
|
|
|
return !m_localFilePath.toString().isEmpty() && !m_remoteDir.isEmpty();
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-08 15:46:38 +02:00
|
|
|
bool DeployableFile::isExecutable() const
|
|
|
|
|
{
|
|
|
|
|
return m_type == TypeExecutable;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-13 09:27:18 +02:00
|
|
|
size_t qHash(const DeployableFile &d)
|
2012-08-20 12:41:52 +02:00
|
|
|
{
|
|
|
|
|
return qHash(qMakePair(d.localFilePath().toString(), d.remoteDirectory()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace ProjectExplorer
|