Commit bca8215f authored by Laurent Montel's avatar Laurent Montel 😁

Debug-- Use ExtendedSelection

parent 63ac1685
......@@ -74,7 +74,6 @@ void AdblockManager::loadSubscriptions()
KConfigGroup general = config.group(QStringLiteral("General"));
mDisabledRules = general.readEntry(QStringLiteral("disabledRules"), QStringList());
qDebug() << " mDisabledRules"<<mDisabledRules;
//Clear subscription
QDir adblockDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/adblock"));
// Create if necessary
......
......@@ -229,11 +229,11 @@ bool AdBlockRule::networkMatch(const QWebEngineUrlRequestInfo &request, const QS
if (m_type == CssRule || !m_isEnabled || m_isInternalDisabled) {
return false;
}
//qDebug() << " bool AdBlockRule::networkMatch(const QWebEngineUrlRequestInfo &request, const QString &domain, const QString &encodedUrl)";
//qDebug() << " bool AdBlockRule::networkMatch(const QWebEngineUrlRequestInfo &request, const QString &domain, const QString &encodedUrl)";
bool matched = stringMatch(domain, encodedUrl);
if (matched) {
qDebug() << " matched !!!!!" << domain << " encoded " << encodedUrl;
//qDebug() << " matched !!!!!" << domain << " encoded " << encodedUrl;
// Check domain restrictions
if (hasOption(DomainRestrictedOption) && !matchDomain(request.firstPartyUrl().host())) {
return false;
......
......@@ -73,7 +73,7 @@ AdBlockSettingWidget::AdBlockSettingWidget(QWidget *parent)
connect(mUi->hintLabel, &QLabel::linkActivated, this, &AdBlockSettingWidget::slotInfoLinkActivated);
mUi->hintLabel->setContextMenuPolicy(Qt::NoContextMenu);
mUi->manualFiltersListWidget->setSelectionMode(QAbstractItemView::MultiSelection);
mUi->manualFiltersListWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
mUi->searchLine->setListWidget(mUi->manualFiltersListWidget);
......@@ -121,15 +121,11 @@ void AdBlockSettingWidget::slotManualFiltersChanged(QListWidgetItem *item)
const AdBlockRule *oldRule = mCustomSubscription->rule(mUi->manualFiltersListWidget->row(item));
if (item->checkState() == Qt::Checked && !oldRule->isEnabled()) {
const AdBlockRule *rule = mCustomSubscription->enableRule(offset);
qDebug() << " enable " << rule;
} else if (item->checkState() == Qt::Unchecked && oldRule->isEnabled()) {
const AdBlockRule *rule = mCustomSubscription->disableRule(offset);
qDebug() << " disable " << rule;
} else if (mCustomSubscription->canEditRules()) {
AdBlockRule *newRule = new AdBlockRule(item->text(), mCustomSubscription);
const AdBlockRule *rule = mCustomSubscription->replaceRule(newRule, offset);
//adjustItemFeatures(item, rule);
}
hasChanged();
}
......@@ -246,7 +242,6 @@ void AdBlockSettingWidget::doLoadFromGlobalSettings()
for (AdBlockSubscription *subscription : AdblockManager::self()->subscriptions()) {
const QString url = subscription->url().toString();
const QString name = subscription->title();
qDebug() << " url" << url << " subscription " << name;
if (!url.isEmpty()) {
AdBlockListwidgetItem *subItem = new AdBlockListwidgetItem(mUi->automaticFiltersListWidget);
subItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment