hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.26k stars 430 forks source link

Increase item limit in each tab to 100,000 #2541

Closed hluk closed 7 months ago

hluk commented 8 months ago

Saves larger data in separate files.

Data from these files are loaded into memory only when needed.

This makes saving data much more efficient because the tab data files are much smaller and the separate data files can be shared between multiple tabs. These data files are only removed when all related items are removed (when app is idle and on exit).

The path to the data directory can be overridden with COPYQ_ITEM_DATA_PATH environment variable. But the directory should be used by single app instance.

The threshold value in bytes is stored as "item_data_threshold" hidden option. Item data that are larger than this value will be stored in separate files. The default value is 1024. Setting value to 0 would store all non-empty item data to separate files. A negative value disables the functionality and saves all into tab data file as before.

Files in synchronized directories now also work the same.

This change is not backwards-compatible. Going back to previous release could mean losing some data. But going to a new release again would parse the data correctly. Workaround is to set "item_data_threshold" to a negative value and trigger storing data tab (e.g. moving an item back and forth).

Fixes #1144