Commit c3df657
committed
feat: implement clipboard image paste functionality
Added support for pasting images from clipboard as files through the
kTouchFile event system. The implementation centralizes image handling
logic in FileOperationsEventReceiver with new doTouchFileFromClipboard
method, replacing scattered implementations across different plugins.
All clipboard image operations now flow through the standard file
operations pipeline for consistency.
Key changes:
1. Added clipboard image detection in doTouchFilePremature
2. Created new doTouchFileFromClipboard method for centralized image
handling
3. Modified FileOperatorProxy and FileOperatorHelper to use new
kTouchFile mechanism
4. Added proper callbacks for post-operation file selection
5. Included undo/redo support for image operations
6. Added proper error handling and logging
Log: Added support for pasting clipboard images as files
Influence:
1. Test clipboard image paste in various directories
2. Verify filename generation with different formats
3. Test undo/redo functionality for image operations
4. Verify error handling when clipboard has no image data
5. Check performance with large clipboard images
6. Test paste operations with different image formats
7. Verify file selection after paste operation
feat: 实现剪贴板图片粘贴功能
新增通过kTouchFile事件系统将剪贴板中的图像作为文件粘贴的支持。
该实现将图像处理逻辑集中在FileOperationsEventReceiver新增的
doTouchFileFromClipboard方法中,取代了原先分散在不同插件中的实现。现在所
有剪贴板图像操作都通过标准的文件操作流程执行以提高一致性。
主要变更:
1. 在doTouchFilePremature中添加剪贴板图像检测
2. 创建新的doTouchFileFromClipboard方法进行集中式图像处理
3. 修改FileOperatorProxy和FileOperatorHelper使用新的kTouchFile机制
4. 添加适当的回调函数实现操作后的文件选择
5. 包含图像操作的撤销/重做支持
6. 添加完善的错误处理和日志记录
Log: 新增剪贴板图片粘贴文件的支持
Influence:
1. 测试在不同目录中粘贴剪贴板图片
2. 验证不同格式的文件名生成
3. 测试图像操作的撤销/重做功能
4. 验证剪贴板无图像数据时的错误处理
5. 检查处理大型剪贴板图像的性能表现
6. 测试不同图像格式的粘贴操作
7. 验证粘贴操作后的文件选择功能1 parent e1e009e commit c3df657
File tree
6 files changed
+237
-6
lines changed- src/plugins
- common
- dfmplugin-fileoperations/fileoperationsevent
- desktop/ddplugin-canvas/view/operator
- filemanager/dfmplugin-workspace/utils
6 files changed
+237
-6
lines changedLines changed: 114 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
667 | 672 | | |
668 | 673 | | |
669 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
670 | 684 | | |
671 | 685 | | |
672 | 686 | | |
| |||
736 | 750 | | |
737 | 751 | | |
738 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
739 | 853 | | |
740 | 854 | | |
741 | 855 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
278 | 281 | | |
279 | 282 | | |
280 | 283 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
124 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
125 | 134 | | |
126 | 135 | | |
127 | 136 | | |
| |||
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
264 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
265 | 306 | | |
266 | 307 | | |
267 | 308 | | |
| |||
Lines changed: 66 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
252 | 258 | | |
253 | 259 | | |
254 | 260 | | |
255 | | - | |
256 | | - | |
| 261 | + | |
| 262 | + | |
257 | 263 | | |
258 | 264 | | |
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
262 | 280 | | |
263 | 281 | | |
264 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
265 | 287 | | |
266 | 288 | | |
267 | 289 | | |
| |||
270 | 292 | | |
271 | 293 | | |
272 | 294 | | |
273 | | - | |
274 | 295 | | |
275 | 296 | | |
276 | 297 | | |
| |||
294 | 315 | | |
295 | 316 | | |
296 | 317 | | |
297 | | - | |
| 318 | + | |
298 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
299 | 361 | | |
300 | 362 | | |
301 | 363 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
0 commit comments