Debian Codegraph @

ProcessExplorer.cpp

raw symbols SCIP
1 #cxx . . $ `<file>/ProcessExplorer.cpp`/include "ProcessExplorer.h"cxx . . $ `<file>/ProcessExplorer.h`/
2 #include "ui_ProcessExplorer.h"cxx . . $ `<file>/.build/ui_ProcessExplorer.h`/
3
4 #include <QFile>
5 #include <QDir>
6 #include <QRegExp>
7
8 ProcessExplorercxx . . $ ProcessExplorer#::ProcessExplorercxx . . $ ProcessExplorer#ProcessExplorer(2a5d9dfebf5c0b7a).(int pid, QWidgetcxx . . $ QWidget# *parent) :
9 QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent),
10 uicxx . . $ ProcessExplorer#ui.(new Uicxx . . $ Ui/::ProcessExplorercxx . . $ Ui/ProcessExplorer#),
11 _pidcxx . . $ ProcessExplorer#_pid.(pid)
12 {
13 uicxx . . $ ProcessExplorer#ui.->setupUicxx . . $ Ui_ProcessExplorer#setupUi(d194de0c0f68c28b).(this);
14
15 fillFieldscxx . . $ ProcessExplorer#fillFields(d4f767463ce0a6b3).(_pidcxx . . $ ProcessExplorer#_pid.);
16
17 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->horizontalHeadercxx . . $ QTableView#horizontalHeader(f0c0fe1a435d30ff).()->setSectionResizeModecxx . . $ QHeaderView#setSectionResizeMode(5f195ea94ba55580).(0,QHeaderViewcxx . . $ QHeaderView#::ResizeToContentscxx . . $ QHeaderView#ResizeToContents.);
18 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->horizontalHeadercxx . . $ QTableView#horizontalHeader(f0c0fe1a435d30ff).()->setSectionResizeModecxx . . $ QHeaderView#setSectionResizeMode(5f195ea94ba55580).(1,QHeaderViewcxx . . $ QHeaderView#::Stretchcxx . . $ QHeaderView#Stretch.);
19 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->horizontalHeadercxx . . $ QTableView#horizontalHeader(f0c0fe1a435d30ff).()->setSectionResizeModecxx . . $ QHeaderView#setSectionResizeMode(5f195ea94ba55580).(2,QHeaderViewcxx . . $ QHeaderView#::ResizeToContentscxx . . $ QHeaderView#ResizeToContents.);
20 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->horizontalHeadercxx . . $ QTableView#horizontalHeader(f0c0fe1a435d30ff).()->setSectionResizeModecxx . . $ QHeaderView#setSectionResizeMode(5f195ea94ba55580).(3,QHeaderViewcxx . . $ QHeaderView#::ResizeToContentscxx . . $ QHeaderView#ResizeToContents.);
21
22 connectcxx . . $ QObject#connect(158df1d9a01a3410).(uicxx . . $ ProcessExplorer#ui.->pushButtoncxx . . $ Ui_ProcessExplorer#pushButton.,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked(bool)),this,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(close()));
23 }
24
25 ProcessExplorercxx . . $ ProcessExplorer#::~cxx . . $ ProcessExplorer#`~ProcessExplorer`(ced63f7c635d850d).ProcessExplorercxx . . $ ProcessExplorer#(){
26 delete uicxx . . $ ProcessExplorer#ui.;
27 }
28
29
30
31
32 void ProcessExplorercxx . . $ ProcessExplorer#::fillFieldscxx . . $ ProcessExplorer#fillFields(d4f767463ce0a6b3).(int pid){
33 uicxx . . $ ProcessExplorer#ui.->label_7cxx . . $ Ui_ProcessExplorer#label_7.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
34 uicxx . . $ ProcessExplorer#ui.->label_5cxx . . $ Ui_ProcessExplorer#label_5.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
35 uicxx . . $ ProcessExplorer#ui.->label_6cxx . . $ Ui_ProcessExplorer#label_6.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(""cxx . . $ QString#QString(85c52e162fed56f9).);
36
37
38 // general
39 QStringcxx . . $ QString# procPath = "/proc/"+cxx . . $ operator+(c75c3ae4eb9af1a8).QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(pid);
40
41 // path exe
42 QFilecxx . . $ QFile# filePathExecxx . . $ QFile#QFile(3520e46b33348bf6).(procPath+cxx . . $ operator+(3d22f08efddf8107)."/exe");
43 uicxx . . $ ProcessExplorer#ui.->label_5cxx . . $ Ui_ProcessExplorer#label_5.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(filePathExe.symLinkTargetcxx . . $ QFile#symLinkTarget(6ef7b6c27b00b43d).());
44
45 // command line
46 QFilecxx . . $ QFile# fileCmdLinecxx . . $ QFile#QFile(3520e46b33348bf6).(procPath+cxx . . $ operator+(3d22f08efddf8107)."/cmdline");
47 if (fileCmdLine.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::ReadOnlycxx . . $ QIODevice#ReadOnly.)){
48 QByteArraycxx . . $ QByteArray# fileContents = fileCmdLine.readAllcxx . . $ QIODevice#readAll(b3c286cec66e09f4).();
49 fileContents.replacecxx . . $ QByteArray#replace(b380de8df5b5769a).(char(0x00)," ");
50 uicxx . . $ ProcessExplorer#ui.->label_6cxx . . $ Ui_ProcessExplorer#label_6.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(fileContentscxx . . $ QString#QString(45672f3c6961a244).);
51 fileCmdLine.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).();
52 }
53
54 // path exe
55 QFilecxx . . $ QFile# fileCurrentDircxx . . $ QFile#QFile(3520e46b33348bf6).(procPath+cxx . . $ operator+(3d22f08efddf8107)."/cwd");
56 uicxx . . $ ProcessExplorer#ui.->label_7cxx . . $ Ui_ProcessExplorer#label_7.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(fileCurrentDir.symLinkTargetcxx . . $ QFile#symLinkTarget(6ef7b6c27b00b43d).());
57
58 QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringcxx . . $ QString#> mapFileProcStatus = mapFromFilecxx . . $ ProcessExplorer#mapFromFile(bf7ebe1b5126589d).("/proc/"+cxx . . $ operator+(c75c3ae4eb9af1a8).QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(pid)+cxx . . $ operator+(3d22f08efddf8107)."/status");
59
60 uicxx . . $ ProcessExplorer#ui.->label_8cxx . . $ Ui_ProcessExplorer#label_8.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(mapFileProcStatus[cxx . . $ QMap#`operator[]`(bbd415b616967878)."Pid"cxx . . $ QString#QString(85c52e162fed56f9).]);
61 uicxx . . $ ProcessExplorer#ui.->label_10cxx . . $ Ui_ProcessExplorer#label_10.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(mapFileProcStatus[cxx . . $ QMap#`operator[]`(bbd415b616967878)."PPid"cxx . . $ QString#QString(85c52e162fed56f9).]);
62 uicxx . . $ ProcessExplorer#ui.->label_12cxx . . $ Ui_ProcessExplorer#label_12.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(mapFileProcStatus[cxx . . $ QMap#`operator[]`(bbd415b616967878)."State"cxx . . $ QString#QString(85c52e162fed56f9).]);
63
64 // Environment
65 QFilecxx . . $ QFile# fileEnvironcxx . . $ QFile#QFile(3520e46b33348bf6).(procPath+cxx . . $ operator+(3d22f08efddf8107)."/environ");
66 if (fileEnviron.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::ReadOnlycxx . . $ QIODevice#ReadOnly.)){
67 QByteArraycxx . . $ QByteArray# fileContents = fileEnviron.readAllcxx . . $ QIODevice#readAll(b3c286cec66e09f4).();
68 fileContents.replacecxx . . $ QByteArray#replace(b380de8df5b5769a).(char(0x00),"\n");
69 uicxx . . $ ProcessExplorer#ui.->textEditcxx . . $ Ui_ProcessExplorer#textEdit.->setTextcxx . . $ QTextEdit#setText(3520e46b33348bf6).(fileContentscxx . . $ QString#QString(45672f3c6961a244).);
70 fileEnviron.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).();
71 }
72
73 // Files
74 QTableWidgetItemcxx . . $ QTableWidgetItem# *tmpWidgetItem = nullptr;
75 QDircxx . . $ QDir# dircxx . . $ QDir#QDir(3520e46b33348bf6).(procPath+cxx . . $ operator+(3d22f08efddf8107)."/fd");
76 dir.setFiltercxx . . $ QDir#setFilter(3cb6a626764edf13).(QDircxx . . $ QFlags#QFlags(93d577a3e9528307).::Filescxx . . $ QDir#Files.);
77 dir.setSortingcxx . . $ QDir#setSorting(d6e6037501f8ac03).(QDircxx . . $ QFlags#QFlags(93d577a3e9528307).::Namecxx . . $ QDir#Name.);
78 QFileInfoListcxx . . $ QFileInfoList# list = dir.entryInfoListcxx . . $ QDir#entryInfoList(c85cb969d00e05df).();
79 for (int i = 0; i < list.sizecxx . . $ QList#size(ea6fe5115c70a13f).(); ++i) {
80 QFileInfocxx . . $ QFileInfo# fileInfo = listcxx . . $ QFileInfo#QFileInfo(208c3155c9413262)..atcxx . . $ QList#at(e2681f9bb6b2f357).(i);
81 QStringcxx . . $ QString# Path = fileInfo.symLinkTargetcxx . . $ QFileInfo#symLinkTarget(6ef7b6c27b00b43d).();
82
83 QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringcxx . . $ QString#> mapFile = mapFromFilecxx . . $ ProcessExplorer#mapFromFile(bf7ebe1b5126589d).("/proc/"+cxx . . $ operator+(c75c3ae4eb9af1a8).QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(pid)+cxx . . $ operator+(3d22f08efddf8107)."/fdinfo/"+cxx . . $ operator+(fab9b4f80031f353).fileInfo.fileNamecxx . . $ QFileInfo#fileName(6ef7b6c27b00b43d).());
84 int pos = mapFile[cxx . . $ QMap#`operator[]`(bbd415b616967878)."pos"cxx . . $ QString#QString(85c52e162fed56f9).].toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
85 QStringcxx . . $ QString# flags = mapFilecxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QMap#`operator[]`(bbd415b616967878)."flags"cxx . . $ QString#QString(85c52e162fed56f9).];
86
87 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->setRowCountcxx . . $ QTableWidget#setRowCount(d4f767463ce0a6b3).(i+1);
88
89 tmpWidgetItem = new QTableWidgetItemcxx . . $ QTableWidgetItem#(fileInfo.fileNamecxx . . $ QFileInfo#fileName(6ef7b6c27b00b43d).());
90 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->setItemcxx . . $ QTableWidget#setItem(786223559052ea9b).(i, 0, tmpWidgetItem);
91
92 tmpWidgetItem = new QTableWidgetItemcxx . . $ QTableWidgetItem#(Path);
93 tmpWidgetItem->setToolTipcxx . . $ QTableWidgetItem#setToolTip(3520e46b33348bf6).(Path);
94 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->setItemcxx . . $ QTableWidget#setItem(786223559052ea9b).(i, 1, tmpWidgetItem);
95
96 tmpWidgetItem = new QTableWidgetItemcxx . . $ QTableWidgetItem#(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(pos));
97 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->setItemcxx . . $ QTableWidget#setItem(786223559052ea9b).(i, 2, tmpWidgetItem);
98
99 tmpWidgetItem = new QTableWidgetItemcxx . . $ QTableWidgetItem#(flags);
100 uicxx . . $ ProcessExplorer#ui.->tableWidgetcxx . . $ Ui_ProcessExplorer#tableWidget.->setItemcxx . . $ QTableWidget#setItem(786223559052ea9b).(i, 3, tmpWidgetItem);
101
102 }
103 }
104
105
106 QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringcxx . . $ QString#> ProcessExplorercxx . . $ ProcessExplorer#::mapFromFilecxx . . $ ProcessExplorer#mapFromFile(bf7ebe1b5126589d).(QStringcxx . . $ QString# path){
107 QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringcxx . . $ QString#> resultcxx . . $ QMap#QMap(ced63f7c635d850d).;
108
109 QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(path);
110 if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly.|cxx . . $ `operator|`(c9e45f682471e48d).QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)){
111 return resultcxx . . $ QMap#QMap(28c642871a274d78).;
112 }
113
114 QByteArraycxx . . $ QByteArray# contents = file.readAllcxx . . $ QIODevice#readAll(b3c286cec66e09f4).();
115 QStringListcxx . . $ QStringList# lines = QStringcxx . . $ QString#QString(45672f3c6961a244).(contents).splitcxx . . $ QString#split(4bed3a84ceee0bef).(QRegularExpressioncxx . . $ QRegularExpression#QRegularExpression(4279d2539df7cd4a).("[\r|\n]"cxx . . $ QString#QString(85c52e162fed56f9).));
116 for (QStringcxx . . $ QString# line:lines){
117 QStringListcxx . . $ QStringList# pairs = line.splitcxx . . $ QString#split(c8b44a97dcb6200d).(":"cxx . . $ QString#QString(85c52e162fed56f9).);
118 if (pairs.sizecxx . . $ QList#size(ea6fe5115c70a13f).()==2){
119 QStringcxx . . $ QString# key=pairscxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ QList#at(e2681f9bb6b2f357).(0);
120 QStringcxx . . $ QString# value = pairscxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ QList#at(e2681f9bb6b2f357).(1);
121 value.replacecxx . . $ QString#replace(bb08417d5c5b4bb6).(QRegularExpressioncxx . . $ QRegularExpression#QRegularExpression(4279d2539df7cd4a).("^\\s+"cxx . . $ QString#QString(85c52e162fed56f9).),""cxx . . $ QString#QString(85c52e162fed56f9).);
122 value.replacecxx . . $ QString#replace(bb08417d5c5b4bb6).(QRegularExpressioncxx . . $ QRegularExpression#QRegularExpression(4279d2539df7cd4a).("\\s+$"cxx . . $ QString#QString(85c52e162fed56f9).),""cxx . . $ QString#QString(85c52e162fed56f9).);
123
124 result[cxx . . $ QMap#`operator[]`(bbd415b616967878).key]=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).value;
125 }
126 }
127
128 file.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).();
129
130
131 return resultcxx . . $ QMap#QMap(28c642871a274d78).;
132 }