Wrong file order when using drag and drop to other program

Bugs and issues.
Locked
Message
Author
Mago
Posts: 32
Joined: 09.05.2008, 22:34

Wrong file order when using drag and drop to other program

#1 Post by Mago » 24.08.2008, 17:53

In every version of FreeCommander, including the latest beta build 375, is an issue that is annoying when you using drag and drop.

Freecommander seems often to reverse the filelist before offering it to any program, but not always. When selecting all files, it works OK for 80% of the time.

Steps to reproduce problem:

1. Create a folder and put inside 3 MP3 files.
2. Start Windows Media Player
3. Select the 2nd and 3th MP3 files and use drag and drop to play them with Windows Media Player
4. Windows Media Player will now most likely play the LAST mp3 file and has a playlist that is the REVERSE of the selected files in FreeCommander.

This is not logical. Files should always be offered according to the order in the filelist. The filelist is also deselected and this should not happen either.

Bearded Kirklander
Posts: 250
Joined: 25.07.2008, 10:54

#2 Post by Bearded Kirklander » 24.08.2008, 21:26

Have you tried testing this with other scenarios?

I set both panels in v375 to Unsorted

I then dragged and dropped a series of numbered MP3 files, 01.mp3 to 13.mp3 from one pane to another, and they were shown in the same order, 01.mp3 to 13.mp3

I then opened an app called BONK ENCODER, which I use to convert / rip audio. It's main window is not sorted by default. I did a series of drag and drops from FC to BONK. Unsorted, they happened to be listed in order from 01.mp3 to 13.mp3 because that was the order that they were copied into that folder originally. I made non-contiguous selections from that list and dropped them into the BONK window. They showed up properly - 04.mp3, 07.mp3, 09.mp3 13.mp3.

I then clicked the NAME column header to force those 13 files to be shown in reverse order, from 13.mp3 down to 01.mp3 and then made more non-congiguous selections and found that they showed up properly. 12.mp3, 10.mp3, 05.mp3, 04.mp3, 01.mp3.

I tried this type of experiment on newly created folders on my desktop and when initially dragged from FC 375 to the open folder windows, they showed in the order that I selected in FC. Ascending, Descending, non-contiguous, it all functioned as expected. Then when I chose from the VIEW, ARRANGE ICONS BY menu to force a sort, they sorted then as expected.

I did the same thing with Music Match 7.5's playlist window, and the files appeared there unsorted but in the exact same order that they were shown in the FC panel where they were dragged from.

Then I did exactly what you indicated in your post to reproduce the problem but was unable to achieve the same result that you did.

Using Windows Media Player 10.00.00.4058 in the NOW PLAYING tab with the NOW PLAYING LIST on the far right of that media player window, the files I dropped from FC stayed in the order they were selected.

I repeated that function 10 times with FC 375, then tested with PowerDesk Pro 5 and a "New Folder" created on the Windows Desktop.

I clicked on the drop-down icon for the Now Playing List and noticed that it has a SORT menu with Name, Artist, Album, Rating and File Name. If I chose any of those after dropping the files from FC 375, only then would the order of the files showin the Now Playing List change.

You may want to double check to make sure that nothing was left out of the Steps you listed in your post.

I would then try testing FC 375 selection and drag/drop in a variety of applications, as I did as an example above. If you find the same result occurs in every program you test with, it may indicate a system-wide setting. However, if results differ, it may help you narrow down the field a bit and allow you to focus in on the root cause - assuming it would be a single application or setting.

I ran my tests on Windows XP SP2. I have not tested it with Vista.

I hope you are able to find a solution to the problem. The more tests you perform and the more data you collect, the easier it may be for Marek to find and squash any bugs present.

Mago
Posts: 32
Joined: 09.05.2008, 22:34

#3 Post by Mago » 24.08.2008, 22:28

I am using Vista 64 bit and have never seen this issue when using drag and drop from an explorer window. But I see this issue very often when I use FreeCommander. Files are sorted on Name.

Usually I click on a file, then press and hold SHIFT and then click on the file a bit lower. The result is that some files are selected. Then I click on one of these files and hold the mouse button to drag the files to winamp. Then WinAmp often shows the selected files in reverse. I have seen this issue also in Windows Media Player, but I prefer to use Wimamp to play songs.

