renaming utility: Show note for all new dirs
This commit is contained in:
parent
0531460df9
commit
5472c560f3
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue