Commit 98ba4aa
refactor: Replace popen with QProcess for process count and kill operations
- Updated `getProcessCountByName` to use `QProcess` for executing the `ps` command, improving reliability and handling of process output.
- Refactored `killProcessByName` to utilize `QProcess` for killing processes, enhancing code consistency and error handling.
- Improved null and empty string checks for process names in both functions.
This change enhances the maintainability and performance of process management in the application.1 parent 414e16a commit 98ba4aa
1 file changed
Lines changed: 28 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | | - | |
752 | | - | |
753 | | - | |
| 751 | + | |
754 | 752 | | |
755 | 753 | | |
756 | | - | |
| 754 | + | |
| 755 | + | |
757 | 756 | | |
758 | 757 | | |
759 | | - | |
760 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
761 | 768 | | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
767 | 772 | | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | 773 | | |
772 | 774 | | |
| 775 | + | |
773 | 776 | | |
774 | 777 | | |
775 | 778 | | |
776 | 779 | | |
777 | 780 | | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
783 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
784 | 793 | | |
785 | 794 | | |
786 | 795 | | |
| |||
0 commit comments