Save more formats in clipboard history
Ditto is a clipboard manager on Windows. The database used in Ditto contains 2 tables, and I think some fields will also be useful for klipper in regards of both performance and usability.
Main | Data |
---|---|
ID | ID |
CRC (used to find duplicate) | ClipBoardFormat (mimetype) |
Date | oData (binary data) |
Text | |
DontAutoDelete (starred) | |
clipOrder | |
stickyClipOrder |
The "Main" table is used to store clips. Each clip in the table has a unique CRC which is generated from all formats, and the order is saved in a separate column. In the "Data" table, an ID can be mapped to multiple records, and each record has a different format. The main advantages are:
- The structure allows the frontend to list clips quickly by only reading the "Main" table, and the "Data" table is read only when details should be shown, so users can save more images in klipper with a lower memory footprint.
- More formats like HTML rich text can also be saved in the history, like Windows clipboard history already does.
- Flexible to add more features like "sticky clip", sorting clips by date, and a klipper runner.
To achieve this goal, klipper will need to:
-
Port to SQLite and use the new database -
Convert the current database -
lazily load clips on startup -
Port the search field to using SQL query instead of filtering in a model