Repository navigation
Commit ece08fc
committed
fix: remove dead DPrinter construction in popupPrintDialog
1. Root cause: popupPrintDialog() constructs a DPrinter local
variable (QPrinter::HighResolution) that is never used; its
constructor synchronously loads the cups plugin and enumerates
printers, adding avoidable latency to print preview
2. Fix: remove the unused DPrinter printer(QPrinter::HighResolution)
line introduced by commit 9fcf3e4; the actual print dialog uses
DPrintPreviewDialog with no arguments and builds its own printer
3. Impact: print preview opens faster by eliminating one redundant
synchronous printer enumeration; no behavior change for valid
print paths; no -Wunused-variable warning after removal
Log: Remove dead DPrinter construction to speed up print preview
Influence:
1. Test print preview with a syntax-highlighted file
2. Test print preview with a plain text file
3. Verify no unused-variable warnings in build output
fix: 删除 popupPrintDialog 中无用的 DPrinter 构造
1. 根因:popupPrintDialog() 构造了一个从未使用的 DPrinter 局部
变量(QPrinter::HighResolution),其构造函数同步加载 cups
插件并枚举打印机,为打印预览增加不必要的延迟
2. 方案:删除由 commit 9fcf3e4 引入的无用 DPrinter printer(
QPrinter::HighResolution) 行;实际打印对话框使用无参
DPrintPreviewDialog 并在内部自建 printer
3. 影响:消除一次冗余的同步打印机枚举,打印预览打开更快;
对有效打印路径无行为变化;删除后无 -Wunused-variable 告警
Log: 删除无用 DPrinter 构造以加速打印预览
Influence:
1. 测试语法高亮文件的打印预览
2. 测试纯文本文件的打印预览
3. 验证编译输出无 unused-variable 告警
PMS: BUG-3750531 parent 3273183 commit ece08fc
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2441 | 2441 | | |
2442 | 2442 | | |
2443 | 2443 | | |
2444 | | - | |
2445 | 2444 | | |
2446 | 2445 | | |
2447 | 2446 | | |
| |||
0 commit comments