summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-02-20 17:44:24 -0500
committerLouie S <louie@example.com>2024-02-20 17:44:24 -0500
commit2af22ca34e5120ba69cf20911bf802be57cc18dd (patch)
tree0aa5aee9e5e08a102710225c7bded97b110512ac
parent0b7be46511ec752f1f28e73eac787da633c47f46 (diff)
Improve group member variable initialization
-rw-r--r--src/group.cpp14
-rw-r--r--src/group.h7
2 files changed, 8 insertions, 13 deletions
diff --git a/src/group.cpp b/src/group.cpp
index 7b8f63d..781fb98 100644
--- a/src/group.cpp
+++ b/src/group.cpp
@@ -3,13 +3,13 @@
#include "group.h"
-Group::Group(int id, QString name, QString column, QString link, bool hidden) {
- this->id = id;
- this->name = name;
- this->column = column;
- this->link = link;
- this->hidden = hidden;
-
+Group::Group(int id, QString name, QString column, QString link, bool hidden) :
+ id(id),
+ name(name),
+ column(column),
+ link(link),
+ hidden(hidden)
+{
this->setContentsMargins(0, 10, 0, 10);
QLabel *name_label = new QLabel(this->name);
diff --git a/src/group.h b/src/group.h
index b6899a9..2c450f1 100644
--- a/src/group.h
+++ b/src/group.h
@@ -12,12 +12,7 @@ class Group : QVBoxLayout {
QString link;
bool hidden;
- Group( int id,
- QString name,
- QString column = "left",
- QString link = "",
- bool hidden = false
- );
+ Group(int id, QString name, QString column = "left", QString link = "", bool hidden = false);
};
#endif