aboutsummaryrefslogtreecommitdiff
path: root/sb.cpp
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-01-25 10:07:28 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2023-01-25 10:07:28 +0100
commit41652d5f074943cd5fecb4396edec0a8c22f7c7c (patch)
tree5bd1eb7e3c3a792ff5ff3c53965edbad1de3d61c /sb.cpp
parent0321da112a7ea32f89849a0abc532fecafa3ee14 (diff)
move WebEnginePage to headerfile
Diffstat (limited to 'sb.cpp')
-rw-r--r--sb.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/sb.cpp b/sb.cpp
index 01993c8..11a91f9 100644
--- a/sb.cpp
+++ b/sb.cpp
@@ -19,7 +19,7 @@
#include <QShortcut>
#include <QVBoxLayout>
-
+#include "webengine.hpp"
bool is_valid_url(const std::string & url);
void open_url(const std::string & url);
@@ -44,29 +44,6 @@ QWebEngineView * web;
QMainWindow * view;
Display * dpy;
-class WebEnginePage: public QWebEnginePage {
-Q_OBJECT
-public:
- WebEnginePage(QWebEngineProfile *profile) : QWebEnginePage(profile) {};
- virtual ~WebEnginePage() = default;
-
-protected:
- QWebEnginePage *createWindow(WebWindowType){
- WebEnginePage *page = new WebEnginePage(this->profile());
- connect(page, &QWebEnginePage::urlChanged, this, &WebEnginePage::onUrlChanged);
- return page;
- }
-
-private:
- void onUrlChanged(const QUrl & url){
- if(WebEnginePage *page = qobject_cast<WebEnginePage *>(sender())){
- setUrl(url);
- page->deleteLater();
- }
- }
-};
-
-#include "webengine.hpp"
std::string read_from_dmenu() {
std::string output;