Commit 76fb6202 authored by Rinigus Saar's avatar Rinigus Saar
Browse files

drop AngelFish namespace

parent d34f1068
......@@ -24,8 +24,6 @@
#include "browsermanager.h"
#include "urlutils.h"
using namespace AngelFish;
class UserAgentTest : public QObject
{
Q_OBJECT
......
......@@ -27,7 +27,7 @@ class TabsModelTest : public QObject
private Q_SLOTS:
void initTestCase()
{
m_tabsModel = new AngelFish::TabsModel();
m_tabsModel = new TabsModel();
}
void testInitialTabExists()
......@@ -96,10 +96,10 @@ private Q_SLOTS:
m_tabsModel->newTab("second");
m_tabsModel->newTab("third");
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())
QCOMPARE(m_tabsModel->tabs(), QVector<TabState>({
TabState("about:blank", m_tabsModel->isMobileDefault()),
TabState("second", m_tabsModel->isMobileDefault()),
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<AngelFish::TabState>({
AngelFish::TabState("about:blank", m_tabsModel->isMobileDefault()),
AngelFish::TabState("third", m_tabsModel->isMobileDefault())
QCOMPARE(m_tabsModel->tabs(), QVector<TabState>({
TabState("about:blank", m_tabsModel->isMobileDefault()),
TabState("third", m_tabsModel->isMobileDefault())
}));
}
void testSetTab() {
m_tabsModel->setUrl(0, QStringLiteral("https://debian.org"));
QCOMPARE(m_tabsModel->tabs(), QVector<AngelFish::TabState>({
AngelFish::TabState("https://debian.org", m_tabsModel->isMobileDefault()),
AngelFish::TabState("third", m_tabsModel->isMobileDefault())}
QCOMPARE(m_tabsModel->tabs(), QVector<TabState>({
TabState("https://debian.org", m_tabsModel->isMobileDefault()),
TabState("third", m_tabsModel->isMobileDefault())}
));
}
......@@ -134,7 +134,7 @@ private Q_SLOTS:
QCOMPARE(m_tabsModel->privateMode(), false);
}
private:
AngelFish::TabsModel *m_tabsModel;
TabsModel *m_tabsModel;
};
QTEST_MAIN(TabsModelTest);
......
......@@ -27,8 +27,6 @@
#include "urlmodel.h"
using namespace AngelFish;
class UrlModelTest : public QObject
{
Q_OBJECT
......
......@@ -31,7 +31,7 @@ private Q_SLOTS:
void initTestCase()
{
m_userAgent = new AngelFish::UserAgent();
m_userAgent = new UserAgent();
}
void cleanupTestCase()
......@@ -52,7 +52,7 @@ private Q_SLOTS:
void userAgentChanged()
{
QSignalSpy spy(m_userAgent, &AngelFish::UserAgent::userAgentChanged);
QSignalSpy spy(m_userAgent, &UserAgent::userAgentChanged);
m_userAgent->setIsMobile(true);
QCOMPARE(spy.count(), 1);
}
......@@ -71,7 +71,7 @@ private Q_SLOTS:
void setIsMobile()
{
QSignalSpy spy(m_userAgent, &AngelFish::UserAgent::isMobileChanged);
QSignalSpy spy(m_userAgent, &UserAgent::isMobileChanged);
m_userAgent->setIsMobile(false);
QCOMPARE(spy.count(), 1);
m_userAgent->setIsMobile(true);
......@@ -87,7 +87,7 @@ private Q_SLOTS:
}
private:
AngelFish::UserAgent *m_userAgent;
UserAgent *m_userAgent;
};
QTEST_MAIN(UserAgentTest);
......
......@@ -7,8 +7,6 @@
#define QUERY_LIMIT 1000
using namespace AngelFish;
BookmarksHistoryModel::BookmarksHistoryModel()
{
connect(BrowserManager::instance(), &BrowserManager::databaseTableChanged,
......
......@@ -3,8 +3,6 @@
#include "sqlquerymodel.h"
namespace AngelFish {
/**
* @class BookmarksHistoryModel
* @short Model for listing Bookmarks and History items.
......@@ -58,6 +56,4 @@ private:
QString m_filter;
};
} // namespace
#endif // BOOKMARKSHISTORYMODEL_H
......@@ -26,8 +26,6 @@
#include <QJsonDocument>
#include <QJsonObject>
using namespace AngelFish;
BrowserManager *BrowserManager::s_instance = nullptr;
BrowserManager::BrowserManager(QObject *parent) : QObject(parent), m_settings(new QSettings(this))
......
......@@ -28,7 +28,6 @@
class QSettings;
namespace AngelFish {
/**
* @class BookmarksManager
* @short Access to Bookmarks and History. This is a singleton for
......@@ -93,6 +92,4 @@ private:
static BrowserManager *s_instance;
};
} // namespace
#endif // BOOKMARKSMANAGER_H
......@@ -35,8 +35,6 @@
#define DB_USER_VERSION 1
#define MAX_BROWSER_HISTORY_SIZE 3000
using namespace AngelFish;
DBManager::DBManager(QObject *parent) : QObject(parent)
{
QString dbname = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
......
......@@ -27,8 +27,6 @@
#include <QString>
#include <QSqlQuery>
namespace AngelFish {
/**
* @class DBManager
* @short Class for database initialization and applying changes in its records
......@@ -76,6 +74,4 @@ private:
void lastVisitedRecord(const QString &table, const QString &url);
};
} // namespace
#endif // DBMANAGER_H
......@@ -32,8 +32,6 @@
#include "urlutils.h"
#include "useragent.h"
using namespace AngelFish;
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
......@@ -78,15 +76,15 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
qmlRegisterType<TabsModel>("org.kde.mobile.angelfish", 1, 0, "TabsModel");
// URL utils
qmlRegisterSingletonType<AngelFish::UrlUtils>("org.kde.mobile.angelfish", 1, 0, "UrlUtils", [](QQmlEngine *, QJSEngine *) -> QObject * {
return static_cast<QObject *>(new AngelFish::UrlUtils());
qmlRegisterSingletonType<UrlUtils>("org.kde.mobile.angelfish", 1, 0, "UrlUtils", [](QQmlEngine *, QJSEngine *) -> QObject * {
return static_cast<QObject *>(new UrlUtils());
});
AngelFish::BrowserManager::instance()->setInitialUrl(initialUrl);
BrowserManager::instance()->setInitialUrl(initialUrl);
// Browser Manager
qmlRegisterSingletonType<AngelFish::BrowserManager>("org.kde.mobile.angelfish", 1, 0, "BrowserManager", [](QQmlEngine *, QJSEngine *) -> QObject * {
return static_cast<QObject *>(AngelFish::BrowserManager::instance());
qmlRegisterSingletonType<BrowserManager>("org.kde.mobile.angelfish", 1, 0, "BrowserManager", [](QQmlEngine *, QJSEngine *) -> QObject * {
return static_cast<QObject *>(BrowserManager::instance());
});
// Load QML
......
......@@ -7,8 +7,6 @@
#include <QSqlRecord>
#include <QSqlField>
using namespace AngelFish;
SqlQueryModel::SqlQueryModel(QObject *parent) :
QSqlQueryModel(parent)
{
......
......@@ -5,8 +5,6 @@
#include <QSqlQueryModel>
namespace AngelFish {
/**
* @class SqlQueryModel
* @short Base class that can be used by models backed by SQL query
......@@ -33,6 +31,4 @@ private:
QHash<int, QByteArray> m_roleNames;
};
} // namespace
#endif // SQLQUERYMODEL_H
......@@ -28,8 +28,6 @@
#include "browsermanager.h"
using namespace AngelFish;
TabsModel::TabsModel(QObject *parent) : QAbstractListModel(parent) {
connect(this, &TabsModel::currentTabChanged, [this] {
qDebug() << "Current tab changed to" << m_currentTab;
......@@ -98,14 +96,14 @@ void TabsModel::loadInitialTabs()
m_tabsReadOnly = false;
if (!m_privateMode) {
if (AngelFish::BrowserManager::instance()->initialUrl().isEmpty()) {
if (BrowserManager::instance()->initialUrl().isEmpty()) {
if (m_tabs.first().url() == QStringLiteral("about:blank"))
setUrl(0, AngelFish::BrowserManager::instance()->homepage());
setUrl(0, BrowserManager::instance()->homepage());
} else {
if (m_tabs.first().url() == QStringLiteral("about:blank"))
setUrl(0, AngelFish::BrowserManager::instance()->initialUrl());
setUrl(0, BrowserManager::instance()->initialUrl());
else
newTab(AngelFish::BrowserManager::instance()->initialUrl());
newTab(BrowserManager::instance()->initialUrl());
}
}
}
......
......@@ -22,8 +22,6 @@
#include <QAbstractListModel>
#include <QJsonObject>
namespace AngelFish {
class TabState {
public:
static TabState fromJson(const QJsonObject &obj);
......@@ -104,6 +102,4 @@ signals:
void privateModeChanged();
};
} // namespace
#endif // TABSMODEL_H
......@@ -29,8 +29,6 @@
#include <QJsonDocument>
#include <QJsonObject>
using namespace AngelFish;
UrlUtils::UrlUtils(QObject *parent) : QObject(parent)
{
}
......
......@@ -25,7 +25,6 @@
#include <QObject>
namespace AngelFish {
/**
* @class UrlUtils
* @short Utilities for URL manipulation and parsing.
......@@ -45,6 +44,4 @@ public:
};
} // namespace
#endif // URLUTILS_H
......@@ -3,8 +3,6 @@
#include <QtWebEngine/QtWebEngineVersion>
#include <QtWebEngine/QQuickWebEngineProfile>
using namespace AngelFish;
UserAgent::UserAgent(QObject *parent) : QObject(parent)
{
}
......
......@@ -3,8 +3,6 @@
#include <QObject>
namespace AngelFish {
class UserAgent : public QObject
{
Q_PROPERTY(QString userAgent READ userAgent NOTIFY userAgentChanged)
......@@ -28,6 +26,4 @@ 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