Merge pull request #1266 from MEschenbacher/ui-stats-optimize-format
Some checks are pending
Build status / Build (push) Waiting to run

ui: dialogs: stats: optimize string format
This commit is contained in:
Gustavo Iñiguez Goia 2025-02-14 00:21:59 +01:00 committed by GitHub
commit 4c805331bb
Failed to generate hash of commit

View file

@ -2470,20 +2470,18 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
return " WHERE what LIKE '%{0}%' ".format(text)
elif idx == StatsDialog.TAB_NETSTAT:
return " WHERE proc_comm LIKE '%{0}%' OR" \
" proc_path LIKE '%{1}%' OR" \
" state LIKE '%{2}%' OR" \
" src_port LIKE '%{3}%' OR" \
" src_ip LIKE '%{4}%' OR" \
" dst_ip LIKE '%{5}%' OR" \
" dst_port LIKE '%{6}%' OR" \
" proto LIKE '%{7}%' OR" \
" uid LIKE '%{8}%' OR" \
" proc_pid LIKE '%{9}%' OR" \
" family LIKE '%{10}%' OR" \
" iface LIKE '%{11}%' OR" \
" inode LIKE '%{12}%'".format(
text, text, text, text, text, text, text, text, text, text, text, text, text
)
" proc_path LIKE '%{0}%' OR" \
" state LIKE '%{0}%' OR" \
" src_port LIKE '%{0}%' OR" \
" src_ip LIKE '%{0}%' OR" \
" dst_ip LIKE '%{0}%' OR" \
" dst_port LIKE '%{0}%' OR" \
" proto LIKE '%{0}%' OR" \
" uid LIKE '%{0}%' OR" \
" proc_pid LIKE '%{0}%' OR" \
" family LIKE '%{0}%' OR" \
" iface LIKE '%{0}%' OR" \
" inode LIKE '%{0}%'".format(text)
return ""