D8208: Add Duplicate feature
Elvis Angelaccio
noreply at phabricator.kde.org
Sun Jan 19 16:12:18 GMT 2020
elvisangelaccio requested changes to this revision.
elvisangelaccio added a comment.
This revision now requires changes to proceed.
In D8208#592754 <https://phabricator.kde.org/D8208#592754>, @ngraham wrote:
> In D8208#592667 <https://phabricator.kde.org/D8208#592667>, @elvisangelaccio wrote:
>
> > Well, that depends on the current sorting mode, right? If I have sort-by-modified then the duplicate file will jump to the top of the view even if it has the "copy" suffix rather than the "Copy of" prefix, no?
>
>
> If you prepend "Copy of," then it jumps around when you're sorting by Name or Creation Date.
>
> If you append "copy," then it only jumps around when you're sorting by Creation Date.
Fair enough ;)
INLINE COMMENTS
> dolphinview.cpp:728
> + if (extension.isEmpty()) {
> + duplicateURL.setPath(i18n("%1 copy", originalURL.path()));
> + // There's an extension; new filename is "<oldfilename> copy.<extension>"
Please add context for translators, explaining that %1 is a path.
> dolphinview.cpp:732
> + // Need to add a dot since QMimeDatabase::suffixForFileName() doesn't include it
> + extension = QStringLiteral(".") + extension;
> + const QString directoryPath = originalURL.adjusted(QUrl::RemoveFilename).path();
`QLatin1String` if you want to concatenate, `QStringLiteral(".%1").arg(extension)` otherwise.
> dolphinview.cpp:735-737
> + // Preserve file's original filename extension in case the casing differs
> + // from what QMimeDatabase::suffixForFileName() returned
> + const QString suffixString = originalFileName.right(extension.size());
I'd call this variable `originalExtension`.
> dolphinview.cpp:751
> + forceUrlsSelection(newSelection.first(), newSelection);
> + emitSelectionChangedSignal();
> +
What's this needed for?
> dolphinview.cpp:753-754
> +
> + connect(m_view, &DolphinItemListView::roleEditingFinished,
> + this, &DolphinView::slotRoleEditingFinished);
> +}
What's this connection needed for?
> dolphinview.h:374-375
> + * Creates duplicates of selected items, appending "copy"
> + * to the end. If only one file is selected, also initiates
> + * a rename operation on it.
> + */
Where is the rename operation in this patch?
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D8208
To: ngraham, #dolphin, #kde_applications, elvisangelaccio, dfaure, broulik, davidedmundson
Cc: fvogt, mthw, kfm-devel, meven, markg, fazevedo, cfeck, #dolphin, pberestov, iasensio, fprice, MrPepe, fbampaloukas, alexde, Codezela, feverfew, spoorun, navarromorales, firef, ngraham, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200119/18b49d77/attachment.htm>
More information about the kfm-devel
mailing list