diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-01 17:27:58 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-01 17:27:58 +0200 |
commit | 329e8de84fc8e0a2e4a04fbaf85ab0e1632c6084 (patch) | |
tree | 864df8426b543d6817d6e364be4889bc6e20d640 /plugins/ProfileEditor/forms/profilemanagerdialog.cpp | |
parent | Middle mouse button closes tab (diff) | |
download | smolbote-329e8de84fc8e0a2e4a04fbaf85ab0e1632c6084.tar.xz |
Only add profiles to profile manager at init
Diffstat (limited to 'plugins/ProfileEditor/forms/profilemanagerdialog.cpp')
-rw-r--r-- | plugins/ProfileEditor/forms/profilemanagerdialog.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/ProfileEditor/forms/profilemanagerdialog.cpp b/plugins/ProfileEditor/forms/profilemanagerdialog.cpp index c5fec2b..fbf7ad4 100644 --- a/plugins/ProfileEditor/forms/profilemanagerdialog.cpp +++ b/plugins/ProfileEditor/forms/profilemanagerdialog.cpp @@ -1,17 +1,21 @@ #include "profilemanagerdialog.h" +#include "profileview.h" #include "ui_profilemanagerdialog.h" #include <QWebEngineProfile> -#include <QLabel> -#include "profileview.h" -ProfileManagerDialog::ProfileManagerDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::ProfileManagerDialog) +ProfileManagerDialog::ProfileManagerDialog(QHash<QString, QWebEngineProfile *> &profiles, QWidget *parent) + : QDialog(parent) + , ui(new Ui::ProfileManagerDialog) + , profiles(profiles) { ui->setupUi(this); connect(ui->listWidget, &QListWidget::itemPressed, this, &ProfileManagerDialog::showProfile); showProfile(nullptr); + + for(const QString &name : profiles.keys()) { + ui->listWidget->addItem(name); + } } ProfileManagerDialog::~ProfileManagerDialog() @@ -19,12 +23,6 @@ ProfileManagerDialog::~ProfileManagerDialog() delete ui; } -void ProfileManagerDialog::addProfile(const QString &name, QWebEngineProfile *profile) -{ - profiles.insert(name, profile); - ui->listWidget->addItem(name); -} - void ProfileManagerDialog::showProfile(QListWidgetItem *item) { // clear out groupbox layout |