The interesting part is that it does matter how files are selected. The problem occurs less frequent when I click on a file a bit higher to get a range. I would expect that the selection process (using shift/control/mouse/keyboard) would not be relevant for the list of files that FreeCommander would give to the other application.

In my opinion, FreeCommander should in case of a drag and drop, check at that exact moment what files are selected and sort them with the current sort order of the selected filelist and then give them to the other application. But is drag and drop implemented in this way?

Mago
Posts: 32
Joined: 09.05.2008, 22:34

#4 Post by Mago » 24.08.2008, 22:54

I have created a shortcut to NotePad++ on my desktop and opened with FreeCommander a folder with 100+ text files. When I select files and use drag and drop, I get the same issue.

I did some tests and they seem to indicate that the selection process is important for the outcome of the drap and drop and for the Edit function F4 as well.

Try this:
1. Use Notepad++ as default editor in Free Commander
2. Open a folder with several textfiles and Sort them on Name
3. Select with the mouse a textfile and another one a bit higher
4. Press F4 and check the tabs in Notepad++
5. Now select the the same files, but in a different order
6. Press F4 and check the tabs in Notepad++

Bearded Kirklander
Posts: 250
Joined: 25.07.2008, 10:54

#5 Post by Bearded Kirklander » 24.08.2008, 23:09

Could you provide some screen shots perhaps?

I have known that FC can function differently under XP than Vista. Marek and I have discussed one related to drag and drop, but I think may be unrelated to your specific problem.

I would assume that you have tried uninstalling FC, purging all related config info and installed again in a different folder?

I have an idea I'd like to suggest. I believe that Microsoft Virtual PC is free now, is that correct? If so, would it be possible for you to use that software to create two virtual machine configurations? One with Windows XP and another with Windows Vista? Default configurations, nothing changed, and each isolated from the host environment.

Just a thought. :)

Bearded Kirklander
Posts: 250
Joined: 25.07.2008, 10:54

#6 Post by Bearded Kirklander » 24.08.2008, 23:39

I have another machine that I can boot to Vista when I change the default boot drive. It's not a dual boot but actually two distinct installations unaware of each other. One SATA drive is formatted for and contains only Vista 32 bit Home Premium SP1. One IDE drive has XP installed.

So, I was just able to pop-in to Vista, install FC 375 and Bonk Encoder 1.0.7 and do a drag and drop test.

The order there is correct. Here is a link to Bonk Encoder:

http://www.bonkenc.org/

They don't seem to have 1.0.7 up there any more but have the 1.0.8 version instead. It's a 4 meg download, I believe. I'll update my copy on Vista to 1.0.8 so we can both be testing the same version.

I've noticed that in Vista, the folders I create on the desktop, etc. are sorted by default. I'm not sure if that is a system-wide thing or not, so that is one reason I want to recommend trying this third party app.

Bonk Encoder is a very slim, efficient, non-invasive app and I think is well suited to this sort of test.

If you're willing to give it a shot, I'll do what I can to help narrow things down a bit.

Mago
Posts: 32
Joined: 09.05.2008, 22:34

#7 Post by Mago » 25.08.2008, 19:41

I admit that in the last months, I unpacked the current beta in the installation folder and didn't remove the old config files. With VMWare I will test the issue with a clean install of FreeCommander on a clean installation of Vista-32 SP1 and Vista-64 SP1.

Drap and drop seems more complicated then I expected, see http://www.eggheadcafe.com/software/asp ... of-fi.aspx

***************
My recollection is that Windows Explorer multi-file select goes something
like this:
1) Files are added to the file list LIFO. The most recently selected
file is first in the list.
2) When selecting more than one new file at a time (drag-rect,
shift-select a list, etc), the group is in order according to how they
appear in Windows Explorer, but the whole group is added at the front of
the selection
3) Clicking the final selection may result in one file (the file you
clicked to represent the whole group) being moved to the beginning of the
selection list
***************

