renaming utility: Show note for all new dirs

This commit is contained in:
Martchus 2017-01-06 22:07:03 +01:00
parent 0531460df9
commit 5472c560f3
2 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#include "./filesystemitem.h"
#include <QDir>
#include <QCoreApplication>
#include <QDebug>
namespace RenamingUtility {
@ -161,6 +162,7 @@ FileSystemItem *FileSystemItem::makeChildAvailable(const QString &relativePath)
if(!child) {
child = new FileSystemItem(ItemStatus::New, ItemType::Dir, dir);
child->setParent(parent);
child->setNote(QCoreApplication::translate("RenamingUtility::FileSystemItem", "will be created"));
}
parent = child;
}

View File

@ -302,10 +302,6 @@ void RenamingEngine::executeScriptForItem(const QFileInfo &fileInfo, FileSystemI
case ActionType::Rename:
if(!newRelativeDirectory.isEmpty()) {
FileSystemItem *counterpartParent = item->root()->makeChildAvailable(newRelativeDirectory);
if(counterpartParent->status() == ItemStatus::New
&& counterpartParent->note().isEmpty()) {
counterpartParent->setNote(tr("will be created"));
}
const QString &counterpartName = newName.isEmpty() ? item->name() : newName;
if(counterpartParent->findChild(counterpartName, item)) {
item->setNote(tr("name is already used at new location"));