Skip to content

Commit 5a89072

Browse files
committed
modified initialization of members
1 parent 19a80a8 commit 5a89072

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

radeon-profile/daemonComm.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#include "daemonComm.h"
55
#include <QDebug>
66

7-
daemonComm::daemonComm() {
8-
signalSender = new QLocalSocket(this);
7+
daemonComm::daemonComm() : signalSender(new QLocalSocket(this)) {
98
feedback.setDevice(signalSender);
109
connect(signalSender,SIGNAL(readyRead()), this, SLOT(receiveFeedback()));
1110
}

radeon-profile/dxorg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <QString>
1212
#include <QStringList>
1313

14-
dXorg::dXorg(const GPUSysInfo &si) {
14+
dXorg::dXorg(const GPUSysInfo &si) : ioctlHnd(nullptr) {
1515
features.sysInfo = si;
1616
configure();
1717
figureOutConstParams();

radeon-profile/dxorg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class dXorg
2525
};
2626

2727
public:
28-
dXorg() { }
28+
dXorg() : ioctlHnd(nullptr) { }
2929
dXorg(const GPUSysInfo &si);
3030

3131
void cleanup() {
@@ -79,7 +79,7 @@ class dXorg
7979
RxPatterns rxPatterns;
8080

8181
daemonComm dcomm;
82-
ioctlHandler *ioctlHnd = nullptr;
82+
ioctlHandler *ioctlHnd;
8383

8484
QString getClocksRawData(bool forFeatures = false);
8585
QString findSysfsHwmonForGPU();

radeon-profile/execbin.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
#include <QLabel>
88
#include <QFileDialog>
99

10-
ExecBin::ExecBin() : QObject() {
11-
p = new QProcess();
12-
mainLay = new QVBoxLayout();
13-
btnLay = new QHBoxLayout();
14-
tab = new QWidget();
15-
output = new QPlainTextEdit();
16-
cmd = new QPlainTextEdit();
17-
lStatus = new QLabel();
18-
btnSave = new QPushButton();
19-
10+
ExecBin::ExecBin() : QObject(),
11+
tab(new QWidget()),
12+
p(new QProcess(this)),
13+
output(new QPlainTextEdit()),
14+
cmd(new QPlainTextEdit()),
15+
mainLay(new QVBoxLayout()),
16+
btnLay(new QHBoxLayout()),
17+
lStatus(new QLabel()),
18+
btnSave(new QPushButton())
19+
20+
{
2021
setupTab();
2122

2223
connect(p,SIGNAL(readyReadStandardOutput()),this,SLOT(execProcessReadOutput()));

radeon-profile/gpu.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class gpu : public QObject
1616

1717
Q_OBJECT
1818
public:
19-
explicit gpu(QObject *parent = 0 ) : QObject(parent) {
20-
currentGpuIndex = 0;
19+
explicit gpu(QObject *parent = 0 ) : QObject(parent), currentGpuIndex(0) {
2120
connect(&futureGpuUsage, SIGNAL(finished()),this,SLOT(handleGpuUsageResult()));
2221
}
2322

radeon-profile/radeon_profile.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ unsigned int radeon_profile::minFanStepsSpeed = 10;
3333

3434
radeon_profile::radeon_profile(QWidget *parent) :
3535
QMainWindow(parent),
36+
timer(new QTimer(this)),
37+
counter_ticks(0),
38+
counter_statsTick(0),
39+
hysteresisRelativeTepmerature(0),
40+
ocTableModified(false),
41+
savedState(nullptr),
3642
ui(new Ui::radeon_profile)
3743
{
3844
ui->setupUi(this);
@@ -46,7 +52,6 @@ radeon_profile::radeon_profile(QWidget *parent) :
4652
ui->label_rootWarrning->setVisible(false);
4753
}
4854

49-
timer = new QTimer(this);
5055
loadConfig();
5156

5257
// find device and initialize it
@@ -59,10 +64,6 @@ radeon_profile::radeon_profile(QWidget *parent) :
5964
return;
6065
}
6166

62-
counter_ticks = 0;
63-
counter_statsTick = 0;
64-
savedState = nullptr;
65-
6667
// create runtime stuff, setup rest of ui
6768
setupUiElements();
6869

radeon-profile/radeon_profile.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private slots:
161161

162162
QSystemTrayIcon *icon_tray;
163163
QAction *refreshWhenHidden;
164-
QTimer *timer = nullptr;
164+
QTimer *timer;
165165

166166
gpu device;
167167
QList<ExecBin*> execsRunning;
@@ -170,8 +170,8 @@ private slots:
170170
QMap<QString, RPEvent> events;
171171
QMap<QString, unsigned int> pmStats;
172172
unsigned int counter_ticks, counter_statsTick;
173-
short hysteresisRelativeTepmerature = 0;
174-
bool ocTableModified = false;
173+
short hysteresisRelativeTepmerature;
174+
bool ocTableModified;
175175
QButtonGroup group_pwm, group_Dpm;
176176
CurrentStateInfo *savedState;
177177
PlotManager plotManager;

0 commit comments

Comments
 (0)