pybae / QNote

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

Storing the QFile #6

Closed pybae closed 10 years ago

pybae commented 10 years ago

In our implementation as of now, we have a private QFile member that tracks the current file we are working on. However, as we can't freely assign QFiles, such as (QFile member = QFile('fileName')), I was thinking of simply using the fileName and then looking up the file when we have to edit something with the file.

This leads to the following design:

  1. Having a fileName as an identifier
  2. Needing to search up the fileName for every operation on the file
  3. Requiring a textBuffer (or something of the sort, it's QTextStream for now) for the current file

And if an user happens to modify the file whilst we haven't updated yet (or deleted the file entirely) we would check that in our methods, and throw an error.

What do you guys think?

pybae commented 10 years ago

Alright, so we've agreed to go on with the implementation with the fileName. @tycheng suggested that we needed to monitor the file for changes and presented two choices:

  1. libevent
  2. QtFilesystemWatcher

As for which one we'll implement, that's still an open question