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

Add namespace

parent 19ce5add
......@@ -4,6 +4,8 @@ set(adblocklibprivate_SRCS
adblockrule.cpp
qzregexp.cpp
qztools.cpp
#adblockmatcher.cpp
#adblocksubscription.cpp
)
add_library(adblocklibprivate ${adblocklibprivate_SRCS})
......
......@@ -36,6 +36,7 @@
#include "adblockrule.h"
#include "adblocksubscription.h"
using namespace AdBlock;
AdBlockMatcher::AdBlockMatcher(AdBlockManager* manager)
: QObject(manager)
, m_manager(manager)
......
......@@ -42,8 +42,9 @@
class QWebEngineUrlRequestInfo;
namespace AdBlock
{
class AdBlockManager;
class AdBlockMatcher : public QObject
{
Q_OBJECT
......@@ -80,5 +81,6 @@ private:
AdBlockSearchTree m_networkBlockTree;
AdBlockSearchTree m_networkExceptionTree;
};
}
#endif // ADBLOCKMATCHER_H
......@@ -62,14 +62,15 @@
#include "adblockrule.h"
#include "adblocksubscription.h"
//#include "qztools.h"
//#include "qzregexp.h"
#include "qztools.h"
#include "qzregexp.h"
#include <QUrl>
#include <QString>
#include <QStringList>
#include <QWebEnginePage>
#include <QWebEngineUrlRequestInfo>
using namespace AdBlock;
static QString toSecondLevelDomain(const QUrl &url)
{
......
......@@ -69,6 +69,8 @@
class QUrl;
class QWebEngineUrlRequestInfo;
namespace AdBlock
{
class AdBlockSubscription;
class AdBlockRule
......@@ -195,6 +197,6 @@ private:
friend class AdBlockSearchTree;
friend class AdBlockSubscription;
};
}
#endif // ADBLOCKRULE_H
......@@ -35,6 +35,7 @@
#include "adblockrule.h"
#include <QDebug>
#include <QWebEngineUrlRequestInfo>
using namespace AdBlock;
AdBlockSearchTree::AdBlockSearchTree()
: m_root(new Node)
......
......@@ -38,6 +38,8 @@
#include <QHash>
class QWebEngineUrlRequestInfo;
namespace AdBlock
{
class AdBlockRule;
class AdBlockSearchTree
{
......@@ -66,5 +68,5 @@ private:
Node* m_root;
};
}
#endif // ADBLOCKSEARCHTREE_H
......@@ -70,6 +70,7 @@
#include <QFile>
#include <QTimer>
#include <QNetworkReply>
using namespace AdBlock;
AdBlockSubscription::AdBlockSubscription(const QString &title, QObject* parent)
: QObject(parent)
......
......@@ -71,7 +71,8 @@
class QUrl;
class FollowRedirectReply;
namespace AdBlock
{
class AdBlockSubscription : public QObject
{
Q_OBJECT
......@@ -147,6 +148,7 @@ public:
bool removeRule(int offset);
const AdBlockRule* replaceRule(AdBlockRule* rule, int offset);
};
}
#endif // ADBLOCKSUBSCRIPTION_H
......@@ -33,6 +33,7 @@
* ============================================================ */
#include "qzregexp.h"
#include "qztools.h"
using namespace AdBlock;
QzRegExp::QzRegExp()
: QRegularExpression(QString(), QRegularExpression::DotMatchesEverythingOption)
......
......@@ -37,7 +37,8 @@
#include <QRegularExpression>
#include <QStringList>
namespace AdBlock
{
class QzRegExp : public QRegularExpression
{
public:
......@@ -55,5 +56,5 @@ private:
int m_matchedLength;
};
}
#endif // QZREGEXP_H
......@@ -33,7 +33,7 @@
* ============================================================ */
#include "qztools.h"
using namespace AdBlock;
// Matches domain (assumes both pattern and domain not starting with dot)
// pattern = domain to be matched
// domain = site domain
......
......@@ -43,7 +43,8 @@ class QPixmap;
class QIcon;
class QWidget;
class QUrl;
namespace AdBlock
{
class QzTools
{
public:
......@@ -54,5 +55,5 @@ public:
return (index >= 0 && container.count() > index);
}
};
}
#endif // QZTOOLS_H
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