D7647: Two clicks on file/folder to rename

Andreas Krutzler noreply at phabricator.kde.org
Sun Oct 15 13:08:06 BST 2017


akrutzler added inline comments.

INLINE COMMENTS

> rkflx wrote in dolphinview.cpp:198
> This is about the double click interval, not about double clicking. I set it to 2000ms in systemsettings, but your code waits only 800ms.
> 
> But maybe such a change would have other implications I have not thought of?

Ah you mean that the (now) 800ms interval should depend on the double click interval set in systemsettings? 
Now, even for the initial activation, the double click interval is ignored. That is obviously bad thanks. :) 
How do solve that? Adding a certain amount of ms to the double click interval and use this instead of 800ms?

> elvisangelaccio wrote in dolphinview.cpp:103
> let's use `nullptr` for new code

Ok, but I actually don't know why initializing it as nullptr at this point, because it will be initialized  in the same constructor with "new QTimer(this)" afterwards anyway. I just wanted to stick to the current style.

> elvisangelaccio wrote in dolphinview.cpp:649
> `if (!fromTwoClicksRenamingTimer)`
> 
> But actually, if `fromTwoClicksRenamingTimer` would be declared inside the previous `if` block, we wouldn't need to check its value in this `else if`, right?

I assume with "previous if block" you mean:

  if (items.count() == 1 && GeneralSettings::renameInline()) { ... }

That's actually not true, because imagine this case:

- select one item
- click at text (timer starts 800ms)
- during that 800ms: the user select multiple items
- renaming box appears

I tried to abort the twoClicksRenaming (during that 800ms) if the selected item(s) have changed (like I do on focus-lost for example, line 822) but I couldn't find a proper way (signal/slot) how to do that. So I decided to check here, if the selected items have changed. And if there are more items selected, twoClicksRenaming should never trigger.

If I could abort twoClicksRenaming on item-selection-change, I wouldn't need m_twoClicksRenamingItemIndex either. There are signals which reports an item change but I couldn't use them because they were firing even if nothing changed at all.
Maybe you can help me out there? :)

REPOSITORY
  R318 Dolphin

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

To: akrutzler, #dolphin, #kde_applications, elvisangelaccio, emmanuelp, ngraham, markg
Cc: rkflx, markg, funkybomber, sars, elvisangelaccio, ngraham, #konqueror
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171015/0239f60f/attachment.htm>


More information about the kfm-devel mailing list