Skip to content

Commit

Permalink
Initialize members in constructor
Browse files Browse the repository at this point in the history
Thanks to clang-tidy.
  • Loading branch information
luis-pereira authored and yan12125 committed Jan 19, 2024
1 parent e8a1aef commit 2f74dcf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/bookmarkswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ bool BookmarksModel::setData(const QModelIndex &index, const QVariant &value,

BookmarksWidget::BookmarksWidget(QWidget *parent)
: QWidget(parent)
, m_model(new BookmarksModel(this))
{
setupUi(this);

m_model = new BookmarksModel(this);
treeView->setModel(m_model);
treeView->header()->hide();
setFocusProxy(filterEdit);
Expand Down
8 changes: 4 additions & 4 deletions src/tab-switcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ class AppItemDelegate: public QStyledItemDelegate

// -----------------------------------------------------------------------------------------------------------

TabSwitcher::TabSwitcher(TabWidget* tabs):
QListView(tabs),
m_tabs(tabs)
TabSwitcher::TabSwitcher(TabWidget *tabs)
: QListView(tabs)
, m_timer(new QTimer(this))
, m_tabs(tabs)
{
setWindowFlags(Qt::Widget | Qt::Popup | Qt::WindowStaysOnTopHint);
setItemDelegate(new AppItemDelegate(frameWidth(), tabs));
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

m_timer = new QTimer(this);
m_timer->setInterval(100);
m_timer->setSingleShot(true);

Expand Down
6 changes: 3 additions & 3 deletions src/terminalconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include "properties.h"
#include "termwidget.h"

TerminalConfig::TerminalConfig(const QString & wdir, const QStringList & shell)
TerminalConfig::TerminalConfig(const QString &wdir, const QStringList &shell)
: m_workingDirectory(wdir)
, m_shell(shell)
{
m_workingDirectory = wdir;
m_shell = shell;
}

TerminalConfig::TerminalConfig()
Expand Down
13 changes: 7 additions & 6 deletions src/termwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,20 @@ bool TermWidget::eventFilter(QObject * /*obj*/, QEvent * ev)
return false;
}

TermWidget::TermWidget(TerminalConfig &cfg, QWidget * parent)
: QWidget(parent),
DBusAddressable(QStringLiteral("/terminals"))
TermWidget::TermWidget(TerminalConfig &cfg, QWidget *parent)
: QWidget(parent)
, DBusAddressable(QStringLiteral("/terminals"))
, m_term(new TermWidgetImpl(cfg, this))
, m_layout(new QVBoxLayout)
, m_border(palette().color(QPalette::Window))
{

#ifdef HAVE_QDBUS
registerAdapter<TerminalAdaptor, TermWidget>(this);
#endif
m_border = palette().color(QPalette::Window);
m_term = new TermWidgetImpl(cfg, this);

setFocusProxy(m_term);

m_layout = new QVBoxLayout;
setLayout(m_layout);

m_layout->addWidget(m_term);
Expand Down

0 comments on commit 2f74dcf

Please sign in to comment.