From 18a1d4802ea5d2703269100314769aae7163a8af Mon Sep 17 00:00:00 2001 From: nowrep Date: Tue, 19 Feb 2013 11:56:47 +0100 Subject: [PATCH] Don't use double QUrl::fromUserInput in QupZilla constructor. Closes #762 --- CHANGELOG | 1 + src/lib/app/mainapplication.cpp | 11 +++++++---- src/lib/app/qupzilla.cpp | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d58f1bba2..d733c0273 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ Version 1.4.0 * don't steal Ctrl+B/U/I shortcuts from page * disabled by default opacity effect on tab previews - see BUILDING * improved showing navigation toolbar in fullscreen + * fixed opening browser with url with ampersand (%26) as command line argument * fixed scrolling to anchor in background tabs * fixed parsing UTF-8 filenames in Content-Disposition header * fixed crash with context menu in websearchbar and locationbar diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 10f187e73..b3a478596 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -564,12 +564,12 @@ void MainApplication::receiveAppMessage(QString message) QUrl actUrl; if (message.startsWith(QLatin1String("URL:"))) { - QUrl url = QUrl::fromUserInput(message.mid(4)); + const QUrl &url = QUrl::fromUserInput(message.mid(4)); addNewTab(url); actWin = getWindow(); } else if (message.startsWith(QLatin1String("ACTION:"))) { - QString text = message.mid(7); + const QString &text = message.mid(7); if (text == QLatin1String("NewTab")) { addNewTab(); } @@ -589,8 +589,11 @@ void MainApplication::receiveAppMessage(QString message) } } - if (!actWin && !isClosing()) { // It can only occur if download manager window was still open - makeNewWindow(Qz::BW_NewWindow, actUrl); + if (!actWin) { + if (!isClosing()) { + // It can only occur if download manager window was still opened + makeNewWindow(Qz::BW_NewWindow, actUrl); + } return; } diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 8d0b4e7d8..8de39fb72 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -204,7 +204,7 @@ void QupZilla::postLaunch() show(); if (!m_startingUrl.isEmpty()) { - startUrl = QUrl::fromUserInput(m_startingUrl.toString()); + startUrl = m_startingUrl; addTab = true; }