Utils: Remove rarely used FilePath constructor

Not much benefit interface-wise.

Change-Id: I0e605ec235e8072efcbf7e777cf7e8f8ee5e0799
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-05-28 15:51:27 +02:00
parent 473a741c9f
commit 613d2e7d23
3 changed files with 2 additions and 10 deletions

View File

@@ -760,13 +760,6 @@ FilePath FilePath::fromStringWithExtension(const QString &filepath, const QStrin
return FilePath::fromString(rc); return FilePath::fromString(rc);
} }
/// Constructs a FileName from \a fileName
/// \a fileName is not checked for validity.
FilePath FilePath::fromLatin1(const QByteArray &filename)
{
return FilePath::fromString(QString::fromLatin1(filename));
}
/// Constructs a FileName from \a fileName /// Constructs a FileName from \a fileName
/// \a fileName is only passed through QDir::cleanPath /// \a fileName is only passed through QDir::cleanPath
FilePath FilePath::fromUserInput(const QString &filename) FilePath FilePath::fromUserInput(const QString &filename)

View File

@@ -69,7 +69,6 @@ public:
static FilePath fromString(const QString &filepath); static FilePath fromString(const QString &filepath);
static FilePath fromFileInfo(const QFileInfo &info); static FilePath fromFileInfo(const QFileInfo &info);
static FilePath fromStringWithExtension(const QString &filepath, const QString &defaultExtension); static FilePath fromStringWithExtension(const QString &filepath, const QString &defaultExtension);
static FilePath fromLatin1(const QByteArray &filepath);
static FilePath fromUserInput(const QString &filepath); static FilePath fromUserInput(const QString &filepath);
static FilePath fromUtf8(const char *filepath, int filepathSize = -1); static FilePath fromUtf8(const char *filepath, int filepathSize = -1);
static FilePath fromVariant(const QVariant &variant); static FilePath fromVariant(const QVariant &variant);

View File

@@ -53,7 +53,7 @@ public:
auto root = std::make_unique<ProjectExplorer::ProjectNode>(file); auto root = std::make_unique<ProjectExplorer::ProjectNode>(file);
root->addNode(std::move(fileNode)); root->addNode(std::move(fileNode));
fileNode = std::make_unique<ProjectExplorer::FileNode>( fileNode = std::make_unique<ProjectExplorer::FileNode>(
Utils::FilePath::fromLatin1( Utils::FilePath::fromString(
":/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp"), ":/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp"),
ProjectExplorer::FileType::Source); ProjectExplorer::FileType::Source);
root->addNode(std::move(fileNode)); root->addNode(std::move(fileNode));
@@ -220,7 +220,7 @@ void QmlProfilerDetailsRewriterTest::seedRewriter()
auto kit = std::make_unique<ProjectExplorer::Kit>(); auto kit = std::make_unique<ProjectExplorer::Kit>();
ProjectExplorer::SysRootKitAspect::setSysRoot( ProjectExplorer::SysRootKitAspect::setSysRoot(
kit.get(), Utils::FilePath::fromLatin1("/nowhere")); kit.get(), Utils::FilePath::fromString("/nowhere"));
DummyProject *project = new DummyProject(Utils::FilePath::fromString(filename)); DummyProject *project = new DummyProject(Utils::FilePath::fromString(filename));
ProjectExplorer::SessionManager::addProject(project); ProjectExplorer::SessionManager::addProject(project);