Commit dd393760 authored by Rinigus Saar's avatar Rinigus Saar
Browse files

use namespace consistently by all local classes

parent e8c027ef
......@@ -27,7 +27,7 @@ class TabsModelTest : public QObject
private Q_SLOTS:
void initTestCase()
{
m_tabsModel = new TabsModel();
m_tabsModel = new AngelFish::TabsModel();
}
void testInitialTabExists()
......@@ -96,10 +96,10 @@ private Q_SLOTS:
m_tabsModel->newTab("second");
m_tabsModel->newTab("third");
QCOMPARE(m_tabsModel->tabs(), QVector<TabState>({
TabState("about:blank", m_tabsModel->isMobileDefault()),
TabState("second", m_tabsModel->isMobileDefault()),
TabState("third", m_tabsModel->isMobileDefault())
QCOMPARE(m_tabsModel->tabs(), QVector<AngelFish::TabState>({
AngelFish::TabState("about:blank", m_tabsModel->isMobileDefault()),
AngelFish::TabState("second", m_tabsModel->isMobileDefault()),
AngelFish::TabState("third", m_tabsModel->isMobileDefault())
}));
// current tab is 2
......@@ -109,17 +109,17 @@ private Q_SLOTS:
QCOMPARE(m_tabsModel->currentTab(), 0);
// "second" is indeed gone
QCOMPARE(m_tabsModel->tabs(), QVector<TabState>({
TabState("about:blank", m_tabsModel->isMobileDefault()),
TabState("third", m_tabsModel->isMobileDefault())
QCOMPARE(m_tabsModel->tabs(), QVector<AngelFish::TabState>({
AngelFish::TabState("about:blank", m_tabsModel->isMobileDefault()),
AngelFish::TabState("third", m_tabsModel->isMobileDefault())
}));
}
void testSetTab() {
m_tabsModel->setUrl(0, QStringLiteral("https://debian.org"));
QCOMPARE(m_tabsModel->tabs(), QVector<TabState>({
TabState("https://debian.org", m_tabsModel->isMobileDefault()),
TabState("third", m_tabsModel->isMobileDefault())}
QCOMPARE(m_tabsModel->tabs(), QVector<AngelFish::TabState>({
AngelFish::TabState("https://debian.org", m_tabsModel->isMobileDefault()),
AngelFish::TabState("third", m_tabsModel->isMobileDefault())}
));
}
......@@ -134,7 +134,7 @@ private Q_SLOTS:
QCOMPARE(m_tabsModel->privateMode(), false);
}
private:
TabsModel *m_tabsModel;
AngelFish::TabsModel *m_tabsModel;
};
QTEST_MAIN(TabsModelTest);
......
......@@ -31,7 +31,7 @@ private Q_SLOTS:
void initTestCase()
{
m_userAgent = new UserAgent();
m_userAgent = new AngelFish::UserAgent();
}
void cleanupTestCase()
......@@ -52,7 +52,7 @@ private Q_SLOTS:
void userAgentChanged()
{
QSignalSpy spy(m_userAgent, &UserAgent::userAgentChanged);
QSignalSpy spy(m_userAgent, &AngelFish::UserAgent::userAgentChanged);
m_userAgent->setIsMobile(true);
QCOMPARE(spy.count(), 1);
}
......@@ -71,7 +71,7 @@ private Q_SLOTS:
void setIsMobile()
{
QSignalSpy spy(m_userAgent, &UserAgent::isMobileChanged);
QSignalSpy spy(m_userAgent, &AngelFish::UserAgent::isMobileChanged);
m_userAgent->setIsMobile(false);
QCOMPARE(spy.count(), 1);
m_userAgent->setIsMobile(true);
......@@ -87,7 +87,7 @@ private Q_SLOTS:
}
private:
UserAgent *m_userAgent;
AngelFish::UserAgent *m_userAgent;
};
QTEST_MAIN(UserAgentTest);
......
......@@ -27,6 +27,8 @@
#include "browsermanager.h"
using namespace AngelFish;
TabsModel::TabsModel(QObject *parent) : QAbstractListModel(parent) {
connect(this, &TabsModel::currentTabChanged, [this] {
qDebug() << "Current tab changed to" << m_currentTab;
......
......@@ -22,6 +22,8 @@
#include <QAbstractListModel>
#include <QJsonObject>
namespace AngelFish {
class TabState {
public:
static TabState fromJson(const QJsonObject &obj);
......@@ -102,4 +104,6 @@ signals:
void privateModeChanged();
};
} // namespace
#endif // TABSMODEL_H
......@@ -25,6 +25,8 @@
#include <QtCore/QSortFilterProxyModel>
#include <QAbstractItemModel>
namespace AngelFish {
class UrlFilterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
......@@ -39,4 +41,6 @@ signals:
void sourceModelChanged();
};
} // namespace
#endif // URLFILTERPROXYMODEL_H
......@@ -3,6 +3,8 @@
#include <QtWebEngine/QtWebEngineVersion>
#include <QtWebEngine/QQuickWebEngineProfile>
using namespace AngelFish;
UserAgent::UserAgent(QObject *parent) : QObject(parent)
{
}
......
......@@ -3,6 +3,8 @@
#include <QObject>
namespace AngelFish {
class UserAgent : public QObject
{
Q_PROPERTY(QString userAgent READ userAgent NOTIFY userAgentChanged)
......@@ -26,4 +28,6 @@ private:
int m_isMobile;
};
} // namespace
#endif // USERAGENT_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