aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/subwindow.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-26 19:51:52 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-26 19:51:52 +0200
commit5825451aef1a762bfaeff2d37c09b3790deee7b1 (patch)
tree75feca7f6483e25d9bd920645e6044d3bb22966b /src/mainwindow/subwindow.cpp
parentUpdate pkgbuild (diff)
downloadsmolbote-5825451aef1a762bfaeff2d37c09b3790deee7b1.tar.xz
Socket messages are json formatted
Diffstat (limited to 'src/mainwindow/subwindow.cpp')
-rw-r--r--src/mainwindow/subwindow.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mainwindow/subwindow.cpp b/src/mainwindow/subwindow.cpp
index 354e07e..bcddabf 100644
--- a/src/mainwindow/subwindow.cpp
+++ b/src/mainwindow/subwindow.cpp
@@ -31,14 +31,14 @@ SubWindow::SubWindow(const QHash<QString, QString> &config, QWidget *parent, Qt:
resize(800, 600);
setWidget(tabWidget);
- profile = WebProfile::defaultProfile();
+ m_profile = WebProfile::defaultProfile();
// system menu
{
auto *menu = systemMenu();
menu->addSeparator();
- auto *profileName_action = menu->addAction(tr("Profile: %1").arg(profile->name()));
+ auto *profileName_action = menu->addAction(tr("Profile: %1").arg(m_profile->name()));
profileName_action->setEnabled(false);
auto *loadProfile_menu = menu->addMenu(tr("Load profile"));
@@ -130,16 +130,21 @@ WebView *SubWindow::view(int index) const
void SubWindow::setProfile(WebProfile *profile)
{
Q_CHECK_PTR(profile);
- this->profile = profile;
+ this->m_profile = profile;
for(int i = 0; i < tabWidget->count(); ++i) {
auto *view = qobject_cast<WebView *>(tabWidget->widget(i));
view->setProfile(profile);
}
}
+WebProfile *SubWindow::profile() const
+{
+ return m_profile;
+}
+
int SubWindow::addTab(const QUrl &url)
{
- auto *view = new WebView(profile, this);
+ auto *view = new WebView(m_profile, this);
if(!url.isEmpty())
view->load(url);
return tabWidget->addTab(view);
@@ -153,7 +158,7 @@ void SubWindow::setCurrentTab(int index)
QJsonObject SubWindow::session() const
{
QJsonObject obj;
- obj.insert("profile", ProfileManager::id(profile));
+ obj.insert("profile", ProfileManager::id(m_profile));
QJsonArray tabs;
for(int i = 0; i < tabWidget->count(); ++i) {