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

Fixed crash + updated html highlighter

Fixed crash when closing main window while there are still tabs loading
and there are more than one QupZilla window
This commit is contained in:
nowrep 2011-10-31 21:27:52 +01:00
parent 0a92482d3a
commit 490f88ffc2
6 changed files with 12 additions and 6 deletions

View File

@ -86,6 +86,7 @@ QupZilla::QupZilla(bool tryRestore, QUrl startUrl)
, m_tryRestore(tryRestore)
, m_historyMenuChanged(true)
, m_bookmarksMenuChanged(true)
, m_isClosing(false)
, m_startingUrl(startUrl)
, m_actionPrivateBrowsing(0)
, m_webInspectorDock(0)
@ -1094,6 +1095,7 @@ void QupZilla::closeEvent(QCloseEvent* event)
if (mApp->isClosing())
return;
m_isClosing = true;
mApp->saveStateSlot();
mApp->aboutToCloseWindow(this);

View File

@ -106,6 +106,8 @@ public:
inline QAction* actionRestoreTab() { return m_actionRestoreTab; }
inline QMenu* superMenu() { return m_superMenu; }
inline bool isClosing() { return m_isClosing; }
signals:
void loadHistory();
void startingCompleted();
@ -196,6 +198,7 @@ private:
bool m_tryRestore;
bool m_historyMenuChanged;
bool m_bookmarksMenuChanged;
bool m_isClosing;
QUrl m_startingUrl;
QUrl m_newtab;
QUrl m_homepage;

View File

@ -176,6 +176,7 @@ void AutoFillModel::post(const QNetworkRequest &request, const QByteArray &outgo
QString passwordName = "";
QString passwordValue = "";
QUrl siteUrl = webView->url();
QWebElementCollection inputs;
QList<QWebFrame*> frames;
@ -194,13 +195,13 @@ void AutoFillModel::post(const QNetworkRequest &request, const QByteArray &outgo
}
//Return if storing is not enabled, data for this page is already stored, no password element found in sent data
if (passwordName.isEmpty() || !isStoringEnabled(request.url()) || isStored(request.url()))
if (passwordName.isEmpty() || !isStoringEnabled(siteUrl) || isStored(siteUrl))
return;
//Return if no password form has been sent
if (!outgoingData.contains((QUrl(passwordName).toEncoded() + "=")) || passwordValue.isEmpty())
return;
AutoFillNotification* aWidget = new AutoFillNotification(webView->url(), outgoingData, passwordValue);
AutoFillNotification* aWidget = new AutoFillNotification(siteUrl, outgoingData, passwordValue);
webView->addNotification(aWidget);
}

View File

@ -221,7 +221,7 @@ void NavigationBar::goAtHistoryIndex()
void NavigationBar::refreshHistory()
{
if (mApp->isClosing())
if (mApp->isClosing() || p_QupZilla->isClosing())
return;
QWebHistory* history = p_QupZilla->weView()->page()->history();

View File

@ -117,7 +117,7 @@
<< "allowscriptaccess=\"" << "cols=\"" << "rows=\""
<< "profile=\"" << "colspan=\"" << "scope=\""
<< "data=\"" << "autoplay=\"" << "hspace=\""
<< "valign=\"" << "vspace=\""
<< "valign=\"" << "vspace=\"" << "controls=\""
<< "href=\"" << "title=\"" << "xmlns=\"";
foreach (const QString &pattern, optionsPatterns) {
rule.pattern = QRegExp(pattern);

View File

@ -248,7 +248,7 @@ void WebView::loadFinished(bool state)
{
Q_UNUSED(state);
if (mApp->isClosing())
if (mApp->isClosing() || p_QupZilla->isClosing())
return;
if (animationLoading(tabIndex(), false)->movie())
@ -296,7 +296,7 @@ void WebView::titleChanged()
void WebView::iconChanged()
{
if (mApp->isClosing())
if (mApp->isClosing() || p_QupZilla->isClosing())
return;
// if (isCurrent())