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 "./filesystemitem.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
namespace RenamingUtility {
|
namespace RenamingUtility {
|
||||||
|
@ -161,6 +162,7 @@ FileSystemItem *FileSystemItem::makeChildAvailable(const QString &relativePath)
|
||||||
if(!child) {
|
if(!child) {
|
||||||
child = new FileSystemItem(ItemStatus::New, ItemType::Dir, dir);
|
child = new FileSystemItem(ItemStatus::New, ItemType::Dir, dir);
|
||||||
child->setParent(parent);
|
child->setParent(parent);
|
||||||
|
child->setNote(QCoreApplication::translate("RenamingUtility::FileSystemItem", "will be created"));
|
||||||
}
|
}
|
||||||
parent = child;
|
parent = child;
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,10 +302,6 @@ void RenamingEngine::executeScriptForItem(const QFileInfo &fileInfo, FileSystemI
|
||||||
case ActionType::Rename:
|
case ActionType::Rename:
|
||||||
if(!newRelativeDirectory.isEmpty()) {
|
if(!newRelativeDirectory.isEmpty()) {
|
||||||
FileSystemItem *counterpartParent = item->root()->makeChildAvailable(newRelativeDirectory);
|
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;
|
const QString &counterpartName = newName.isEmpty() ? item->name() : newName;
|
||||||
if(counterpartParent->findChild(counterpartName, item)) {
|
if(counterpartParent->findChild(counterpartName, item)) {
|
||||||
item->setNote(tr("name is already used at new location"));
|
item->setNote(tr("name is already used at new location"));
|
||||||
|
|
Loading…
Reference in New Issue