CopyQ
CopyQ copied to clipboard
Improve default storing format for tabs
The default format for storing tab items is single binary data file. Storing many items (or just big data) can lead to performance problems. The binary file is basically overwritten on each save.
It would be better to store tab in multiple files.
Also consider saving tab configuration in the new format:
- tab icon,
- unload interval,
- number of items,
- store in memory only (clears data on exit),
- etc.
Solution - Synchronize to Files
Move Synchronize plugin functionality into core application.
Data for items will be stored in separate files and won't need to be loaded into memory all at once.
The Synchronization plugin can be removed later.
This will improve code quality and stability of synchronization feature.
- Map each tab to a directory in
copyq.conf
. By default generates relative path in config directory underdata/
. The generated directory name would be ideally shortened tab name (max ~20 chars) with removed&
and all non alphanumeric characters replaced with_
. - Renaming tab is trivial - only changes tab name not the path.
- Always lock each file before writing.
- Saving can be handled by model whenever an item changes. No need for delay when saving.
- Data migration should work out-of-the-box (set data to model which saves it automatically to a file).
Tab Configuration
Tab configuration could be stored in copyq_tabs.ini
.
Transient tabs
Empty tab path would mean to store data just in memory and not on the disk. This would require to keep existing item data list somewhere.
Problems
- How to make this work nicely with Encryption plugin? Let plugins handle just the item data serialization?
- Possible performance issues when lot of files are sync directory
i would appreciate this. the current sync plugin is missing metadata synchronization. see my comment in #1083
while the date can actually be encoded in the filenames (#1083), other metadata cannot (notes, tags). my use-case is synchronizing all data between 3 machines using syncthing.
a robust file-based repository for storing the data would be great!
Just to be clear: Notes and tags (and any other data in items) are synchronized in separate files (*_note.txt
and *_copyq.dat
files).
Just to be clear: Notes and tags (and any other data in items) are synchronized in separate files (
*_note.txt
and*_copyq.dat
files).
Indeed you are correct. I think there was something wrong with my syncthing-setup. All is good now. Sorry for the noise :sweat_smile: