summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rekonqwindow.cpp10
-rw-r--r--src/rekonqwindow.hpp6
-rw-r--r--src/rekonqwindow_class.cpp17
-rw-r--r--src/test/rekonqwindow_mock.hpp4
-rw-r--r--src/test/test_rekonqwindow.cpp4
5 files changed, 19 insertions, 22 deletions
diff --git a/src/rekonqwindow.cpp b/src/rekonqwindow.cpp
index 2295cd50..d700cc34 100644
--- a/src/rekonqwindow.cpp
+++ b/src/rekonqwindow.cpp
@@ -22,23 +22,23 @@ int RekonqWindow::addView(RekonqView *view)
return ui->tabToolBar->addView(view);
}
-void RekonqWindow::loadUrl(rekonq::DefaultUrl url, rekonq::OpenType type)
+void RekonqWindow::loadDefaultUrl(rekonq::DefaultUrl url, rekonq::OpenType type)
{
auto *settings = Application::instance()->settings();
switch (url) {
case rekonq::NewTabPage:
- loadUrl(settings->value("newtab").toUrl(), type);
+ loadRequestedUrl(settings->value("newtab").toUrl(), type);
break;
case rekonq::HomePage:
- loadUrl(settings->value("homepage").toUrl(), type);
+ loadRequestedUrl(settings->value("homepage").toUrl(), type);
break;
case rekonq::AboutBlank:
- loadUrl(QUrl("about:blank"), type);
+ loadRequestedUrl(QUrl("about:blank"), type);
break;
}
}
-void RekonqWindow::loadUrl(const QUrl &url, rekonq::OpenType type)
+void RekonqWindow::loadRequestedUrl(const QUrl &url, rekonq::OpenType type)
{
switch (type) {
case rekonq::CurrentTab:
diff --git a/src/rekonqwindow.hpp b/src/rekonqwindow.hpp
index 82542274..e24aa317 100644
--- a/src/rekonqwindow.hpp
+++ b/src/rekonqwindow.hpp
@@ -33,8 +33,10 @@ public:
public slots:
REKONQ_TEST_VIRTUAL int addView(RekonqView *view) REKONQ_TEST_PURE;
- REKONQ_TEST_VIRTUAL void loadUrl(rekonq::DefaultUrl url, rekonq::OpenType type = rekonq::CurrentTab) REKONQ_TEST_PURE;
- REKONQ_TEST_VIRTUAL void loadUrl(const QUrl &url, rekonq::OpenType type = rekonq::CurrentTab) REKONQ_TEST_PURE;
+ REKONQ_TEST_VIRTUAL void loadDefaultUrl(rekonq::DefaultUrl url,
+ rekonq::OpenType type = rekonq::CurrentTab) REKONQ_TEST_PURE;
+ REKONQ_TEST_VIRTUAL void loadRequestedUrl(const QUrl &url,
+ rekonq::OpenType type = rekonq::CurrentTab) REKONQ_TEST_PURE;
// void loadUrl(const KUrl &, Rekonq::OpenType type = Rekonq::CurrentTab, TabHistory *history = 0);
private slots:
diff --git a/src/rekonqwindow_class.cpp b/src/rekonqwindow_class.cpp
index 66da5ff5..2509fee2 100644
--- a/src/rekonqwindow_class.cpp
+++ b/src/rekonqwindow_class.cpp
@@ -34,16 +34,11 @@ RekonqWindow::RekonqWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Re
ui->bookmarksToolBar->setModel(Application::instance()->bookmarks());
ui->menuBookmarks->setModel(Application::instance()->bookmarks());
#endif
- connect(ui->navigationToolBar, &NavigationToolBar::loadUrl, this,
- qOverload<rekonq::DefaultUrl, rekonq::OpenType>(&RekonqWindow::loadUrl));
- connect(ui->navigationToolBar, &NavigationToolBar::loadRequestedUrl, this,
- qOverload<const QUrl &, rekonq::OpenType>(&RekonqWindow::loadUrl));
- connect(ui->bookmarksPanel, &BookmarksPanel::loadUrl, this,
- qOverload<const QUrl &, rekonq::OpenType>(&RekonqWindow::loadUrl));
- connect(ui->bookmarksToolBar, &BookmarkToolBar::loadUrl, this,
- qOverload<const QUrl &, rekonq::OpenType>(&RekonqWindow::loadUrl));
- connect(ui->menuBookmarks, &BookmarksMenu::loadUrl, this,
- qOverload<const QUrl &, rekonq::OpenType>(&RekonqWindow::loadUrl));
+ connect(ui->navigationToolBar, &NavigationToolBar::loadUrl, this, &RekonqWindow::loadDefaultUrl);
+ connect(ui->navigationToolBar, &NavigationToolBar::loadRequestedUrl, this, &RekonqWindow::loadRequestedUrl);
+ connect(ui->bookmarksPanel, &BookmarksPanel::loadUrl, this, &RekonqWindow::loadRequestedUrl);
+ connect(ui->bookmarksToolBar, &BookmarkToolBar::loadUrl, this, &RekonqWindow::loadRequestedUrl);
+ connect(ui->menuBookmarks, &BookmarksMenu::loadUrl, this, &RekonqWindow::loadRequestedUrl);
// ::setCurrentView
connect(ui->tabToolBar, &TabToolBar::currentViewChanged, this, [this](RekonqView *view) {
@@ -67,7 +62,7 @@ RekonqWindow::RekonqWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Re
}
#endif
connect(ui->actionNewTab, &QAction::triggered, this,
- [this]() { loadUrl(rekonq::NewTabPage, rekonq::NewFocusedTab); });
+ [this]() { loadDefaultUrl(rekonq::NewTabPage, rekonq::NewFocusedTab); });
connect(ui->actionCloseTab, &QAction::triggered, ui->tabToolBar, &TabToolBar::closeCurrentTab);
connect(ui->actionQuit, &QAction::triggered, qApp, &QApplication::quit);
// edit menu
diff --git a/src/test/rekonqwindow_mock.hpp b/src/test/rekonqwindow_mock.hpp
index 7ec30d88..27b7711a 100644
--- a/src/test/rekonqwindow_mock.hpp
+++ b/src/test/rekonqwindow_mock.hpp
@@ -11,6 +11,6 @@ public:
~FakeWindow() override = default;
MOCK_METHOD(int, addView, (RekonqView *), (override));
- MOCK_METHOD(void, loadUrl, (rekonq::DefaultUrl, rekonq::OpenType), (override));
- MOCK_METHOD(void, loadUrl, (const QUrl &, rekonq::OpenType), (override));
+ MOCK_METHOD(void, loadDefaultUrl, (rekonq::DefaultUrl, rekonq::OpenType), (override));
+ MOCK_METHOD(void, loadRequestedUrl, (const QUrl &, rekonq::OpenType), (override));
};
diff --git a/src/test/test_rekonqwindow.cpp b/src/test/test_rekonqwindow.cpp
index 46c63e53..b4db0256 100644
--- a/src/test/test_rekonqwindow.cpp
+++ b/src/test/test_rekonqwindow.cpp
@@ -12,8 +12,8 @@ TEST(RekonqWindow, mock_shortcuts)
{
FakeWindow window;
EXPECT_CALL(window, addView).Times(0);
- EXPECT_CALL(window, loadUrl(Matcher<rekonq::DefaultUrl>(_), _)).Times(0);
- EXPECT_CALL(window, loadUrl(Matcher<const QUrl &>(_), _)).Times(0);
+ EXPECT_CALL(window, loadDefaultUrl).Times(0);
+ EXPECT_CALL(window, loadRequestedUrl).Times(0);
for (auto *action : window.findChildren<QAction *>(QRegularExpression("^action.*"))) {
EXPECT_TRUE(action->shortcut().isEmpty()) << qUtf8Printable(action->objectName());