From 1c53b56871a36fdf58e58ee87ac6b56d4e3355f0 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 19 Dec 2017 17:36:09 +0100 Subject: Changed license from GPL3+ to GPL3 --- src/browser.cpp | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) (limited to 'src/browser.cpp') diff --git a/src/browser.cpp b/src/browser.cpp index db535f3..f4cadb5 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -1,22 +1,10 @@ -/******************************************************************************* - ** - ** smolbote: yet another qute browser - ** Copyright (C) 2017 Xian Nox - ** - ** This program is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** This program is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with this program. If not, see . - ** - ******************************************************************************/ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: git://neueland.iserlohn-fortress.net/smolbote.git + * + * SPDX-License-Identifier: GPL-3.0 + */ #include "browser.h" #include @@ -35,12 +23,8 @@ Browser::Browser(int &argc, char *argv[]) : Browser::~Browser() { - // TODO: fix crash here -// qDeleteAll(m_windows); -// m_windows.clear(); - -// qDeleteAll(m_profiles); -// m_profiles.clear(); + // TODO: make sure all windows have saved their settings + // TODO: save session } void Browser::setConfiguration(std::shared_ptr &config) @@ -69,14 +53,15 @@ void Browser::loadProfiles() QDir profileDir(path); const QStringList profileList = profileDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + // set profile parents to nullptr, otherwise both Browser and std::shared_ptr try to free them for(const QString &name : profileList) { - std::shared_ptr profile = std::make_shared(name, profileDir.absoluteFilePath(name), this); + std::shared_ptr profile = std::make_shared(name, profileDir.absoluteFilePath(name), nullptr); profile->setRequestInterceptor(m_urlRequestInterceptor.get()); m_profiles.insert(name, profile); } // Also add the Off-the-record profile - std::shared_ptr otr = std::make_shared(this); + std::shared_ptr otr = std::make_shared(nullptr); otr->setRequestInterceptor(m_urlRequestInterceptor.get()); m_profiles.insert("", otr); -- cgit v1.2.1