Skip to content
Permalink
Browse files

Ensure up-to-date built-in overlay blacklist.

This changeset makes the following modifications:

 1. The overlay DLL is changed to always consider the built-in blacklist,
    even if a blacklist is present in the registry.
    For Mumble users who have been running with the old blacklist behavior,
    this means that we'll be doing some duplicate checking for blacklist
    entries, but I don't think this matters in practice.

 2. Settings.cpp is changed to not do anything with overlay_blacklist.h.
    Effectively, this means that qslBlacklist now represents the items
    the user has added to the blacklist, and not the combination of both
    an outdated built-in list and the user's own entries.

 3. OverlayConfig.cpp is changed to always show all entries from
    overlay_blacklist.h. Entries from the built-in list are 'disabled',
    so they can't be interacted with.

For more information, see PR #1461
  • Loading branch information...
mkrautz committed Nov 2, 2014
1 parent e5b6dac commit f1dbd922b86ac52755f449f1bebca5c0c4b0937f
Showing with 38 additions and 12 deletions.
  1. +12 −1 overlay/lib.cpp
  2. +26 −1 src/mumble/OverlayConfig.cpp
  3. +0 −10 src/mumble/Settings.cpp
@@ -634,7 +634,18 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
}
}
} else {
// If there is no list in the registry, fallback to using the default blacklist
ods("Lib: no blacklist/whitelist found in the registry");
}

// As a last resort, if we're using blacklisting, check the built-in blacklist.
//
// If the registry query failed this means we're guaranteed to check the
// built-in list.
//
// If the list in the registry is out of sync, for example because the built-
// in list in overlay_blacklist.h was updated got updated, we're also
// guaranteed that we include all built-in blacklisted items in our check.
if (!usewhitelist) {
ods("Lib: Overlay fallback to default blacklist");
int i = 0;
while (overlayBlacklist[i]) {
@@ -45,6 +45,8 @@
#include "MainWindow.h"
#include "GlobalShortcut.h"

#include "../../overlay/overlay_blacklist.h"

static ConfigWidget *OverlayConfigDialogNew(Settings &st) {
return new OverlayConfig(st);
}
@@ -305,7 +307,25 @@ void OverlayConfig::load(const Settings &r) {
qlwiApplication->setData(Qt::UserRole, QVariant(str));
}

QStringList builtinBlacklist;
#ifdef Q_OS_WIN
int i = 0;
while (overlayBlacklist[i]) {
QString str = QLatin1String(overlayBlacklist[i]);
builtinBlacklist << str;
++i;
}
#endif
foreach (QString str, builtinBlacklist) {
OverlayAppInfo oai = applicationInfoForId(str);
QListWidgetItem *qlwiApplication = new QListWidgetItem(oai.qiIcon, oai.qsDisplayName, qlwBlacklist);
qlwiApplication->setFlags(qlwiApplication->flags() & ~Qt::ItemIsEnabled);
}

foreach(QString str, s.os.qslBlacklist) {
if (builtinBlacklist.contains(str)) {
continue;
}
OverlayAppInfo oai = applicationInfoForId(str);
QListWidgetItem *qlwiApplication = new QListWidgetItem(oai.qiIcon, oai.qsDisplayName, qlwBlacklist);
qlwiApplication->setData(Qt::UserRole, QVariant(str));
@@ -345,7 +365,12 @@ void OverlayConfig::save() const {
s.os.qslBlacklist.clear();
for (int i=0;i<qlwBlacklist->count();++i) {
QVariant qvUserData = qlwBlacklist->item(i)->data(Qt::UserRole);
s.os.qslBlacklist << qvUserData.toString();
QString str = qvUserData.toString();
// Built-in blacklist entries have no user data set.
// Skip them.
if (!str.isEmpty()) {
s.os.qslBlacklist << qvUserData.toString();
}
}

s.os.qslWhitelist.clear();
@@ -38,7 +38,6 @@
#include "Log.h"
#include "Global.h"
#include "../../overlay/overlay.h"
#include "../../overlay/overlay_blacklist.h"

bool Shortcut::isServerSpecific() const {
if (qvData.canConvert<ShortcutTarget>()) {
@@ -155,15 +154,6 @@ OverlaySettings::OverlaySettings() {
bTime = false;

bUseWhitelist = false;

#ifdef Q_OS_WIN
int i = 0;
while (overlayBlacklist[i]) {
qslBlacklist << QLatin1String(overlayBlacklist[i]);
i++;
}
#endif

}

void OverlaySettings::setPreset(const OverlayPresets preset) {

0 comments on commit f1dbd92

Please sign in to comment.
You can’t perform that action at this time.