diff --git a/src/plugins/FlashCookieManager/fcm_dialog.cpp b/src/plugins/FlashCookieManager/fcm_dialog.cpp index 6bfcbe4d0..ed1c1238c 100644 --- a/src/plugins/FlashCookieManager/fcm_dialog.cpp +++ b/src/plugins/FlashCookieManager/fcm_dialog.cpp @@ -65,13 +65,11 @@ FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent) connect(ui->autoMode, SIGNAL(toggled(bool)), ui->notification, SLOT(setEnabled(bool))); connect(ui->autoMode, SIGNAL(toggled(bool)), ui->labelNotification, SLOT(setEnabled(bool))); - connect(ui->browseFlashDataPath, SIGNAL(clicked()), this, SLOT(selectFlashDataPath())); ui->autoMode->setChecked(m_manager->readSettings().value(QL1S("autoMode")).toBool()); ui->notification->setEnabled(m_manager->readSettings().value(QL1S("autoMode")).toBool()); ui->notification->setChecked(m_manager->readSettings().value(QL1S("notification")).toBool()); ui->deleteAllOnStartExit->setChecked(m_manager->readSettings().value(QL1S("deleteAllOnStartExit")).toBool()); - ui->flashDataPath->setText(m_manager->flashPlayerDataPath()); ui->labelNotification->setEnabled(ui->autoMode->isChecked()); @@ -370,14 +368,6 @@ void FCM_Dialog::reloadFromDisk() refreshView(true); } -void FCM_Dialog::selectFlashDataPath() -{ - QString path = QzTools::getExistingDirectory(QL1S("FCM_Plugin_FlashDataPath"), this, tr("Select Flash Data Path"), ui->flashDataPath->text()); - if (!path.isEmpty()) { - ui->flashDataPath->setText(path); - } -} - void FCM_Dialog::cookieTreeContextMenuRequested(const QPoint &pos) { QMenu menu; @@ -426,12 +416,6 @@ void FCM_Dialog::closeEvent(QCloseEvent* e) settingsHash.insert(QL1S("notification"), QVariant(ui->notification->isChecked())); settingsHash.insert(QL1S("flashCookiesWhitelist"), flashWhitelist); settingsHash.insert(QL1S("flashCookiesBlacklist"), flashBlacklist); - - QString path = ui->flashDataPath->text(); - path.replace(QL1C('\\'), QL1C('/')); - - settingsHash.insert(QL1S("flashDataPath"), path); - m_manager->writeSettings(settingsHash); e->accept(); diff --git a/src/plugins/FlashCookieManager/fcm_dialog.h b/src/plugins/FlashCookieManager/fcm_dialog.h index 3f553bad4..231b8b2be 100644 --- a/src/plugins/FlashCookieManager/fcm_dialog.h +++ b/src/plugins/FlashCookieManager/fcm_dialog.h @@ -66,7 +66,6 @@ private slots: void filterString(const QString &string); void reloadFromDisk(); - void selectFlashDataPath(); void cookieTreeContextMenuRequested(const QPoint &pos); private: diff --git a/src/plugins/FlashCookieManager/fcm_dialog.ui b/src/plugins/FlashCookieManager/fcm_dialog.ui index 6ea2e3704..7453631f1 100644 --- a/src/plugins/FlashCookieManager/fcm_dialog.ui +++ b/src/plugins/FlashCookieManager/fcm_dialog.ui @@ -454,7 +454,7 @@ - + @@ -484,14 +484,14 @@ - + QDialogButtonBox::Close - + Qt::Vertical @@ -504,7 +504,7 @@ - + <html><head/><body><p><span style=" font-weight:600;">Note:</span> This settings are just applied to flash cookies, to manage HTTP cookies use <span style=" font-weight:600;">Cookies Manager</span>. </p></body></html> @@ -517,7 +517,7 @@ - + @@ -544,7 +544,7 @@ - + @@ -571,56 +571,6 @@ - - - - - - Flash data path*: - - - - - - - - - - - 0 - 0 - - - - Browse... - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - *: You should select directory that contains #SharedObject as a subfolder. - - - true - - - diff --git a/src/plugins/FlashCookieManager/fcm_plugin.cpp b/src/plugins/FlashCookieManager/fcm_plugin.cpp index d1672d5fe..7ba8b0e0c 100644 --- a/src/plugins/FlashCookieManager/fcm_plugin.cpp +++ b/src/plugins/FlashCookieManager/fcm_plugin.cpp @@ -23,6 +23,7 @@ #include "clickablelabel.h" #include "tabbedwebview.h" #include "fcm_notification.h" +#include "datapaths.h" #include #include @@ -157,43 +158,6 @@ void FCM_Plugin::clearCache() m_flashCookies.clear(); } -QString FCM_Plugin::flashDataPathForOS() const -{ - /* On Microsoft Windows NT 5.x and 6.x, they are stored in: - * %APPDATA%\Macromedia\Flash Player\#SharedObjects\ - * %APPDATA%\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\ - * On Mac OS X, they are stored in: - * ~/Library/Preferences/Macromedia/Flash Player/#SharedObjects/ - * ~/Library/Preferences/Macromedia/Flash Player/macromedia.com/support/flashplayer/sys/ - * On Linux or Unix, they are stored in: - * ~/.macromedia/Flash_Player/#SharedObjects/ - * ~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/ - * For Linux and Unix systems, if the open-source Gnash plugin is being used - * instead of the official Adobe Flash, they will instead be found at: - * ~/.gnash/SharedObjects/ - */ - - if (m_flashDataPathForOS.isEmpty()) { -#if defined(Q_OS_WIN) || defined(Q_OS_OS2) - QString appData = QProcessEnvironment::systemEnvironment().value(QL1S("APPDATA")); - appData.replace(QL1C('\\'), QL1C('/')); - - m_flashDataPathForOS = (appData + QL1S("/Macromedia/Flash Player")); -#elif defined(Q_OS_MAC) - m_flashDataPathForOS = QDir::homePath() + QL1S("/Library/Preferences/Macromedia/Flash Player"); -#else - if (QDir::home().cd(QL1S(".macromedia"))) { - m_flashDataPathForOS = QDir::homePath() + QL1S("/.macromedia/Flash_Player"); - } - else { - m_flashDataPathForOS = QDir::homePath() + QL1S("/.gnash"); - } -#endif - } - - return m_flashDataPathForOS; -} - bool FCM_Plugin::isBlacklisted(const FlashCookie &flashCookie) { return readSettings().value(QL1S("flashCookiesBlacklist")).toStringList().contains(flashCookie.origin); @@ -228,7 +192,7 @@ QString FCM_Plugin::sharedObjectDirName() const QString FCM_Plugin::flashPlayerDataPath() const { - return readSettings().value(QL1S("flashDataPath")).toString(); + return DataPaths::currentProfilePath() + QSL("/Pepper Data/Shockwave Flash/WritableRoot/"); } QVariantHash FCM_Plugin::readSettings() const @@ -239,7 +203,6 @@ QVariantHash FCM_Plugin::readSettings() const m_settingsHash.insert(QL1S("notification"), QVariant(false)); m_settingsHash.insert(QL1S("flashCookiesWhitelist"), QVariant()); m_settingsHash.insert(QL1S("flashCookiesBlacklist"), QVariant()); - m_settingsHash.insert(QL1S("flashDataPath"), flashDataPathForOS()); QSettings settings(m_settingsPath + QL1S("/extensions.ini"), QSettings::IniFormat); settings.beginGroup(QL1S("FlashCookieManager")); diff --git a/src/plugins/FlashCookieManager/fcm_plugin.h b/src/plugins/FlashCookieManager/fcm_plugin.h index 31a2441f3..41a74774a 100644 --- a/src/plugins/FlashCookieManager/fcm_plugin.h +++ b/src/plugins/FlashCookieManager/fcm_plugin.h @@ -84,7 +84,6 @@ private: void loadFlashCookies(QString path); void insertFlashCookie(QString path); QString extractOriginFrom(const QString &path); - QString flashDataPathForOS() const; bool isBlacklisted(const FlashCookie &flashCookie); bool isWhitelisted(const FlashCookie &flashCookie); void removeAllButWhitelisted(); @@ -104,7 +103,6 @@ private: QStringList m_blaklist; QStringList m_whitelist; QStringList m_newCookiesList; - mutable QString m_flashDataPathForOS; }; Q_DECLARE_METATYPE(FlashCookie);