1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Open links in private window.

This commit is contained in:
Mladen Pejaković 2014-02-22 14:57:22 +01:00 committed by nowrep
parent 85a15127a0
commit 131eef5c9d
3 changed files with 8 additions and 0 deletions

View File

@ -1064,6 +1064,8 @@ Speller* MainApplication::speller()
void MainApplication::startPrivateBrowsing()
{
const QUrl url = qobject_cast<QAction*>(sender())->data().toUrl();
QStringList args;
foreach (const QString &arg, arguments()) {
if (arg.startsWith(QLatin1Char('-')) &&
@ -1075,6 +1077,10 @@ void MainApplication::startPrivateBrowsing()
args.append(QLatin1String("--private-browsing"));
if (!url.isEmpty()) {
args << url.toEncoded();
}
if (!QProcess::startDetached(applicationFilePath(), args)) {
qWarning() << "MainApplication: Cannot start new browser process for private browsing!" << applicationFilePath() << args;
}

View File

@ -256,6 +256,7 @@ void RSSManager::customContextMenuRequested(const QPoint &position)
QMenu menu;
menu.addAction(tr("Open link in current tab"), getQupZilla(), SLOT(loadActionUrl()))->setData(link);
menu.addAction(tr("Open link in new tab"), this, SLOT(loadFeedInNewTab()))->setData(link);
menu.addAction(tr("Open link in &private window"), mApp, SLOT(startPrivateBrowsing()))->setData(link);
//Prevent choosing first option with double rightclick
QPoint pos = treeWidget->viewport()->mapToGlobal(position);

View File

@ -1010,6 +1010,7 @@ void WebView::createLinkContextMenu(QMenu* menu, const QWebHitTestResult &hitTes
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInBgTab()));
menu->addAction(act);
menu->addAction(QIcon::fromTheme("window-new"), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl());
menu->addAction(QIcon(":icons/locationbar/privatebrowsing.png"), tr("Open link in &private window"), mApp, SLOT(startPrivateBrowsing()))->setData(hitTest.linkUrl());
menu->addSeparator();
QVariantList bData;