Commit 14c75187 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Fix AddToArchive jobs when filenames have a percentage character

CCBUG: 365798

Differential Revision: D2230
parent c98d64bf
...@@ -142,6 +142,13 @@ void AddToArchiveTest::testCompressHere_data() ...@@ -142,6 +142,13 @@ void AddToArchiveTest::testCompressHere_data()
<< QStringLiteral("data.zip") << QStringLiteral("data.zip")
<< 3ULL << 3ULL
<< 1ULL; << 1ULL;
QTest::newRow("compress here (as TAR) - dir with special name (see #365798)")
<< QStringLiteral("tar.gz")
<< QStringList {QFINDTESTDATA("data/test%dir")}
<< QStringLiteral("test%dir.tar.gz")
<< 2ULL
<< 1ULL;
} else { } else {
qDebug() << "7z/zip executable not found in path. Skipping compress-here-(ZIP) tests."; qDebug() << "7z/zip executable not found in path. Skipping compress-here-(ZIP) tests.";
} }
......
...@@ -68,7 +68,7 @@ void AddToArchive::setChangeToFirstPath(bool value) ...@@ -68,7 +68,7 @@ void AddToArchive::setChangeToFirstPath(bool value)
void AddToArchive::setFilename(const QUrl &path) void AddToArchive::setFilename(const QUrl &path)
{ {
m_filename = path.toDisplayString(QUrl::PreferLocalFile); m_filename = path.toLocalFile();
} }
void AddToArchive::setMimeType(const QString & mimeType) void AddToArchive::setMimeType(const QString & mimeType)
...@@ -113,10 +113,10 @@ bool AddToArchive::showAddDialog() ...@@ -113,10 +113,10 @@ bool AddToArchive::showAddDialog()
bool AddToArchive::addInput(const QUrl &url) bool AddToArchive::addInput(const QUrl &url)
{ {
m_inputs << url.toDisplayString(QUrl::PreferLocalFile); m_inputs << url.toLocalFile();
if (m_firstPath.isEmpty()) { if (m_firstPath.isEmpty()) {
QString firstEntry = url.toDisplayString(QUrl::PreferLocalFile); QString firstEntry = url.toLocalFile();
m_firstPath = QFileInfo(firstEntry).dir().absolutePath(); m_firstPath = QFileInfo(firstEntry).dir().absolutePath();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment