Utils: Use FilePath in TemporaryDirectory API

This helps to lower impedance in the using code.

Even though TemporaryDirectory will very likely always stay on the local
host, this is one of the entry points into path related string
manipulation
that we want to base on FilePath nowadays.

Change-Id: I302016b8d65e54df94296659a54a93935d9e4627
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-07-01 09:58:48 +02:00
parent 92904480f0
commit a58dd22f2d
15 changed files with 45 additions and 28 deletions

View File

@@ -200,14 +200,14 @@ public:
m_canceled = false;
m_tempDir = std::make_unique<TemporaryDirectory>("plugininstall");
m_data->extractedPath = FilePath::fromString(m_tempDir->path());
m_data->extractedPath = m_tempDir->path();
m_label->setText(PluginInstallWizard::tr("Checking archive..."));
m_label->setType(InfoLabel::None);
m_cancelButton->setVisible(true);
m_output->clear();
m_archive = Archive::unarchive(m_data->sourcePath, FilePath::fromString(m_tempDir->path()));
m_archive = Archive::unarchive(m_data->sourcePath, m_tempDir->path());
if (!m_archive) {
m_label->setType(InfoLabel::Error);
@@ -271,7 +271,7 @@ public:
PluginSpec *coreplugin = CorePlugin::instance()->pluginSpec();
// look for plugin
QDirIterator it(m_tempDir->path(),
QDirIterator it(m_tempDir->path().path(),
libraryNameFilter(),
QDir::Files | QDir::NoSymLinks,
QDirIterator::Subdirectories);