mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 12:44:07 +00:00
e6ab87ca73
due to iframe security policy and x-frame-option . the website online dictionary can not work in qt 5.15.2+ version. this is a workaround to pass through the restriction.
30 lines
670 B
C++
30 lines
670 B
C++
#include "globalbroadcaster.h"
|
|
#include <QGlobalStatic>
|
|
|
|
Q_GLOBAL_STATIC( GlobalBroadcaster, bdcaster )
|
|
GlobalBroadcaster::GlobalBroadcaster( QObject * parent ) : QObject( parent )
|
|
{
|
|
}
|
|
|
|
GlobalBroadcaster * GlobalBroadcaster::instance()
|
|
{
|
|
return bdcaster;
|
|
}
|
|
void GlobalBroadcaster::setPreference( Config::Preferences * p )
|
|
{
|
|
preference = p;
|
|
}
|
|
Config::Preferences * GlobalBroadcaster::getPreference()
|
|
{
|
|
return preference;
|
|
}
|
|
|
|
void GlobalBroadcaster::addWhitelist(QString url){
|
|
whitelist.push_back(url);
|
|
}
|
|
|
|
bool GlobalBroadcaster::existedInWhitelist(QString url){
|
|
return std::find(whitelist.begin(), whitelist.end(), url) != whitelist.end();
|
|
}
|
|
// namespace global
|