Review Request 120927: Fix selecting large directories for uploading

Jakub Caban kuba at whyblack.pl
Fri Oct 31 17:59:10 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120927/
-----------------------------------------------------------

Review request for KDevelop.


Repository: kdev-upload


Description
-------

That one was actually bothering me for a long time. As in the files dialog when choosing large directory or using "select all" KDevelop hunged to the point it had to be killed. In the best case scenario after long waiting it could respond. Took me some time to figure out the culprint.

In the current situation recursive file selecting worked like that:
- go into foo/
- emit dataChanged for foo/
- go into foo/bar/
- emit dataChanged for foo/bar/
- emit dataChanged for foo/
- take file foo/bar/file.txt
- emit dataChanged for foo/bar/file.txt
- emit dataChanged for foo/bar/
- emit dataChanged for foo/
- ...

...and so on - I think you see what's going on there already. Things got extremely wrong with deeply nested directories and many files in them.

As a solution I've removed this "look back" mechanism and am acutally emiting signal only for currently analyzed entry. So example looks like:
- go into foo/
- emit dataChanged for foo/
- go into foo/bar/
- emit dataChanged for foo/bar/
- take file foo/bar/file.txt
- emit dataChanged for foo/bar/file.txt
- ...

So that for each file or dir dataChanged is emitted at most once.

This have changed time of selecting all project files for upload at my random project from infinity to less than blink of an eye.


Diffs
-----

  uploadprojectmodel.cpp b6d2d9d 

Diff: https://git.reviewboard.kde.org/r/120927/diff/


Testing
-------

Code compiles and works in every scenario that came to my head:
- selecting all files and uploading them 
- selecting only one file (nested or not) and uploading it (as upload process actually takes care of creating directories).
- selecting all directory or subdirectory inside project folder for uploading
- using quick upload


Thanks,

Jakub Caban

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20141031/7ce3ccba/attachment.html>


More information about the KDevelop-devel mailing list