D16830: Add file related actions to Tabbar context menu and File menu: Rename, Delete, Compare (new), and some more

gregormi noreply at phabricator.kde.org
Sun Dec 2 20:20:05 GMT 2018


gregormi added a subscriber: cullmann.
gregormi added inline comments.

INLINE COMMENTS

> katefileactions.cpp:42-50
> +void KateFileActions::copyFilePathToClipboard(KTextEditor::Document* doc)
> +{
> +    QApplication::clipboard()->setText(doc->url().toDisplayString(QUrl::PreferLocalFile));
> +}
> +
> +void KateFileActions::openContainingFolder(KTextEditor::Document* doc)
> +{

Hello @dhaumann @cullmann,
I wonder if it would be better for the functions in this file to use a Document reference instead of a pointer. Currently, these functions will crash on a nullptr. In a function farther down below I used assertions which could be removed if I use references instead of pointers. This makes the code more readable and safe (and seems the recommended way to pass parameters: http://www.modernescpp.com/index.php/c-core-guidelines-how-to-pass-function-parameters).
What do you think?

REPOSITORY
  R40 Kate

BRANCH
  arcpatch-D16830_1

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

To: gregormi, #kate, #vdg, ngraham
Cc: cullmann, anthonyfieroni, dhaumann, mmustac, ngraham, kwrite-devel, hase, michaelh, demsking, sars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20181202/b2c394d8/attachment.html>


More information about the KWrite-Devel mailing list