don't use shared ptr on projects

Really unnecessary
This commit is contained in:
itsmattkc
2020-11-27 14:24:02 +11:00
parent b178dfa06e
commit f8ceefff6c
17 changed files with 86 additions and 116 deletions
+10 -22
View File
@@ -36,43 +36,35 @@ ProjectToolbar::ProjectToolbar(QWidget *parent) :
layout->setMargin(0);
new_button_ = new QPushButton();
connect(new_button_, SIGNAL(clicked(bool)), this, SIGNAL(NewClicked()));
connect(new_button_, &QPushButton::clicked, this, &ProjectToolbar::NewClicked);
layout->addWidget(new_button_);
open_button_ = new QPushButton();
connect(open_button_, SIGNAL(clicked(bool)), this, SIGNAL(OpenClicked()));
connect(open_button_, &QPushButton::clicked, this, &ProjectToolbar::OpenClicked);
layout->addWidget(open_button_);
save_button_ = new QPushButton();
connect(save_button_, SIGNAL(clicked(bool)), this, SIGNAL(SaveClicked()));
connect(save_button_, &QPushButton::clicked, this, &ProjectToolbar::SaveClicked);
layout->addWidget(save_button_);
undo_button_ = new QPushButton();
connect(undo_button_, SIGNAL(clicked(bool)), this, SIGNAL(UndoClicked()));
layout->addWidget(undo_button_);
redo_button_ = new QPushButton();
connect(redo_button_, SIGNAL(clicked(bool)), this, SIGNAL(RedoClicked()));
layout->addWidget(redo_button_);
search_field_ = new QLineEdit();
search_field_->setClearButtonEnabled(true);
connect(search_field_, SIGNAL(textChanged(const QString &)), this, SIGNAL(SearchChanged(const QString&)));
connect(search_field_, &QLineEdit::textChanged, this, &ProjectToolbar::SearchChanged);
layout->addWidget(search_field_);
tree_button_ = new QPushButton();
tree_button_->setCheckable(true);
connect(tree_button_, SIGNAL(clicked(bool)), this, SLOT(ViewButtonClicked()));
connect(tree_button_, &QPushButton::clicked, this, &ProjectToolbar::ViewButtonClicked);
layout->addWidget(tree_button_);
list_button_ = new QPushButton();
list_button_->setCheckable(true);
connect(list_button_, SIGNAL(clicked(bool)), this, SLOT(ViewButtonClicked()));
connect(list_button_, &QPushButton::clicked, this, &ProjectToolbar::ViewButtonClicked);
layout->addWidget(list_button_);
icon_button_ = new QPushButton();
icon_button_->setCheckable(true);
connect(icon_button_, SIGNAL(clicked(bool)), this, SLOT(ViewButtonClicked()));
connect(icon_button_, &QPushButton::clicked, this, &ProjectToolbar::ViewButtonClicked);
layout->addWidget(icon_button_);
// Group Tree/List/Icon view buttons into a button group for easy exclusive-buttons
@@ -116,14 +108,12 @@ void ProjectToolbar::Retranslate()
new_button_->setToolTip(tr("New..."));
open_button_->setToolTip(tr("Open Project"));
save_button_->setToolTip(tr("Save Project"));
undo_button_->setToolTip(tr("Undo"));
redo_button_->setToolTip(tr("Redo"));
search_field_->setPlaceholderText(tr("Search media, markers, etc."));
tree_button_->setToolTip(tr("Switch to Tree View"));
list_button_->setToolTip(tr("Switch to List View"));
icon_button_->setToolTip(tr("Switch to Icon View"));
tree_button_->setToolTip(tr("Tree View"));
list_button_->setToolTip(tr("List View"));
icon_button_->setToolTip(tr("Icon View"));
}
void ProjectToolbar::UpdateIcons()
@@ -131,8 +121,6 @@ void ProjectToolbar::UpdateIcons()
new_button_->setIcon(icon::New);
open_button_->setIcon(icon::Open);
save_button_->setIcon(icon::Save);
undo_button_->setIcon(icon::Undo);
redo_button_->setIcon(icon::Redo);
tree_button_->setIcon(icon::TreeView);
list_button_->setIcon(icon::ListView);
icon_button_->setIcon(icon::IconView);