2022-01-08 06:51:24 +00:00
|
|
|
#include "globalbroadcaster.h"
|
|
|
|
#include <QGlobalStatic>
|
|
|
|
|
2022-04-23 08:15:23 +00:00
|
|
|
Q_GLOBAL_STATIC( GlobalBroadcaster, bdcaster )
|
|
|
|
GlobalBroadcaster::GlobalBroadcaster( QObject * parent ) : QObject( parent )
|
2022-01-08 06:51:24 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-04-23 08:15:23 +00:00
|
|
|
GlobalBroadcaster * GlobalBroadcaster::instance()
|
|
|
|
{
|
|
|
|
return bdcaster;
|
|
|
|
}
|
|
|
|
void GlobalBroadcaster::setPreference( Config::Preferences * p )
|
|
|
|
{
|
|
|
|
preference = p;
|
|
|
|
}
|
|
|
|
Config::Preferences * GlobalBroadcaster::getPreference()
|
|
|
|
{
|
|
|
|
return preference;
|
|
|
|
}
|
2022-01-08 06:51:24 +00:00
|
|
|
|
2022-05-13 16:00:23 +00:00
|
|
|
void GlobalBroadcaster::addWhitelist(QString url){
|
|
|
|
whitelist.push_back(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GlobalBroadcaster::existedInWhitelist(QString url){
|
|
|
|
return std::find(whitelist.begin(), whitelist.end(), url) != whitelist.end();
|
|
|
|
}
|
2022-01-08 06:51:24 +00:00
|
|
|
// namespace global
|