forked from simulationcraft/simc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebPage.cpp
27 lines (23 loc) · 844 Bytes
/
WebPage.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==========================================================================
// Dedmonwakeen's Raid DPS/TPS Simulator.
// Send questions to [email protected]
// ==========================================================================
#include "WebPage.hpp"
#include <QDesktopServices>
SC_WebPage::SC_WebPage( QObject* parent ) : SC_WebEnginePage( parent )
{
}
bool SC_WebPage::acceptNavigationRequest( const QUrl& url, NavigationType, bool isMainFrame )
{
if ( !isMainFrame )
{
return false;
}
QString url_to_show = url.toString();
if ( url.isLocalFile() || url_to_show.contains( "battle.net" ) || url_to_show.contains( "battlenet" ) ||
url_to_show.contains( "github.com" ) || url_to_show.contains( "worldofwarcraft.com" ) )
return true;
else
QDesktopServices::openUrl( url_to_show );
return false;
}