From 4739f509d9d5ebaef71a51cece8f75b6a7e4b3dc Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 7 Sep 2018 13:11:58 +0200 Subject: Move ProfileManager to libweb --- plugins/ProfileEditor/forms/profilemanagerdialog.cpp | 6 +++--- plugins/ProfileEditor/forms/profilemanagerdialog.h | 3 ++- plugins/ProfileEditor/forms/profileview.cpp | 2 +- plugins/ProfileEditor/profileeditorplugin.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'plugins/ProfileEditor') diff --git a/plugins/ProfileEditor/forms/profilemanagerdialog.cpp b/plugins/ProfileEditor/forms/profilemanagerdialog.cpp index dac4a61..7920f90 100644 --- a/plugins/ProfileEditor/forms/profilemanagerdialog.cpp +++ b/plugins/ProfileEditor/forms/profilemanagerdialog.cpp @@ -6,7 +6,7 @@ #include #include "newprofiledialog.h" -ProfileManagerDialog::ProfileManagerDialog(const QVector &profiles, QWidget *parent) +ProfileManagerDialog::ProfileManagerDialog(const ProfileManager *profiles, QWidget *parent) : QDialog(parent) , ui(new Ui::ProfileManagerDialog) { @@ -27,7 +27,7 @@ ProfileManagerDialog::ProfileManagerDialog(const QVector &profiles deleteProfile(ui->listWidget->currentItem()); }); - for(auto *profile : profiles) { + for(auto *profile : profiles->profileList().values()) { addProfile(profile); } } @@ -85,7 +85,7 @@ void ProfileManagerDialog::deleteProfile(QListWidgetItem *item) Q_ASSERT(!profile.isNull()); qDebug("deleting profile %s", qUtf8Printable(profile->name())); - qDebug("deleting %s: %s", qUtf8Printable(profile->configurationPath()), QFile(profile->configurationPath()).remove() ? "okay" : "failed"); + //qDebug("deleting %s: %s", qUtf8Printable(profile->configurationPath()), QFile(profile->configurationPath()).remove() ? "okay" : "failed"); qDebug("deleting %s: %s", qUtf8Printable(profile->persistentStoragePath()), QDir(profile->persistentStoragePath()).removeRecursively() ? "okay" : "failed"); qDebug("deleting %s: %s", qUtf8Printable(profile->cachePath()), QDir(profile->cachePath()).removeRecursively() ? "okay" : "failed"); diff --git a/plugins/ProfileEditor/forms/profilemanagerdialog.h b/plugins/ProfileEditor/forms/profilemanagerdialog.h index 4f468c5..ce38777 100644 --- a/plugins/ProfileEditor/forms/profilemanagerdialog.h +++ b/plugins/ProfileEditor/forms/profilemanagerdialog.h @@ -3,6 +3,7 @@ #include #include +#include namespace Ui { @@ -16,7 +17,7 @@ class ProfileManagerDialog : public QDialog Q_OBJECT public: - explicit ProfileManagerDialog(const QVector &profiles, QWidget *parent = 0); + explicit ProfileManagerDialog(const ProfileManager *profiles, QWidget *parent = 0); ~ProfileManagerDialog(); signals: diff --git a/plugins/ProfileEditor/forms/profileview.cpp b/plugins/ProfileEditor/forms/profileview.cpp index 85dde12..e265e16 100644 --- a/plugins/ProfileEditor/forms/profileview.cpp +++ b/plugins/ProfileEditor/forms/profileview.cpp @@ -9,6 +9,7 @@ #include "profileview.h" #include "ui_profileview.h" #include +#include #include #include #include @@ -33,7 +34,6 @@ ProfileView::ProfileView(WebProfile *profile, QWidget *parent) // general tab ui->name->setText(profile->name()); ui->offTheRecord->setChecked(profile->isOffTheRecord()); - ui->configurationPath->setText(profile->configurationPath()); // http tab ui->userAgent->setPlainText(m_profile->httpUserAgent()); diff --git a/plugins/ProfileEditor/profileeditorplugin.cpp b/plugins/ProfileEditor/profileeditorplugin.cpp index 32b0b8d..b158d6b 100644 --- a/plugins/ProfileEditor/profileeditorplugin.cpp +++ b/plugins/ProfileEditor/profileeditorplugin.cpp @@ -26,7 +26,7 @@ QHash> ProfileEditorPlugin::commands() QDialog *ProfileEditorPlugin::createWidget(QWidget *parent) { Q_CHECK_PTR(browser); - auto *widget = new ProfileManagerDialog(browser->profiles(), parent); + auto *widget = new ProfileManagerDialog(browser->getProfileManager(), parent); widget->setAttribute(Qt::WA_DeleteOnClose, true); connect(widget, &ProfileManagerDialog::createProfile, this, [=](const QString &id) { -- cgit v1.2.1