D27655: Open all URLs in command line arguments

David Rosca noreply at phabricator.kde.org
Fri Mar 6 07:31:41 GMT 2020


drosca requested changes to this revision.
drosca added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> browserwindow.cpp:255
>      QUrl startUrl;
> +    QList<QUrl>::ConstIterator moreStartUrl = m_startUrls.cend();
>  

Just use `takeLast()` from m_startUrls instead of using iterator.

> browserwindow.cpp:322
>  
> +        for(; moreStartUrl != m_startUrls.cend(); ++moreStartUrl)
> +            m_tabWidget->addView(*moreStartUrl, Qz::NT_NotSelectedTabAtTheEnd);

coding style

> browserwindow.h:80
>  
> -    explicit BrowserWindow(Qz::BrowserWindowType type, const QUrl &url = QUrl());
> +    explicit BrowserWindow(Qz::BrowserWindowType type, const QList<QUrl> &&urls = QList<QUrl>());
>      ~BrowserWindow();

No need for move semantics here.

> commandlineoptions.cpp:201
>  
> -    if (parser.positionalArguments().isEmpty())
> -        return;
> -
> -    QString url = parser.positionalArguments().constLast();
> -    QFileInfo fileInfo(url);
> -
> -    if (fileInfo.exists()) {
> -        url = fileInfo.absoluteFilePath();
> -    }
> -
> -    if (!url.isEmpty() && !url.startsWith(QLatin1Char('-'))) {
> -        ActionPair pair;
> -        pair.action = Qz::CL_OpenUrl;
> -        pair.text = url;
> -        m_actions.append(pair);
> +    for (QString url : parser.positionalArguments()) {
> +        QFileInfo fileInfo(url);

const QStringList args = parser.positionalArguments();
  for (QString url : args) {
     ...
  }

> mainapplication.cpp:442
>  
> -BrowserWindow* MainApplication::createWindow(Qz::BrowserWindowType type, const QUrl &startUrl)
> +BrowserWindow* MainApplication::createWindow(Qz::BrowserWindowType type, const QUrl& startUrl)
> +{

`const QUrl &startUrl`

> mainapplication.cpp:446
> +}
> +
> +

two empty lines

REPOSITORY
  R875 Falkon

REVISION DETAIL
  https://phabricator.kde.org/D27655

To: abogical, #falkon, drosca
Cc: drosca, SGOrava, #falkon, falkon, grune, akilgus, siraj_qazi, saishm, anmolgautam, iodelay, spoorun, ptabis, navarromorales, clivej, mparillo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/falkon/attachments/20200306/afef60ff/attachment-0001.html>


More information about the Falkon mailing list