Author Topic: Ticket 583: Long file load pastes file path in editor  (Read 350 times)

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1846
Ticket 583: Long file load pastes file path in editor
« on: March 01, 2018, 09:53:34 pm »
I create this here, because SF is down....

About the bug
https://sourceforge.net/p/codeblocks/tickets/583/
This bug is also reported here: http://forums.codeblocks.org/index.php/topic,22302.msg151989.html#msg151989

As in the ticket on SF posted the culprit of this bug is the codesnippet plugin that implements a drag and drop feature for the project tree and the open files list.

I have now implemented a native drag and drop handler in the project tree control. It simply generates a list of selected source files separated by newlines "\n".
This is the first attached patch. In the second patch i have removed all custom drag and drop code from the plugin.

The old implementation did not work on linux. Now this works also on linux.

The drag and drop handler in the plugin was a bit more complex (it generated file:\\ urls and so on). Is this needed? I wanted to keep it as simple as possible...

The patches are created with git



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10837
    • Travis build status
Re: Ticket 583: Long file load pastes file path in editor
« Reply #1 on: March 01, 2018, 11:04:16 pm »
1. Why are you drag-n-dropping text objects?
2. Why don't you create custom object?
3. What is this drag-n-drop used for?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1846
Re: Ticket 583: Long file load pastes file path in editor
« Reply #2 on: March 02, 2018, 12:18:52 am »
Main objective was to keep the functionality and remove the bug (because it is really annoying)
all other objectives are very low priority.

Quote
1. Why are you drag-n-dropping text objects?
2. Why don't you create custom object?
* It is the easiest object and the most universal? I have no idea how a custom object works between programs and between different OS.
* I can always use the filename of a file in other programs. (inter program drag and drop)
* The only other modification i can think of is to use a custom url like "file:// path" type. But always as a text object.
* Why create a custom object? It is not need and adds complexity.
BUT: I have not investigated all possibilities of drag and drop and this is new land for me. If someone knows more, patches welcome ;)

Quote
3. What is this drag-n-drop used for?
I do not use the snippet plugin and am not 100% sure what the plugin does. But basically you need to transfer the file path from the project tree control to the tree control of the snipped plugin.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2095
Re: Ticket 583: Long file load pastes file path in editor
« Reply #3 on: March 21, 2018, 11:39:32 pm »
Thanks.

I'm currently working in CodeSnippets with changes from Miguel Gimenez.
I'll look into this also.