Commit 154c98fd authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Fix QUrl string encoding issue

Don't go through QUrl -> QString -> QUrl when opening files from the
argument list.
Don't be strict when opening URLs that come from the dbus interface.

REVIEW: 127042
parent 67f69c88
......@@ -166,7 +166,8 @@ Status main(const QStringList &paths, const QString &serializedOptions)
{
// Page only makes sense if we are opening one file
const QString page = ShellUtils::page(serializedOptions);
if ( shell->openDocument( ShellUtils::urlFromArg(paths[i], ShellUtils::qfileExistFunc(), page).url(), serializedOptions) )
const QUrl url = ShellUtils::urlFromArg(paths[i], ShellUtils::qfileExistFunc(), page);
if ( shell->openDocument( url, serializedOptions) )
{
++i;
}
......
......@@ -188,7 +188,7 @@ Shell::~Shell()
// Open a new document if we have space for it
// This can hang if called on a unique instance and openUrl pops a messageBox
bool Shell::openDocument( const QString& urlString, const QString &serializedOptions )
bool Shell::openDocument( const QUrl& url, const QString &serializedOptions )
{
if( m_tabs.size() <= 0 )
return false;
......@@ -203,11 +203,16 @@ bool Shell::openDocument( const QString& urlString, const QString &serializedOpt
return false;
}
openUrl( QUrl( urlString, QUrl::StrictMode) , serializedOptions );
openUrl( url, serializedOptions );
return true;
}
bool Shell::openDocument( const QString& urlString, const QString &serializedOptions )
{
return openDocument(QUrl(urlString), serializedOptions);
}
bool Shell::canOpenDocs( int numDocs, int desktop )
{
if( m_tabs.size() <= 0 || numDocs <= 0 || m_unique )
......
......@@ -67,6 +67,8 @@ public:
**/
bool isValid() const;
bool openDocument(const QUrl &url, const QString &serializedOptions);
public slots:
Q_SCRIPTABLE Q_NOREPLY void tryRaise();
Q_SCRIPTABLE bool openDocument(const QString &urlString, const QString &serializedOptions = QString() );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment