1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Fixed loading plugins when using USE_LIBPATH define

- reverted displaying page url with QWebFrame::baseUrl()
This commit is contained in:
nowrep 2012-04-03 19:28:12 +02:00
parent 0afd53e4f6
commit 6560459418
21 changed files with 43 additions and 24 deletions

View File

@ -26,6 +26,7 @@
#include "enhancedmenu.h"
#include "tabwidget.h"
#include "tabbedwebview.h"
#include "webpage.h"
#include <QSplitter>
#include <QHBoxLayout>

View File

@ -18,6 +18,7 @@
#include "pagescreen.h"
#include "ui_pagescreen.h"
#include "tabbedwebview.h"
#include "webpage.h"
#include "globalfunctions.h"
#include <QFileDialog>

View File

@ -19,6 +19,7 @@
#include "qupzilla.h"
#include "tabwidget.h"
#include "tabbedwebview.h"
#include "webpage.h"
#include "squeezelabelv1.h"
#include "mainapplication.h"

View File

@ -160,7 +160,7 @@ void Plugins::loadAvailablePlugins()
dirs << mApp->DATADIR + "plugins/"
#ifdef Q_WS_X11
#ifdef USE_LIBPATH
<< USE_LIBPATH
<< USE_LIBPATH + "qupzilla/"
#else
<< "/usr/lib/qupzilla/"
#endif

View File

@ -18,6 +18,7 @@
#include "popupstatusbarmessage.h"
#include "popupwindow.h"
#include "popupwebview.h"
#include "webpage.h"
#include "statusbarmessage.h"
#include "mainapplication.h"

View File

@ -19,6 +19,7 @@
#include "ui_rsswidget.h"
#include "mainapplication.h"
#include "tabbedwebview.h"
#include "webpage.h"
#include "rssmanager.h"
#include "rssnotification.h"

View File

@ -134,7 +134,7 @@ void SideBarManager::refreshMenu()
continue;
}
QAction* act = sidebar.data()->menuAction();
QAction* act = sidebar.data()->createMenuAction();
act->setData(m_sidebars.key(sidebar));
connect(act, SIGNAL(triggered()), this, SLOT(slotShowSideBar()));

View File

@ -32,8 +32,8 @@ public:
explicit SideBarInterface(QObject* parent = 0) : QObject(parent) { }
virtual QString title() const = 0;
virtual QAction* menuAction() = 0;
virtual QAction* createMenuAction() = 0;
virtual QWidget* createSideBarWidget(QupZilla* mainWindow) = 0;
};

View File

@ -59,7 +59,7 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
ui->listWidget->item(3)->setIcon(QIcon::fromTheme("dialog-password", QIcon(":/icons/preferences/dialog-password.png")));
ui->listWidget->item(0)->setSelected(true);
WebPage* webPage = qobject_cast<WebPage*>(view->page());
WebPage* webPage = view->page();
QWebFrame* frame = view->page()->mainFrame();
QString title = view->title();
QSslCertificate cert = webPage->sslCertificate();
@ -67,7 +67,7 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
//GENERAL
ui->heading->setText(QString("<b>%1</b>:").arg(title));
ui->siteAddress->setText(frame->baseUrl().toString());
ui->siteAddress->setText(view->url().toString());
ui->sizeLabel->setText(DownloadItem::fileSizeToString(webPage->totalBytes()));
QString encoding;

View File

@ -33,7 +33,7 @@ SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget* parent)
ui->setupUi(this);
WebView* view = p_QupZilla->weView();
WebPage* webPage = qobject_cast<WebPage*>(view->page());
WebPage* webPage = view->page();
QUrl url = view->url();
if (webPage->sslCertificate().isValid()) {

View File

@ -56,7 +56,7 @@ QString WebPage::m_lastUploadLocation = QDir::homePath();
QString WebPage::m_userAgent;
QString WebPage::m_fakeUserAgent = "Mozilla/5.0 (" + qz_buildSystem() + ") AppleWebKit/" + qWebKitVersion() + " (KHTML, like Gecko) Chrome/10.0 Safari/" + qWebKitVersion();
QUrl WebPage::m_lastUnsupportedUrl;
QList<WebPage*> WebPage::m_deletedPages;
QList<WebPage*> WebPage::m_livingPages;
WebPage::WebPage(QupZilla* mainClass)
: QWebPage()
@ -90,6 +90,8 @@ WebPage::WebPage(QupZilla* mainClass)
#ifdef USE_QTWEBKIT_2_2
connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(featurePermissionRequested(QWebFrame*, QWebPage::Feature)));
#endif
m_livingPages.append(this);
}
QUrl WebPage::url() const
@ -759,9 +761,13 @@ QString WebPage::chooseFile(QWebFrame* originatingFrame, const QString &oldFile)
return fileName;
}
bool WebPage::isPointerSafeToUse(WebPage *page)
bool WebPage::isPointerSafeToUse(WebPage* page)
{
return page == 0 ? false : !m_deletedPages.contains(page);
// Pointer to WebPage is passed with every QNetworkRequest casted to void*
// So there is no way to test whether pointer is still valid or not, except
// this hack.
return page == 0 ? false : m_livingPages.contains(page);
}
void WebPage::disconnectObjects()
@ -771,7 +777,7 @@ void WebPage::disconnectObjects()
m_runningLoop = 0;
}
m_deletedPages.append(this);
m_livingPages.removeOne(this);
disconnect(this);
m_networkProxy->disconnectObjects();
@ -786,7 +792,5 @@ WebPage::~WebPage()
m_runningLoop = 0;
}
if (!m_deletedPages.contains(this)) {
m_deletedPages.append(this);
}
m_livingPages.removeOne(this);
}

View File

@ -109,7 +109,7 @@ private:
static QString m_userAgent;
static QString m_fakeUserAgent;
static QUrl m_lastUnsupportedUrl;
static QList<WebPage*> m_deletedPages;
static QList<WebPage*> m_livingPages;
QupZilla* p_QupZilla;
NetworkManagerProxy* m_networkProxy;

View File

@ -49,6 +49,7 @@ WebView::WebView(QWidget* parent)
, m_isLoading(false)
, m_progress(0)
, m_clickedFrame(0)
, m_page(0)
, m_actionReload(0)
, m_actionStop(0)
, m_actionsInitialized(false)
@ -98,7 +99,7 @@ QString WebView::title() const
QUrl WebView::url() const
{
QUrl returnUrl = page()->mainFrame()->baseUrl();
QUrl returnUrl = page()->url();
if (returnUrl.isEmpty()) {
returnUrl = m_aboutToLoadUrl;
@ -107,14 +108,20 @@ QUrl WebView::url() const
return returnUrl;
}
WebPage* WebView::page() const
{
return m_page;
}
void WebView::setPage(QWebPage* page)
{
QWebView::setPage(page);
m_page = qobject_cast<WebPage*>(page);
setZoom(WebViewSettings::defaultZoom);
connect(page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*)), this, SLOT(frameStateChanged()));
mApp->plugins()->emitWebPageCreated(qobject_cast<WebPage*>(page));
mApp->plugins()->emitWebPageCreated(m_page);
}
void WebView::load(const QUrl &url)
@ -318,7 +325,7 @@ void WebView::slotLoadFinished()
mApp->history()->addHistoryEntry(this);
}
mApp->autoFill()->completePage(qobject_cast<WebPage*>(page()));
mApp->autoFill()->completePage(page());
m_lastUrl = url();
}
@ -377,7 +384,7 @@ void WebView::downloadPage()
}
DownloadManager* dManager = mApp->downManager();
dManager->download(request, qobject_cast<WebPage*>(page()), false, suggestedFileName);
dManager->download(request, page(), false, suggestedFileName);
}
void WebView::downloadUrlToDisk()
@ -386,7 +393,7 @@ void WebView::downloadUrlToDisk()
QNetworkRequest request(action->data().toUrl());
DownloadManager* dManager = mApp->downManager();
dManager->download(request, qobject_cast<WebPage*>(page()), false);
dManager->download(request, page(), false);
}
}

View File

@ -24,6 +24,8 @@
#include "qz_namespace.h"
class WebPage;
class QT_QUPZILLA_EXPORT WebView : public QWebView
{
Q_OBJECT
@ -34,6 +36,7 @@ public:
QString title() const;
QUrl url() const;
WebPage* page() const;
void setPage(QWebPage* page);
void load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray());
@ -152,6 +155,7 @@ private:
QWebFrame* m_clickedFrame;
QUrl m_clickedUrl;
WebPage* m_page;
QAction* m_actionReload;
QAction* m_actionStop;
bool m_actionsInitialized;

View File

@ -26,6 +26,7 @@ INCLUDEPATH += $$PWD/lib/3rdparty\
TEMPLATE = lib
CONFIG += plugin
QT *= webkit network
DESTDIR = $$PWD/../bin/plugins/
OBJECTS_DIR = build

View File

@ -1,4 +1,3 @@
QT += webkit
TARGET = AccessKeysNavigation
os2: TARGET = AcKeyNav

View File

@ -35,6 +35,7 @@
*/
#include "akn_handler.h"
#include "webview.h"
#include "webpage.h"
#include <QApplication>
#include <QSettings>

View File

@ -1,4 +1,3 @@
QT += webkit
TARGET = MouseGestures
os2: TARGET = MouseGes

View File

@ -3,7 +3,6 @@
# Project created by QtCreator 2011-02-13T10:23:13
#
#-------------------------------------------------
QT += webkit
TARGET = TestPlugin
# OS/2 allows only 8 chars in TARGET
os2: TARGET = TestPlug

View File

@ -32,7 +32,7 @@ QString TestPlugin_Sidebar::title() const
return tr("Testing Sidebar");
}
QAction* TestPlugin_Sidebar::menuAction()
QAction* TestPlugin_Sidebar::createMenuAction()
{
QAction* act = new QAction(tr("Testing Sidebar"), 0);
act->setCheckable(true);

View File

@ -27,7 +27,7 @@ public:
explicit TestPlugin_Sidebar(QObject* parent = 0);
QString title() const;
QAction* menuAction();
QAction* createMenuAction();
QWidget* createSideBarWidget(QupZilla* mainWindow);
};