mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Handling Ctrl+Middle clicks on links in keyReleaseEvent.
- fixes problems when you open link in new tab (with middle mouse click) and also paste text to focused input element
This commit is contained in:
parent
a09766a2ee
commit
16526b0177
2
src/3rdparty/qtwin.cpp
vendored
2
src/3rdparty/qtwin.cpp
vendored
@ -323,7 +323,7 @@ void QtWin::populateFrequentSites(IObjectCollection* collection, const QString &
|
|||||||
{
|
{
|
||||||
HistoryModel* historyModel = mApp->history();
|
HistoryModel* historyModel = mApp->history();
|
||||||
QList<HistoryEntry> mostList = historyModel->mostVisited(6);
|
QList<HistoryEntry> mostList = historyModel->mostVisited(6);
|
||||||
foreach(const HistoryEntry &entry, mostList)
|
foreach(const HistoryEntry & entry, mostList)
|
||||||
collection->AddObject(CreateShellLink(entry.title, entry.url.toString(), appPath, " " + entry.url.toEncoded(), appPath, 1));
|
collection->AddObject(CreateShellLink(entry.title, entry.url.toString(), appPath, " " + entry.url.toEncoded(), appPath, 1));
|
||||||
|
|
||||||
collection->AddObject(CreateShellLink("", "", "", "", "", 0)); //Spacer
|
collection->AddObject(CreateShellLink("", "", "", "", "", 0)); //Spacer
|
||||||
|
@ -46,7 +46,7 @@ void AdBlockIcon::showMenu(const QPoint &pos)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
menu.addAction(tr("Blocked URL (AdBlock Rule) - click to edit rule"))->setEnabled(false);
|
menu.addAction(tr("Blocked URL (AdBlock Rule) - click to edit rule"))->setEnabled(false);
|
||||||
foreach(const WebPage::AdBlockedEntry &entry, entries) {
|
foreach(const WebPage::AdBlockedEntry & entry, entries) {
|
||||||
QString address = entry.url.toString().right(55);
|
QString address = entry.url.toString().right(55);
|
||||||
menu.addAction(tr("%1 with (%2)").arg(address, entry.rule), manager, SLOT(showRule()))->setData(entry.rule);
|
menu.addAction(tr("%1 with (%2)").arg(address, entry.rule), manager, SLOT(showRule()))->setData(entry.rule);
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
|
|||||||
QString startProfile;
|
QString startProfile;
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
foreach(const CommandLineOptions::ActionPair &pair, cmdActions) {
|
foreach(const CommandLineOptions::ActionPair & pair, cmdActions) {
|
||||||
switch (pair.action) {
|
switch (pair.action) {
|
||||||
case Qz::CL_StartWithoutAddons:
|
case Qz::CL_StartWithoutAddons:
|
||||||
noAddons = true;
|
noAddons = true;
|
||||||
@ -158,7 +158,7 @@ MainApplication::MainApplication(const QList<CommandLineOptions::ActionPair> &cm
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isRunning()) {
|
if (isRunning()) {
|
||||||
foreach(const QString &message, messages) {
|
foreach(const QString & message, messages) {
|
||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
m_isExited = true;
|
m_isExited = true;
|
||||||
|
@ -786,7 +786,7 @@ void QupZilla::aboutToShowClosedTabsMenu()
|
|||||||
{
|
{
|
||||||
m_menuClosedTabs->clear();
|
m_menuClosedTabs->clear();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(const ClosedTabsManager::Tab &tab, m_tabWidget->closedTabsManager()->allClosedTabs()) {
|
foreach(const ClosedTabsManager::Tab & tab, m_tabWidget->closedTabsManager()->allClosedTabs()) {
|
||||||
QString title = tab.title;
|
QString title = tab.title;
|
||||||
if (title.length() > 40) {
|
if (title.length() > 40) {
|
||||||
title.truncate(40);
|
title.truncate(40);
|
||||||
@ -836,7 +836,7 @@ void QupZilla::aboutToShowHistoryMostMenu()
|
|||||||
|
|
||||||
QList<HistoryEntry> mostList = mApp->history()->mostVisited(10);
|
QList<HistoryEntry> mostList = mApp->history()->mostVisited(10);
|
||||||
|
|
||||||
foreach(const HistoryEntry &entry, mostList) {
|
foreach(const HistoryEntry & entry, mostList) {
|
||||||
QString title = entry.title;
|
QString title = entry.title;
|
||||||
if (title.length() > 40) {
|
if (title.length() > 40) {
|
||||||
title.truncate(40);
|
title.truncate(40);
|
||||||
@ -850,7 +850,7 @@ void QupZilla::aboutToShowHistoryMostMenu()
|
|||||||
m_menuHistoryMost->addAction(act);
|
m_menuHistoryMost->addAction(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_menuHistoryMost->isEmpty()){
|
if (m_menuHistoryMost->isEmpty()) {
|
||||||
m_menuHistoryMost->addAction(tr("Empty"))->setEnabled(false);
|
m_menuHistoryMost->addAction(tr("Empty"))->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -964,7 +964,7 @@ void QupZilla::aboutToShowEncodingMenu()
|
|||||||
qSort(available);
|
qSort(available);
|
||||||
QString activeCodec = mApp->webSettings()->defaultTextEncoding();
|
QString activeCodec = mApp->webSettings()->defaultTextEncoding();
|
||||||
|
|
||||||
foreach(const QByteArray &name, available) {
|
foreach(const QByteArray & name, available) {
|
||||||
if (QTextCodec::codecForName(name)->aliases().contains(name)) {
|
if (QTextCodec::codecForName(name)->aliases().contains(name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1122,7 +1122,7 @@ void QupZilla::loadFolderBookmarks(Menu* menu)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const Bookmark &b, mApp->bookmarksModel()->folderBookmarks(folder)) {
|
foreach(const Bookmark & b, mApp->bookmarksModel()->folderBookmarks(folder)) {
|
||||||
tabWidget()->addView(b.url, b.title, Qz::NT_NotSelectedTab);
|
tabWidget()->addView(b.url, b.title, Qz::NT_NotSelectedTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ void AutoFillModel::post(const QNetworkRequest &request, const QByteArray &outgo
|
|||||||
frames += frame->childFrames();
|
frames += frame->childFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const QWebElement &formElement, allForms) {
|
foreach(const QWebElement & formElement, allForms) {
|
||||||
foreach(const QWebElement &inputElement, formElement.findAll("input[type=\"password\"]")) {
|
foreach(const QWebElement &inputElement, formElement.findAll("input[type=\"password\"]")) {
|
||||||
passwordName = inputElement.attribute("name");
|
passwordName = inputElement.attribute("name");
|
||||||
passwordValue = getValueFromData(outgoingData, inputElement);
|
passwordValue = getValueFromData(outgoingData, inputElement);
|
||||||
|
@ -282,7 +282,7 @@ void BookmarksToolbar::loadFolderBookmarksInTabs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const Bookmark &b, m_bookmarksModel->folderBookmarks(folder)) {
|
foreach(const Bookmark & b, m_bookmarksModel->folderBookmarks(folder)) {
|
||||||
p_QupZilla->tabWidget()->addView(b.url, b.title, Qz::NT_NotSelectedTab);
|
p_QupZilla->tabWidget()->addView(b.url, b.title, Qz::NT_NotSelectedTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -534,7 +534,7 @@ void BookmarksToolbar::aboutToShowFolderMenu()
|
|||||||
menu->clear();
|
menu->clear();
|
||||||
QString folder = menu->title();
|
QString folder = menu->title();
|
||||||
|
|
||||||
foreach(const Bookmark &b, m_bookmarksModel->folderBookmarks(folder)) {
|
foreach(const Bookmark & b, m_bookmarksModel->folderBookmarks(folder)) {
|
||||||
QString title = b.title;
|
QString title = b.title;
|
||||||
if (title.length() > 40) {
|
if (title.length() > 40) {
|
||||||
title.truncate(40);
|
title.truncate(40);
|
||||||
@ -586,7 +586,7 @@ void BookmarksToolbar::refreshMostVisited()
|
|||||||
m_menuMostVisited->clear();
|
m_menuMostVisited->clear();
|
||||||
|
|
||||||
QList<HistoryEntry> mostList = m_historyModel->mostVisited(10);
|
QList<HistoryEntry> mostList = m_historyModel->mostVisited(10);
|
||||||
foreach(const HistoryEntry &entry, mostList) {
|
foreach(const HistoryEntry & entry, mostList) {
|
||||||
QString title = entry.title;
|
QString title = entry.title;
|
||||||
if (title.length() > 40) {
|
if (title.length() > 40) {
|
||||||
title.truncate(40);
|
title.truncate(40);
|
||||||
|
@ -93,7 +93,7 @@ void BookmarksImportDialog::startFetchingIcons()
|
|||||||
ui->progressBar->setMaximum(m_exportedBookmarks.count());
|
ui->progressBar->setMaximum(m_exportedBookmarks.count());
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(const Bookmark &b, m_exportedBookmarks) {
|
foreach(const Bookmark & b, m_exportedBookmarks) {
|
||||||
QTreeWidgetItem* item = new QTreeWidgetItem();
|
QTreeWidgetItem* item = new QTreeWidgetItem();
|
||||||
item->setText(0, b.title);
|
item->setText(0, b.title);
|
||||||
item->setIcon(0, QWebSettings::globalSettings()->webGraphic(QWebSettings::DefaultFrameIconGraphic));
|
item->setIcon(0, QWebSettings::globalSettings()->webGraphic(QWebSettings::DefaultFrameIconGraphic));
|
||||||
@ -263,7 +263,7 @@ void BookmarksImportDialog::addExportedBookmarks()
|
|||||||
model->createFolder(m_exportedBookmarks.at(0).folder);
|
model->createFolder(m_exportedBookmarks.at(0).folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const Bookmark &b, m_exportedBookmarks) {
|
foreach(const Bookmark & b, m_exportedBookmarks) {
|
||||||
model->saveBookmark(b.url, b.title, IconProvider::iconFromImage(b.image), b.folder);
|
model->saveBookmark(b.url, b.title, IconProvider::iconFromImage(b.image), b.folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const
|
|||||||
|
|
||||||
QList<QNetworkCookie> newList = cookieList;
|
QList<QNetworkCookie> newList = cookieList;
|
||||||
|
|
||||||
foreach(const QNetworkCookie &cok, newList) {
|
foreach(const QNetworkCookie & cok, newList) {
|
||||||
if (m_allowCookiesFromDomain && !QString("." + url.host()).contains(cok.domain().remove("www."))) {
|
if (m_allowCookiesFromDomain && !QString("." + url.host()).contains(cok.domain().remove("www."))) {
|
||||||
#ifdef COOKIE_DEBUG
|
#ifdef COOKIE_DEBUG
|
||||||
qDebug() << "purged for domain mismatch" << cok;
|
qDebug() << "purged for domain mismatch" << cok;
|
||||||
|
@ -73,7 +73,7 @@ void CookieManager::removeCookie()
|
|||||||
|
|
||||||
if (current->text(1).isEmpty()) { //Remove whole cookie group
|
if (current->text(1).isEmpty()) { //Remove whole cookie group
|
||||||
QString domain = current->whatsThis(0);
|
QString domain = current->whatsThis(0);
|
||||||
foreach(const QNetworkCookie &cok, m_cookies) {
|
foreach(const QNetworkCookie & cok, m_cookies) {
|
||||||
if (cok.domain() == domain || cok.domain() == domain.mid(1)) {
|
if (cok.domain() == domain || cok.domain() == domain.mid(1)) {
|
||||||
m_cookies.removeOne(cok);
|
m_cookies.removeOne(cok);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ void DownloadManager::timerEvent(QTimerEvent* event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTime remaining;
|
QTime remaining;
|
||||||
foreach(const QTime &time, remTimes) {
|
foreach(const QTime & time, remTimes) {
|
||||||
if (time > remaining) {
|
if (time > remaining) {
|
||||||
remaining = time;
|
remaining = time;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ int main(int argc, char* argv[])
|
|||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
CommandLineOptions cmd(argc, argv);
|
CommandLineOptions cmd(argc, argv);
|
||||||
cmdActions = cmd.getActions();
|
cmdActions = cmd.getActions();
|
||||||
foreach(const CommandLineOptions::ActionPair &pair, cmdActions) {
|
foreach(const CommandLineOptions::ActionPair & pair, cmdActions) {
|
||||||
switch (pair.action) {
|
switch (pair.action) {
|
||||||
case Qz::CL_ExitAction:
|
case Qz::CL_ExitAction:
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -58,7 +58,7 @@ QStringList LocationCompleter::splitPath(const QString &path) const
|
|||||||
titleSearching = true;
|
titleSearching = true;
|
||||||
}
|
}
|
||||||
QString prefix = url.mid(0, url.indexOf(path));
|
QString prefix = url.mid(0, url.indexOf(path));
|
||||||
foreach(const QString &string, returned) {
|
foreach(const QString & string, returned) {
|
||||||
if (titleSearching) {
|
if (titleSearching) {
|
||||||
returned2.append(url);
|
returned2.append(url);
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ QStringList LocationCompleter::splitPath(const QString &path) const
|
|||||||
return returned2;
|
return returned2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach(const QString &string, returned)
|
foreach(const QString & string, returned)
|
||||||
returned2.append("http://www.google.com/search?client=qupzilla&q=" + string);
|
returned2.append("http://www.google.com/search?client=qupzilla&q=" + string);
|
||||||
return returned2;
|
return returned2;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ void WebSearchBar::setupEngines()
|
|||||||
|
|
||||||
m_boxSearchType->clearItems();
|
m_boxSearchType->clearItems();
|
||||||
|
|
||||||
foreach(const SearchEngine &en, m_searchManager->allEngines()) {
|
foreach(const SearchEngine & en, m_searchManager->allEngines()) {
|
||||||
ButtonWithMenu::Item item;
|
ButtonWithMenu::Item item;
|
||||||
item.icon = en.icon;
|
item.icon = en.icon;
|
||||||
item.text = en.name;
|
item.text = en.name;
|
||||||
@ -158,7 +158,7 @@ void WebSearchBar::completeMenuWithAvailableEngines(QMenu* menu)
|
|||||||
QWebFrame* frame = view->page()->mainFrame();
|
QWebFrame* frame = view->page()->mainFrame();
|
||||||
|
|
||||||
QWebElementCollection elements = frame->documentElement().findAll(QLatin1String("link[rel=search]"));
|
QWebElementCollection elements = frame->documentElement().findAll(QLatin1String("link[rel=search]"));
|
||||||
foreach(const QWebElement &element, elements) {
|
foreach(const QWebElement & element, elements) {
|
||||||
if (element.attribute("type") != "application/opensearchdescription+xml") {
|
if (element.attribute("type") != "application/opensearchdescription+xml") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -204,7 +204,7 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
|
|||||||
m_menu->clear();
|
m_menu->clear();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(QAction* act, tempMenu->actions()) {
|
foreach(QAction * act, tempMenu->actions()) {
|
||||||
act->setParent(m_menu);
|
act->setParent(m_menu);
|
||||||
tempMenu->removeAction(act);
|
tempMenu->removeAction(act);
|
||||||
m_menu->addAction(act);
|
m_menu->addAction(act);
|
||||||
|
@ -83,8 +83,8 @@ private:
|
|||||||
SearchEnginesManager* m_searchManager;
|
SearchEnginesManager* m_searchManager;
|
||||||
QWeakPointer<SearchEnginesDialog> m_searchDialog;
|
QWeakPointer<SearchEnginesDialog> m_searchDialog;
|
||||||
|
|
||||||
QAction* m_pasteAndGoAction;
|
|
||||||
QMenu* m_menu;
|
QMenu* m_menu;
|
||||||
|
QAction* m_pasteAndGoAction;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ void NetworkManager::sslError(QNetworkReply* reply, QList<QSslError> errors)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int errorsIgnored = 0;
|
int errorsIgnored = 0;
|
||||||
foreach(const QSslError &error, errors) {
|
foreach(const QSslError & error, errors) {
|
||||||
if (m_ignoredCerts.contains(error.certificate())) {
|
if (m_ignoredCerts.contains(error.certificate())) {
|
||||||
++errorsIgnored;
|
++errorsIgnored;
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ void NetworkManager::sslError(QNetworkReply* reply, QList<QSslError> errors)
|
|||||||
|
|
||||||
QString certs;
|
QString certs;
|
||||||
|
|
||||||
foreach(const QSslError &error, errors) {
|
foreach(const QSslError & error, errors) {
|
||||||
if (m_localCerts.contains(error.certificate())) {
|
if (m_localCerts.contains(error.certificate())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ void NetworkManager::sslError(QNetworkReply* reply, QList<QSslError> errors)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const QSslError &error, errors) {
|
foreach(const QSslError & error, errors) {
|
||||||
if (!m_localCerts.contains(error.certificate())) {
|
if (!m_localCerts.contains(error.certificate())) {
|
||||||
addLocalCertificate(error.certificate());
|
addLocalCertificate(error.certificate());
|
||||||
}
|
}
|
||||||
@ -414,7 +414,7 @@ void NetworkManager::loadCertificates()
|
|||||||
|
|
||||||
//CA Certificates
|
//CA Certificates
|
||||||
m_caCerts = QSslSocket::defaultCaCertificates();
|
m_caCerts = QSslSocket::defaultCaCertificates();
|
||||||
foreach(const QString &path, m_certPaths) {
|
foreach(const QString & path, m_certPaths) {
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
// Used from Qt 4.7.4 qsslcertificate.cpp and modified because QSslCertificate::fromPath
|
// Used from Qt 4.7.4 qsslcertificate.cpp and modified because QSslCertificate::fromPath
|
||||||
// is kind of a bugged on Windows, it does work only with full path to cert file
|
// is kind of a bugged on Windows, it does work only with full path to cert file
|
||||||
|
@ -159,7 +159,7 @@ void SearchEnginesDialog::reloadEngines()
|
|||||||
{
|
{
|
||||||
ui->treeWidget->clear();
|
ui->treeWidget->clear();
|
||||||
|
|
||||||
foreach(const SearchEngine &en, m_manager->allEngines()) {
|
foreach(const SearchEngine & en, m_manager->allEngines()) {
|
||||||
QTreeWidgetItem* item = new QTreeWidgetItem();
|
QTreeWidgetItem* item = new QTreeWidgetItem();
|
||||||
item->setIcon(0, en.icon);
|
item->setIcon(0, en.icon);
|
||||||
item->setText(0, en.name);
|
item->setText(0, en.name);
|
||||||
|
@ -78,7 +78,7 @@ SearchEngine SearchEnginesManager::engineForShortcut(const QString &shortcut)
|
|||||||
return returnEngine;
|
return returnEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const Engine &en, m_allEngines) {
|
foreach(const Engine & en, m_allEngines) {
|
||||||
if (en.shortcut == shortcut) {
|
if (en.shortcut == shortcut) {
|
||||||
returnEngine = en;
|
returnEngine = en;
|
||||||
break;
|
break;
|
||||||
@ -326,7 +326,7 @@ void SearchEnginesManager::saveSettings()
|
|||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
query.exec("DELETE FROM search_engines");
|
query.exec("DELETE FROM search_engines");
|
||||||
|
|
||||||
foreach(const Engine &en, m_allEngines) {
|
foreach(const Engine & en, m_allEngines) {
|
||||||
query.prepare("INSERT INTO search_engines (name, icon, url, shortcut, suggestionsUrl, suggestionsParameters) VALUES (?, ?, ?, ?, ?, ?)");
|
query.prepare("INSERT INTO search_engines (name, icon, url, shortcut, suggestionsUrl, suggestionsParameters) VALUES (?, ?, ?, ?, ?, ?)");
|
||||||
query.bindValue(0, en.name);
|
query.bindValue(0, en.name);
|
||||||
query.bindValue(1, IconProvider::iconToBase64(en.icon));
|
query.bindValue(1, IconProvider::iconToBase64(en.icon));
|
||||||
|
@ -205,7 +205,7 @@ void ClickToFlash::findElement()
|
|||||||
elements.append(docElement.findAll(QLatin1String("embed")));
|
elements.append(docElement.findAll(QLatin1String("embed")));
|
||||||
elements.append(docElement.findAll(QLatin1String("object")));
|
elements.append(docElement.findAll(QLatin1String("object")));
|
||||||
|
|
||||||
foreach(const QWebElement &element, elements) {
|
foreach(const QWebElement & element, elements) {
|
||||||
if (!checkElement(element) && !checkUrlOnElement(element)) {
|
if (!checkElement(element) && !checkUrlOnElement(element)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -251,7 +251,7 @@ bool ClickToFlash::checkUrlOnElement(QWebElement el)
|
|||||||
bool ClickToFlash::checkElement(QWebElement el)
|
bool ClickToFlash::checkElement(QWebElement el)
|
||||||
{
|
{
|
||||||
if (m_argumentNames == el.attributeNames()) {
|
if (m_argumentNames == el.attributeNames()) {
|
||||||
foreach(const QString &name, m_argumentNames) {
|
foreach(const QString & name, m_argumentNames) {
|
||||||
if (m_argumentValues.indexOf(el.attribute(name)) == -1) {
|
if (m_argumentValues.indexOf(el.attribute(name)) == -1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -271,7 +271,7 @@ void ClickToFlash::showInfo()
|
|||||||
lay->addRow(new QLabel(tr("<b>Attribute Name</b>")), new QLabel(tr("<b>Value</b>")));
|
lay->addRow(new QLabel(tr("<b>Attribute Name</b>")), new QLabel(tr("<b>Value</b>")));
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(const QString &name, m_argumentNames) {
|
foreach(const QString & name, m_argumentNames) {
|
||||||
QString value = m_argumentValues.at(i);
|
QString value = m_argumentValues.at(i);
|
||||||
SqueezeLabelV2* valueLabel = new SqueezeLabelV2(value);
|
SqueezeLabelV2* valueLabel = new SqueezeLabelV2(value);
|
||||||
valueLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
|
valueLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
|
||||||
|
@ -54,7 +54,7 @@ void Plugins::loadPlugins()
|
|||||||
|
|
||||||
QDir pluginsDir = QDir(mApp->PLUGINSDIR);
|
QDir pluginsDir = QDir(mApp->PLUGINSDIR);
|
||||||
|
|
||||||
foreach(const QString &fileName, pluginsDir.entryList(QDir::Files)) {
|
foreach(const QString & fileName, pluginsDir.entryList(QDir::Files)) {
|
||||||
m_availablePluginFileNames.append(fileName);
|
m_availablePluginFileNames.append(fileName);
|
||||||
|
|
||||||
if (!m_allowedPluginFileNames.contains(fileName)) {
|
if (!m_allowedPluginFileNames.contains(fileName)) {
|
||||||
|
@ -154,7 +154,7 @@ QString SpeedDial::initialScript()
|
|||||||
|
|
||||||
QStringList entries = m_allPages.split("\";");
|
QStringList entries = m_allPages.split("\";");
|
||||||
|
|
||||||
foreach(const QString &entry, entries) {
|
foreach(const QString & entry, entries) {
|
||||||
if (entry.isEmpty()) {
|
if (entry.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ AcceptLanguage::AcceptLanguage(QWidget* parent)
|
|||||||
settings.beginGroup("Language");
|
settings.beginGroup("Language");
|
||||||
QStringList langs = settings.value("acceptLanguage", defaultLanguage()).toStringList();
|
QStringList langs = settings.value("acceptLanguage", defaultLanguage()).toStringList();
|
||||||
|
|
||||||
foreach(const QString &code, langs) {
|
foreach(const QString & code, langs) {
|
||||||
QString code_ = code;
|
QString code_ = code;
|
||||||
QLocale loc = QLocale(code_.replace("-", "_"));
|
QLocale loc = QLocale(code_.replace("-", "_"));
|
||||||
QString label;
|
QString label;
|
||||||
|
@ -56,7 +56,7 @@ PluginsList::PluginsList(QWidget* parent)
|
|||||||
QStringList whitelist = mApp->plugins()->c2f_getWhiteList();
|
QStringList whitelist = mApp->plugins()->c2f_getWhiteList();
|
||||||
ui->allowClick2Flash->setChecked(settings.value("Enable", true).toBool());
|
ui->allowClick2Flash->setChecked(settings.value("Enable", true).toBool());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
foreach(const QString &site, whitelist) {
|
foreach(const QString & site, whitelist) {
|
||||||
QTreeWidgetItem* item = new QTreeWidgetItem(ui->whitelist);
|
QTreeWidgetItem* item = new QTreeWidgetItem(ui->whitelist);
|
||||||
item->setText(0, site);
|
item->setText(0, site);
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ void PluginsList::refresh()
|
|||||||
|
|
||||||
QStringList availablePlugins = mApp->plugins()->getAvailablePlugins();
|
QStringList availablePlugins = mApp->plugins()->getAvailablePlugins();
|
||||||
QStringList allowedPlugins = mApp->plugins()->getAllowedPlugins();
|
QStringList allowedPlugins = mApp->plugins()->getAllowedPlugins();
|
||||||
foreach(const QString &fileName, availablePlugins) {
|
foreach(const QString & fileName, availablePlugins) {
|
||||||
PluginInterface* plugin = mApp->plugins()->getPlugin(fileName);
|
PluginInterface* plugin = mApp->plugins()->getPlugin(fileName);
|
||||||
if (!plugin) {
|
if (!plugin) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -160,7 +160,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
|||||||
ui->startProfile->addItem(actProfileName);
|
ui->startProfile->addItem(actProfileName);
|
||||||
QDir profilesDir(mApp->PROFILEDIR + "profiles/");
|
QDir profilesDir(mApp->PROFILEDIR + "profiles/");
|
||||||
QStringList list_ = profilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
QStringList list_ = profilesDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
foreach(const QString &name, list_) {
|
foreach(const QString & name, list_) {
|
||||||
if (actProfileName == name) {
|
if (actProfileName == name) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -346,7 +346,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
|
|||||||
|
|
||||||
QDir lanDir(mApp->TRANSLATIONSDIR);
|
QDir lanDir(mApp->TRANSLATIONSDIR);
|
||||||
QStringList list = lanDir.entryList(QStringList("*.qm"));
|
QStringList list = lanDir.entryList(QStringList("*.qm"));
|
||||||
foreach(const QString &name, list) {
|
foreach(const QString & name, list) {
|
||||||
if (name.startsWith("qt_") || name == activeLanguage) {
|
if (name.startsWith("qt_") || name == activeLanguage) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ void SSLManager::refreshCAList()
|
|||||||
ui->caList->clear();
|
ui->caList->clear();
|
||||||
m_caCerts = QSslSocket::defaultCaCertificates();
|
m_caCerts = QSslSocket::defaultCaCertificates();
|
||||||
|
|
||||||
foreach(const QSslCertificate &cert, m_caCerts) {
|
foreach(const QSslCertificate & cert, m_caCerts) {
|
||||||
QListWidgetItem* item = new QListWidgetItem(ui->caList);
|
QListWidgetItem* item = new QListWidgetItem(ui->caList);
|
||||||
item->setText(CertificateInfoWidget::certificateItemText(cert));
|
item->setText(CertificateInfoWidget::certificateItemText(cert));
|
||||||
item->setWhatsThis(QString::number(m_caCerts.indexOf(cert)));
|
item->setWhatsThis(QString::number(m_caCerts.indexOf(cert)));
|
||||||
@ -93,7 +93,7 @@ void SSLManager::refreshLocalList()
|
|||||||
ui->localList->clear();
|
ui->localList->clear();
|
||||||
m_localCerts = mApp->networkManager()->getLocalCertificates();
|
m_localCerts = mApp->networkManager()->getLocalCertificates();
|
||||||
|
|
||||||
foreach(const QSslCertificate &cert, m_localCerts) {
|
foreach(const QSslCertificate & cert, m_localCerts) {
|
||||||
QListWidgetItem* item = new QListWidgetItem(ui->localList);
|
QListWidgetItem* item = new QListWidgetItem(ui->localList);
|
||||||
item->setText(CertificateInfoWidget::certificateItemText(cert));
|
item->setText(CertificateInfoWidget::certificateItemText(cert));
|
||||||
item->setWhatsThis(QString::number(m_localCerts.indexOf(cert)));
|
item->setWhatsThis(QString::number(m_localCerts.indexOf(cert)));
|
||||||
@ -106,7 +106,7 @@ void SSLManager::refreshLocalList()
|
|||||||
|
|
||||||
void SSLManager::refreshPaths()
|
void SSLManager::refreshPaths()
|
||||||
{
|
{
|
||||||
foreach(const QString &path, mApp->networkManager()->certificatePaths()) {
|
foreach(const QString & path, mApp->networkManager()->certificatePaths()) {
|
||||||
ui->pathList->addItem(path);
|
ui->pathList->addItem(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ ThemeManager::ThemeManager(QWidget* parent)
|
|||||||
QDir themeDir(mApp->THEMESDIR);
|
QDir themeDir(mApp->THEMESDIR);
|
||||||
QStringList list = themeDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
|
QStringList list = themeDir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
|
||||||
|
|
||||||
foreach(const QString &name, list) {
|
foreach(const QString & name, list) {
|
||||||
Theme themeInfo = parseTheme(name);
|
Theme themeInfo = parseTheme(name);
|
||||||
if (!themeInfo.isValid) {
|
if (!themeInfo.isValid) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -134,7 +134,7 @@ void ButtonWithMenu::generateMenu()
|
|||||||
{
|
{
|
||||||
m_menu->clear();
|
m_menu->clear();
|
||||||
|
|
||||||
foreach(const Item &item, m_items) {
|
foreach(const Item & item, m_items) {
|
||||||
QVariant variant;
|
QVariant variant;
|
||||||
variant.setValue<Item>(item);
|
variant.setValue<Item>(item);
|
||||||
m_menu->addAction(item.icon, item.text, this, SLOT(setCurrentItem()))->setData(variant);
|
m_menu->addAction(item.icon, item.text, this, SLOT(setCurrentItem()))->setData(variant);
|
||||||
|
@ -40,7 +40,7 @@ void IconProvider::saveIcon(WebView* view)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const Icon &ic, m_iconBuffer) {
|
foreach(const Icon & ic, m_iconBuffer) {
|
||||||
if (ic.url == item.url && ic.image == item.image) {
|
if (ic.url == item.url && ic.image == item.image) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ void IconProvider::saveIcon(WebView* view)
|
|||||||
|
|
||||||
QImage IconProvider::iconForUrl(const QUrl &url)
|
QImage IconProvider::iconForUrl(const QUrl &url)
|
||||||
{
|
{
|
||||||
foreach(const Icon &ic, m_iconBuffer) {
|
foreach(const Icon & ic, m_iconBuffer) {
|
||||||
if (ic.url == url) {
|
if (ic.url == url) {
|
||||||
return ic.image;
|
return ic.image;
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ QImage IconProvider::iconForUrl(const QUrl &url)
|
|||||||
|
|
||||||
QImage IconProvider::iconForDomain(const QUrl &url)
|
QImage IconProvider::iconForDomain(const QUrl &url)
|
||||||
{
|
{
|
||||||
foreach(const Icon &ic, m_iconBuffer) {
|
foreach(const Icon & ic, m_iconBuffer) {
|
||||||
if (ic.url.host() == url.host()) {
|
if (ic.url.host() == url.host()) {
|
||||||
return ic.image;
|
return ic.image;
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ QImage IconProvider::iconForDomain(const QUrl &url)
|
|||||||
|
|
||||||
void IconProvider::saveIconsToDatabase()
|
void IconProvider::saveIconsToDatabase()
|
||||||
{
|
{
|
||||||
foreach(const Icon &ic, m_iconBuffer) {
|
foreach(const Icon & ic, m_iconBuffer) {
|
||||||
QSqlQuery query;
|
QSqlQuery query;
|
||||||
query.prepare("SELECT id FROM icons WHERE url = ?");
|
query.prepare("SELECT id FROM icons WHERE url = ?");
|
||||||
query.bindValue(0, ic.url.toEncoded(QUrl::RemoveFragment));
|
query.bindValue(0, ic.url.toEncoded(QUrl::RemoveFragment));
|
||||||
|
@ -517,7 +517,7 @@ void TabWidget::restoreAllClosedTabs()
|
|||||||
|
|
||||||
QList<ClosedTabsManager::Tab> closedTabs = m_closedTabsManager->allClosedTabs();
|
QList<ClosedTabsManager::Tab> closedTabs = m_closedTabsManager->allClosedTabs();
|
||||||
|
|
||||||
foreach(const ClosedTabsManager::Tab &tab, closedTabs) {
|
foreach(const ClosedTabsManager::Tab & tab, closedTabs) {
|
||||||
int index = addView(QUrl(), tab.title, Qz::NT_CleanSelectedTab);
|
int index = addView(QUrl(), tab.title, Qz::NT_CleanSelectedTab);
|
||||||
QDataStream historyStream(tab.history);
|
QDataStream historyStream(tab.history);
|
||||||
historyStream >> *weView(index)->history();
|
historyStream >> *weView(index)->history();
|
||||||
@ -541,28 +541,28 @@ bool TabWidget::canRestoreTab()
|
|||||||
void TabWidget::aboutToShowClosedTabsMenu()
|
void TabWidget::aboutToShowClosedTabsMenu()
|
||||||
{
|
{
|
||||||
if (!m_closedInsteadOpened) {
|
if (!m_closedInsteadOpened) {
|
||||||
aboutToShowTabsMenu();
|
aboutToShowTabsMenu();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_menuTabs->clear();
|
m_menuTabs->clear();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(const ClosedTabsManager::Tab &tab, this->closedTabsManager()->allClosedTabs()) {
|
foreach(const ClosedTabsManager::Tab & tab, this->closedTabsManager()->allClosedTabs()) {
|
||||||
QString title = tab.title;
|
QString title = tab.title;
|
||||||
if (title.length() > 40) {
|
if (title.length() > 40) {
|
||||||
title.truncate(40);
|
title.truncate(40);
|
||||||
title += "..";
|
title += "..";
|
||||||
}
|
}
|
||||||
m_menuTabs->addAction(_iconForUrl(tab.url), title, this, SLOT(restoreClosedTab()))->setData(i);
|
m_menuTabs->addAction(_iconForUrl(tab.url), title, this, SLOT(restoreClosedTab()))->setData(i);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
m_menuTabs->addSeparator();
|
m_menuTabs->addSeparator();
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
m_menuTabs->addAction(tr("Empty"))->setEnabled(false);
|
m_menuTabs->addAction(tr("Empty"))->setEnabled(false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_menuTabs->addAction(tr("Restore All Closed Tabs"), this, SLOT(restoreAllClosedTabs()));
|
m_menuTabs->addAction(tr("Restore All Closed Tabs"), this, SLOT(restoreAllClosedTabs()));
|
||||||
m_menuTabs->addAction(tr("Clear list"), this, SLOT(clearClosedTabsList()));
|
m_menuTabs->addAction(tr("Clear list"), this, SLOT(clearClosedTabsList()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ QList<QWebHistoryItem> WebHistoryWrapper::forwardItems(int maxItems, QWebHistory
|
|||||||
QUrl lastUrl = history->currentItem().url();
|
QUrl lastUrl = history->currentItem().url();
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
foreach(const QWebHistoryItem &item, history->forwardItems(maxItems + 5)) {
|
foreach(const QWebHistoryItem & item, history->forwardItems(maxItems + 5)) {
|
||||||
if (item.url() == lastUrl || count == maxItems) {
|
if (item.url() == lastUrl || count == maxItems) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ void WebPage::cleanBlockedObjects()
|
|||||||
{
|
{
|
||||||
QStringList findingStrings;
|
QStringList findingStrings;
|
||||||
|
|
||||||
foreach(const AdBlockedEntry &entry, m_adBlockedEntries) {
|
foreach(const AdBlockedEntry & entry, m_adBlockedEntries) {
|
||||||
if (entry.url.toString().endsWith(".js")) {
|
if (entry.url.toString().endsWith(".js")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -309,7 +309,7 @@ void WebPage::cleanBlockedObjects()
|
|||||||
QWebElement docElement = mainFrame()->documentElement();
|
QWebElement docElement = mainFrame()->documentElement();
|
||||||
QWebElementCollection elements;
|
QWebElementCollection elements;
|
||||||
|
|
||||||
foreach(const QString &s, findingStrings) {
|
foreach(const QString & s, findingStrings) {
|
||||||
elements.append(docElement.findAll("*[src=\"" + s + "\"]"));
|
elements.append(docElement.findAll("*[src=\"" + s + "\"]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,7 +520,7 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c
|
|||||||
QMenu* pageMenu = page()->createStandardContextMenu();
|
QMenu* pageMenu = page()->createStandardContextMenu();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach(QAction* act, pageMenu->actions()) {
|
foreach(QAction * act, pageMenu->actions()) {
|
||||||
if (act->isSeparator()) {
|
if (act->isSeparator()) {
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
continue;
|
continue;
|
||||||
@ -771,35 +771,58 @@ void WebView::mousePressEvent(QMouseEvent* event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::MiddleButton: {
|
case Qt::MiddleButton: {
|
||||||
QWebFrame* frame = page()->frameAt(event->pos());
|
|
||||||
|
|
||||||
if (frame) {
|
|
||||||
QUrl link = frame->hitTestContent(event->pos()).linkUrl();
|
|
||||||
if (isUrlValid(link)) {
|
|
||||||
openUrlInNewTab(link, m_newTabAfterActive ? Qz::NT_NotSelectedTab : Qz::NT_CleanTab);
|
|
||||||
event->accept();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_WS_WIN
|
||||||
else {
|
QWebFrame* frame = page()->frameAt(event->pos());
|
||||||
|
if (frame && frame->hitTestContent(event->pos()).linkUrl().isEmpty()) {
|
||||||
// Creating auto scroll on Windows
|
// Creating auto scroll on Windows
|
||||||
|
m_clickedUrl = QUrl();
|
||||||
QWebView::mouseDoubleClickEvent(event);
|
QWebView::mouseDoubleClickEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
case Qt::LeftButton: {
|
||||||
|
QWebFrame* frame = page()->frameAt(event->pos());
|
||||||
|
if (frame) {
|
||||||
|
m_clickedUrl = frame->hitTestContent(event->pos()).linkUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWebView::mousePressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WebView::mouseReleaseEvent(QMouseEvent* event)
|
||||||
|
{
|
||||||
|
switch (event->button()) {
|
||||||
|
case Qt::MiddleButton: {
|
||||||
|
QWebFrame* frame = page()->frameAt(event->pos());
|
||||||
|
if (frame) {
|
||||||
|
QUrl link = frame->hitTestContent(event->pos()).linkUrl();
|
||||||
|
if (m_clickedUrl == link && isUrlValid(link)) {
|
||||||
|
openUrlInNewTab(link, Qz::NT_NotSelectedTab);
|
||||||
|
event->accept();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Qt::LeftButton: {
|
case Qt::LeftButton: {
|
||||||
QWebFrame* frame = page()->frameAt(event->pos());
|
QWebFrame* frame = page()->frameAt(event->pos());
|
||||||
|
if (frame) {
|
||||||
if (frame && event->modifiers() == Qt::ControlModifier) {
|
|
||||||
QUrl link = frame->hitTestContent(event->pos()).linkUrl();
|
QUrl link = frame->hitTestContent(event->pos()).linkUrl();
|
||||||
if (isUrlValid(link)) {
|
if (m_clickedUrl == link && event->modifiers() == Qt::ControlModifier) {
|
||||||
openUrlInNewTab(link, m_newTabAfterActive ? Qz::NT_NotSelectedTab : Qz::NT_CleanTab);
|
if (isUrlValid(link)) {
|
||||||
event->accept();
|
openUrlInNewTab(link, m_newTabAfterActive ? Qz::NT_NotSelectedTab : Qz::NT_CleanTab);
|
||||||
return;
|
event->accept();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,7 +833,7 @@ void WebView::mousePressEvent(QMouseEvent* event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWebView::mousePressEvent(event);
|
QWebView::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::keyPressEvent(QKeyEvent* event)
|
void WebView::keyPressEvent(QKeyEvent* event)
|
||||||
|
@ -108,6 +108,7 @@ protected slots:
|
|||||||
protected:
|
protected:
|
||||||
void wheelEvent(QWheelEvent* event);
|
void wheelEvent(QWheelEvent* event);
|
||||||
void mousePressEvent(QMouseEvent* event);
|
void mousePressEvent(QMouseEvent* event);
|
||||||
|
void mouseReleaseEvent(QMouseEvent* event);
|
||||||
void keyPressEvent(QKeyEvent* event);
|
void keyPressEvent(QKeyEvent* event);
|
||||||
void resizeEvent(QResizeEvent* event);
|
void resizeEvent(QResizeEvent* event);
|
||||||
|
|
||||||
@ -143,6 +144,7 @@ private:
|
|||||||
|
|
||||||
QWebElement m_mediaElement;
|
QWebElement m_mediaElement;
|
||||||
QWebFrame* m_clickedFrame;
|
QWebFrame* m_clickedFrame;
|
||||||
|
QUrl m_clickedUrl;
|
||||||
bool m_actionsHaveImages;
|
bool m_actionsHaveImages;
|
||||||
bool m_newTabAfterActive;
|
bool m_newTabAfterActive;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user