pybae / QNote

A note taking app for Linux
MIT License
4 stars 0 forks source link

Deferred Text Loading #31

Open tycheng opened 9 years ago

tycheng commented 9 years ago

image

I have been testing the app for the last hour and feel like there is need to implement this. Modern UI should not block during doing something in the background. This is a difference between terminal command line and GUI.

Therefore I suppose we can create a QThread to load file in the background, use the progress bar to track the percentage of file loading. During this period, we should allow user to do whatever they want.

tycheng commented 9 years ago

One thing to notice is that QBuffer stuck for a long time even if I just open a file of 300K. I wonder if that is related to the way we are reading that. If we do not treat them as strings, but treat them as bytes, would that be somewhat faster?

pybae commented 9 years ago

So for the QThread, while the user's opening the file, I think that the app should still be limited to the screen, meaning that the user can't switch files or anything of the sort during that period. But, I agree with the progress bar.

pybae commented 9 years ago

I've been working on integrating some changes to the Qt app in branch refactoring, although I can't get the slot mechanism to work yet. Eventually, I want to integrate unit tests and a CI build for the app, and we can profile the QBuffer there.

pybae commented 9 years ago

Also, I think that @MikkelKim commit about parsing the text in onMainTextEdit_changed could be slowing it down, try commenting that out.