Commit e399dc70 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

GIT_SILENT Fix coding style

parent 21d5f356
......@@ -185,8 +185,9 @@ QList<Archive::Entry*> ReadOnlyArchiveInterface::entriesWithoutChildren(const QL
QList<Archive::Entry*> filteredEntries;
QString lastFolder;
foreach (Archive::Entry *entry, sortedEntries) {
if (lastFolder.count() > 0 && entry->fullPath().startsWith(lastFolder))
if (lastFolder.count() > 0 && entry->fullPath().startsWith(lastFolder)) {
continue;
}
lastFolder = (entry->fullPath().right(1) == QLatin1String("/")) ? entry->fullPath() : QString();
filteredEntries << entry;
......@@ -204,39 +205,36 @@ QStringList ReadOnlyArchiveInterface::entryPathsFromDestination(QStringList entr
QString newPath;
int nameLength = 0;
foreach (const QString &entryPath, entries) {
if (lastFolder.count() > 0 && entryPath.startsWith(lastFolder)) {
// Replace last moved or copied folder path with destination path.
int charsCount = entryPath.count() - lastFolder.count();
if (entriesWithoutChildren != 1) {
charsCount += nameLength;
}
newPath = destinationPath + entryPath.right(charsCount);
foreach (const QString &entryPath, entries) {
if (lastFolder.count() > 0 && entryPath.startsWith(lastFolder)) {
// Replace last moved or copied folder path with destination path.
int charsCount = entryPath.count() - lastFolder.count();
if (entriesWithoutChildren != 1) {
charsCount += nameLength;
}
else {
const QString name = entryPath.split(QLatin1Char('/'), QString::SkipEmptyParts).last();
if (entriesWithoutChildren != 1) {
newPath = destinationPath + name;
if (entryPath.right(1) == QLatin1String("/")) {
newPath += QLatin1Char('/');
}
}
else {
// If the mode is set to Move and there is only one passed file in the list,
// we have to use destination as newPath.
newPath = destinationPath;
}
newPath = destinationPath + entryPath.right(charsCount);
} else {
const QString name = entryPath.split(QLatin1Char('/'), QString::SkipEmptyParts).last();
if (entriesWithoutChildren != 1) {
newPath = destinationPath + name;
if (entryPath.right(1) == QLatin1String("/")) {
nameLength = name.count() + 1; // plus slash
lastFolder = entryPath;
}
else {
nameLength = 0;
lastFolder = QString();
newPath += QLatin1Char('/');
}
} else {
// If the mode is set to Move and there is only one passed file in the list,
// we have to use destination as newPath.
newPath = destinationPath;
}
if (entryPath.right(1) == QLatin1String("/")) {
nameLength = name.count() + 1; // plus slash
lastFolder = entryPath;
} else {
nameLength = 0;
lastFolder = QString();
}
paths << newPath;
}
paths << newPath;
}
return paths;
}
......
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