The implementation of multi-file drag and drop might not be the same for XP, Vista-32 and Vista-64. How does FreeCommander handle multi-file drag and drop? Does it matter how files are selected or not? Does Freecommander give the list directly to the application or does explorer.exe act as a man in the middle?

Bearded Kirklander
Posts: 250
Joined: 25.07.2008, 10:54

#8 Post by Bearded Kirklander » 25.08.2008, 20:06

Good info in the post. Thanks

I've actually created simple file manager applications before, back in the days of Quick Basic 4.5 and Microsoft Basic 7 and remembered that I simply did a read of all files listed in the directory and stored them in an array. Like what they talk about here:

http://support.microsoft.com/kb/83811

Just before performing any copy or move operation, I made sure to force a sort based on the field the user had selected, and then I performed the operation in a loop based on that unique array.

Basically, I read them into a Variable like "File$(counter)" and then created a subroutine that did the bubble sort and a new array was created and referenced seperately, something like "SortedFile$(counter) and performed the action in a loop using that SortedFile$ array variable. It could be a For-Next, While-Wend, Do-Loop, etc.

I did not at that time rely on any sort of API or library, as it was in DOS and used Call Interrupts, so as long as the code was good, it worked exactly as expected.

I'm not sure if Free Commander relies on Windows API's exclusively, or if he force-coded the sort. If it is strictly based on API's, that could explain the differing behaviors in XP vs Vista.

I hope Marek is able to figure it out. Programming can be pretty hard to do, especially if you don't have a partner or two to help bring fresh eyes to the code. Sometimes you just get so lost in the heart of it that you miss some obvious bugs, so having someone give it the once-over can be a great help. I know it was for me. I had one bud in particular who was just as hardcore about QuickBasic 4.5 as I was, and we would read, document and test each others work, and we were often able to see things that needed to be fixed that the other person had overlooked.

Peer support / collaboration can really take a load off of the mind, which it did for me.

Anyway, I'll keep some positive thoughts and hope we can get to the bottom of this. Good luck.

Mago
Posts: 32
Joined: 09.05.2008, 22:34

#9 Post by Mago » 25.08.2008, 21:47

I installed FreeCommander release 375 on a clean installation of Vista 64 SP1 in VMware and didn't get the problem. Then I imported my config file and the problem was back. After comparing the config file and some testing, I think that I found the cause of the problem.

When I disable the NC-mode in FreeCommander, the problem doesn't seem to occur. Somehow, the NC-mode disrupts the sorting of the multi-file drag and drop. It automatically deselects the files as well.

Bearded Kirklander
Posts: 250
Joined: 25.07.2008, 10:54

#10 Post by Bearded Kirklander » 25.08.2008, 23:37

Mago wrote:I installed FreeCommander release 375 on a clean installation of Vista 64 SP1 in VMware and didn't get the problem. Then I imported my config file and the problem was back. After comparing the config file and some testing, I think that I found the cause of the problem.

When I disable the NC-mode in FreeCommander, the problem doesn't seem to occur. Somehow, the NC-mode disrupts the sorting of the multi-file drag and drop. It automatically deselects the files as well.
Outstanding work! You've been able to narrow it down considerably, and that may be all the detail that Marek needs in order to fix the bug.

You know, I've never actually used NC mode. I don't think I ever would have considered that as an option due to my lack of knowledge on that feature.

That's one of the cool things about the forums - we can all learn from each others configurations, issues, etc. I think these discussions are going to help Free Commander become an even better product than it is now, and I'm looking forward to the upcoming releases.

Thanks for taking the time on this. I'm glad you figured it out.

:)

User avatar
Dreamer
Site Admin
Posts: 3235
Joined: 19.08.2007, 21:40
Location: Slovakia

Re: Wrong file order when using drag and drop to other progr

#11 Post by Dreamer » 20.06.2011, 12:50

Please contact Marek about it.

julieth11
Posts: 1
Joined: 29.08.2011, 10:08

Re: Wrong file order when using drag and drop to other progr

#12 Post by julieth11 » 29.08.2011, 10:10

I just want to say thank you for the information.
It is very I Flight Systems valuable for me.
Thanks and keep up the good work..

Locked

Who is online

Users browsing this forum: No registered users and 0 guests