D15980: Warn user before renaming the file/folder to start with a ' . '

Pino Toscano noreply at phabricator.kde.org
Sat Oct 6 20:33:45 BST 2018


pino requested changes to this revision.
pino added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> dolphinview.cpp:1579
> +            //Confirm hiding file/folder by renaming inline
> +            if (newName.startsWith(QChar('.')) && !oldItem.name().startsWith(QChar('.')) && !hiddenFilesShown()) {
> +                KGuiItem yesGuiItem(KStandardGuiItem::yes());

- use QLatin1Char instead of QChar, since it is built from a latin1 character
- make the `!hiddenFilesShown()` check as first, as it is cheaper

> dolphinview.cpp:1583
> +
> +                const int code = KMessageBox::questionYesNo(nullptr,
> +                                                            oldItem.isFile() ? xi18nc("@info", "Adding a dot to the beginning of this file's name will hide it from view."

this dialog needs a parent, to be sure it stacks properly

> dolphinview.cpp:1587
> +                                                                                      "go to <interface>View->Hidden Files</interface> or type "
> +                                                                                      "<shortcut>alt+period</shortcut>."
> +                                                                                     )

please do not hardcode the shortcut, read it from the action collection; otherwise, if the user it them, the message will be misleading

> dolphinview.cpp:1591
> +                                                                                      "view.<nl/>Do you still want to rename it?<nl/><nl/>To show hidden files or " "directories, go to <interface>View->Hidden Files</interface> or type "
> +                                                                                      "<shortcut>alt+period</shortcut>."
> +                                                                                     ),

ditto

> dolphinview.cpp:1593
> +                                                                                     ),
> +                                                            oldItem.isFile() ? i18n("Hide this file?") : i18n("Hide this directory?"),
> +                                                            yesGuiItem,

please fix the capitalization, see the HIG

> shubham wrote in dolphinview.cpp:1590
> This setting will get stored in global config file

Then it must not be i18n'ed, otherwise it will break when switching language!

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D15980

To: shubham, elvisangelaccio, broulik, ngraham, pino
Cc: pino, totto, kfm-devel, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20181006/e7e619ce/attachment.htm>


More information about the kfm-devel mailing list