1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

CookieManager: Switch to QDialog

This fixes issue when Cookie Manager may have been opened
under current window (eg. in Preferences)
This commit is contained in:
David Rosca 2014-10-03 09:13:52 +02:00
parent 768e3ac143
commit 021b90f7b3
8 changed files with 12 additions and 30 deletions

View File

@ -35,7 +35,6 @@
#include "sqldatabase.h"
#include "iconprovider.h"
#include "browserwindow.h"
#include "cookiemanager.h"
#include "networkmanager.h"
#include "checkboxdialog.h"
#include "profilemanager.h"
@ -88,7 +87,6 @@ MainApplication::MainApplication(int &argc, char** argv)
, m_networkCache(0)
, m_browsingLibrary(0)
, m_rssManager(0)
, m_cookieManager(0)
, m_networkManager(0)
, m_restoreManager(0)
, m_downloadManager(0)
@ -531,14 +529,6 @@ RSSManager* MainApplication::rssManager()
return m_rssManager;
}
CookieManager* MainApplication::cookieManager()
{
if (!m_cookieManager) {
m_cookieManager = new CookieManager();
}
return m_cookieManager;
}
NetworkManager* MainApplication::networkManager()
{
if (!m_networkManager) {

View File

@ -38,7 +38,6 @@ class AutoSaver;
class RSSManager;
class ProxyStyle;
class PluginProxy;
class CookieManager;
class BrowserWindow;
class NetworkManager;
class BrowsingLibrary;
@ -93,7 +92,6 @@ public:
BrowsingLibrary* browsingLibrary();
RSSManager* rssManager();
CookieManager* cookieManager();
NetworkManager* networkManager();
RestoreManager* restoreManager();
DownloadManager* downloadManager();
@ -158,7 +156,6 @@ private:
BrowsingLibrary* m_browsingLibrary;
RSSManager* m_rssManager;
CookieManager* m_cookieManager;
NetworkManager* m_networkManager;
RestoreManager* m_restoreManager;
DownloadManager* m_downloadManager;

View File

@ -315,8 +315,8 @@ void MainMenu::showDownloadManager()
void MainMenu::showCookieManager()
{
CookieManager* m = mApp->cookieManager();
m->refreshTable();
CookieManager* m = new CookieManager(0);
m->setAttribute(Qt::WA_DeleteOnClose);
m->show();
m->raise();
}

View File

@ -33,7 +33,7 @@
#include <QCloseEvent>
CookieManager::CookieManager(QWidget* parent)
: QWidget(parent)
: QDialog(parent)
, ui(new Ui::CookieManager)
, m_refreshCookieJar(true)
{
@ -87,6 +87,8 @@ CookieManager::CookieManager(QWidget* parent)
connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed()));
QzTools::setWmClass("Cookies", this);
refreshTable();
}
void CookieManager::removeAll()

View File

@ -18,7 +18,7 @@
#ifndef COOKIEMANAGER_H
#define COOKIEMANAGER_H
#include <QWidget>
#include <QDialog>
#include "qzcommon.h"
@ -31,7 +31,7 @@ class QTreeWidgetItem;
class BrowserWindow;
class QUPZILLA_EXPORT CookieManager : public QWidget
class QUPZILLA_EXPORT CookieManager : public QDialog
{
Q_OBJECT

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CookieManager</class>
<widget class="QWidget" name="CookieManager">
<widget class="QDialog" name="CookieManager">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -185,12 +185,8 @@ void ClearPrivateData::optimizeDb()
void ClearPrivateData::showCookieManager()
{
CookieManager* m = mApp->cookieManager();
m->refreshTable();
m->setWindowModality(Qt::WindowModal);
m->show();
m->raise();
CookieManager m(this);
m.exec();
}
void ClearPrivateData::showNotifsPerms()

View File

@ -684,11 +684,8 @@ void Preferences::allowHtml5storageChanged(bool stat)
void Preferences::showCookieManager()
{
CookieManager* m = mApp->cookieManager();
m->refreshTable();
m->show();
m->raise();
CookieManager m(this);
m.exec();
}
void Preferences::showHtml5Permissions()