Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
Fixed crash + updated html highlighter
Browse files Browse the repository at this point in the history
Fixed crash when closing main window while there are still tabs loading
and there are more than one QupZilla window
  • Loading branch information
nowrep committed Oct 31, 2011
1 parent 5fb004b commit fac3f76
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/app/qupzilla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1094,6 +1095,7 @@ void QupZilla::closeEvent(QCloseEvent* event)
if (mApp->isClosing())
return;

m_isClosing = true;
mApp->saveStateSlot();
mApp->aboutToCloseWindow(this);

Expand Down
3 changes: 3 additions & 0 deletions src/app/qupzilla.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ class QupZilla : public QMainWindow
inline QAction* actionRestoreTab() { return m_actionRestoreTab; }
inline QMenu* superMenu() { return m_superMenu; }

inline bool isClosing() { return m_isClosing; }

signals:
void loadHistory();
void startingCompleted();
Expand Down Expand Up @@ -196,6 +198,7 @@ private slots:
bool m_tryRestore;
bool m_historyMenuChanged;
bool m_bookmarksMenuChanged;
bool m_isClosing;
QUrl m_startingUrl;
QUrl m_newtab;
QUrl m_homepage;
Expand Down
5 changes: 3 additions & 2 deletions src/autofill/autofillmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
2 changes: 1 addition & 1 deletion src/navigation/navigationbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/tools/htmlhighlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/webview/webview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -296,7 +296,7 @@ void WebView::titleChanged()

void WebView::iconChanged()
{
if (mApp->isClosing())
if (mApp->isClosing() || p_QupZilla->isClosing())
return;

// if (isCurrent())
Expand Down

0 comments on commit fac3f76

Please sign in to comment.