diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 1b4a6a3f6..c2e1b79ee 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -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) { diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index e9c1eb1d1..9b42a9c24 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -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; diff --git a/src/lib/app/mainmenu.cpp b/src/lib/app/mainmenu.cpp index d184a9160..a9ab6d91e 100644 --- a/src/lib/app/mainmenu.cpp +++ b/src/lib/app/mainmenu.cpp @@ -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(); } diff --git a/src/lib/cookies/cookiemanager.cpp b/src/lib/cookies/cookiemanager.cpp index f23ae6219..c4cfaca39 100644 --- a/src/lib/cookies/cookiemanager.cpp +++ b/src/lib/cookies/cookiemanager.cpp @@ -33,7 +33,7 @@ #include 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() diff --git a/src/lib/cookies/cookiemanager.h b/src/lib/cookies/cookiemanager.h index cb6cfef00..b641f8865 100644 --- a/src/lib/cookies/cookiemanager.h +++ b/src/lib/cookies/cookiemanager.h @@ -18,7 +18,7 @@ #ifndef COOKIEMANAGER_H #define COOKIEMANAGER_H -#include +#include #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 diff --git a/src/lib/cookies/cookiemanager.ui b/src/lib/cookies/cookiemanager.ui index 58038e406..7d52c2550 100644 --- a/src/lib/cookies/cookiemanager.ui +++ b/src/lib/cookies/cookiemanager.ui @@ -1,7 +1,7 @@ CookieManager - + 0 diff --git a/src/lib/other/clearprivatedata.cpp b/src/lib/other/clearprivatedata.cpp index 31979676c..b6a7924d1 100644 --- a/src/lib/other/clearprivatedata.cpp +++ b/src/lib/other/clearprivatedata.cpp @@ -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() diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index ab84de576..e25ec9be6 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -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()