mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Port away from many deprecated things
Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
131dad641e
commit
80bd47ef46
2
src/lib/3rdparty/squeezelabelv1.cpp
vendored
2
src/lib/3rdparty/squeezelabelv1.cpp
vendored
@ -38,7 +38,7 @@ void SqueezeLabelV1::paintEvent(QPaintEvent* event)
|
|||||||
if (m_SqueezedTextCache != text()) {
|
if (m_SqueezedTextCache != text()) {
|
||||||
m_SqueezedTextCache = text();
|
m_SqueezedTextCache = text();
|
||||||
QFontMetrics fm = fontMetrics();
|
QFontMetrics fm = fontMetrics();
|
||||||
if (fm.width(m_SqueezedTextCache) > contentsRect().width()) {
|
if (fm.horizontalAdvance(m_SqueezedTextCache) > contentsRect().width()) {
|
||||||
QString elided = fm.elidedText(text(), Qt::ElideMiddle, width());
|
QString elided = fm.elidedText(text(), Qt::ElideMiddle, width());
|
||||||
setText(elided);
|
setText(elided);
|
||||||
}
|
}
|
||||||
|
6
src/lib/3rdparty/stylehelper.cpp
vendored
6
src/lib/3rdparty/stylehelper.cpp
vendored
@ -155,9 +155,9 @@ void StyleHelper::verticalGradient(QPainter* painter, const QRect &spanRect, con
|
|||||||
if (StyleHelper::usePixmapCache()) {
|
if (StyleHelper::usePixmapCache()) {
|
||||||
QString key;
|
QString key;
|
||||||
QColor keyColor = baseColor(lightColored);
|
QColor keyColor = baseColor(lightColored);
|
||||||
key.sprintf("mh_vertical %d %d %d %d %d",
|
key.asprintf("mh_vertical %d %d %d %d %d",
|
||||||
spanRect.width(), spanRect.height(), clipRect.width(),
|
spanRect.width(), spanRect.height(), clipRect.width(),
|
||||||
clipRect.height(), keyColor.rgb());
|
clipRect.height(), keyColor.rgb());
|
||||||
|
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
if (!QPixmapCache::find(key, pixmap)) {
|
if (!QPixmapCache::find(key, pixmap)) {
|
||||||
|
@ -309,10 +309,10 @@ void AdBlockCustomList::loadSubscription(const QStringList &disabledRules)
|
|||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
|
|
||||||
if (!rules.contains(ddg1 + QL1S("\n")))
|
if (!rules.contains(ddg1 + QL1S("\n")))
|
||||||
stream << ddg1 << endl;
|
stream << ddg1 << Qt::endl;
|
||||||
|
|
||||||
if (!rules.contains(QL1S("\n") + ddg2))
|
if (!rules.contains(QL1S("\n") + ddg2))
|
||||||
stream << ddg2 << endl;
|
stream << ddg2 << Qt::endl;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
@ -330,12 +330,12 @@ void AdBlockCustomList::saveSubscription()
|
|||||||
|
|
||||||
QTextStream textStream(&file);
|
QTextStream textStream(&file);
|
||||||
textStream.setCodec("UTF-8");
|
textStream.setCodec("UTF-8");
|
||||||
textStream << "Title: " << title() << endl;
|
textStream << "Title: " << title() << Qt::endl;
|
||||||
textStream << "Url: " << url().toString() << endl;
|
textStream << "Url: " << url().toString() << Qt::endl;
|
||||||
textStream << "[Adblock Plus 1.1.1]" << endl;
|
textStream << "[Adblock Plus 1.1.1]" << Qt::endl;
|
||||||
|
|
||||||
for (const AdBlockRule* rule : qAsConst(m_rules)) {
|
for (const AdBlockRule* rule : qAsConst(m_rules)) {
|
||||||
textStream << rule->filter() << endl;
|
textStream << rule->filter() << Qt::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
@ -77,7 +77,7 @@ QIcon BookmarkItem::icon()
|
|||||||
|
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case Url:
|
case Url:
|
||||||
if (m_iconTime.isNull() || m_iconTime.elapsed() > iconCacheTime) {
|
if ((!m_iconTime.isValid()) || (m_iconTime.elapsed() > iconCacheTime)) {
|
||||||
m_icon = IconProvider::iconForUrl(m_url);
|
m_icon = IconProvider::iconForUrl(m_url);
|
||||||
m_iconTime.restart();
|
m_iconTime.restart();
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QTime>
|
#include <QElapsedTimer>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
@ -97,7 +97,7 @@ private:
|
|||||||
QString m_description;
|
QString m_description;
|
||||||
QString m_keyword;
|
QString m_keyword;
|
||||||
QIcon m_icon;
|
QIcon m_icon;
|
||||||
QTime m_iconTime;
|
QElapsedTimer m_iconTime;
|
||||||
int m_visitCount;
|
int m_visitCount;
|
||||||
bool m_expanded;
|
bool m_expanded;
|
||||||
bool m_sidebarExpanded;
|
bool m_sidebarExpanded;
|
||||||
|
@ -51,13 +51,13 @@ bool HtmlExporter::exportBookmarks(BookmarkItem* root)
|
|||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
|
|
||||||
stream << "<!DOCTYPE NETSCAPE-Bookmark-file-1>" << endl;
|
stream << "<!DOCTYPE NETSCAPE-Bookmark-file-1>" << Qt::endl;
|
||||||
stream << "<!-- This is an automatically generated file." << endl;
|
stream << "<!-- This is an automatically generated file." << Qt::endl;
|
||||||
stream << " It will be read and overwritten." << endl;
|
stream << " It will be read and overwritten." << Qt::endl;
|
||||||
stream << " DO NOT EDIT! -->" << endl;
|
stream << " DO NOT EDIT! -->" << Qt::endl;
|
||||||
stream << R"(<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">)" << endl;
|
stream << R"(<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">)" << Qt::endl;
|
||||||
stream << "<TITLE>Bookmarks</TITLE>" << endl;
|
stream << "<TITLE>Bookmarks</TITLE>" << Qt::endl;
|
||||||
stream << "<H1>Bookmarks</H1>" << endl;
|
stream << "<H1>Bookmarks</H1>" << Qt::endl;
|
||||||
|
|
||||||
writeBookmark(root, stream, 0);
|
writeBookmark(root, stream, 0);
|
||||||
return true;
|
return true;
|
||||||
@ -72,35 +72,35 @@ void HtmlExporter::writeBookmark(BookmarkItem* item, QTextStream &stream, int le
|
|||||||
|
|
||||||
switch (item->type()) {
|
switch (item->type()) {
|
||||||
case BookmarkItem::Url:
|
case BookmarkItem::Url:
|
||||||
stream << indent << "<DT><A HREF=\"" << item->urlString() << "\">" << item->title() << "</A>" << endl;
|
stream << indent << "<DT><A HREF=\"" << item->urlString() << "\">" << item->title() << "</A>" << Qt::endl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BookmarkItem::Separator:
|
case BookmarkItem::Separator:
|
||||||
stream << indent << "<HR>" << endl;
|
stream << indent << "<HR>" << Qt::endl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BookmarkItem::Folder: {
|
case BookmarkItem::Folder: {
|
||||||
stream << indent << "<DT><H3>" << item->title() << "</H3>" << endl;
|
stream << indent << "<DT><H3>" << item->title() << "</H3>" << Qt::endl;
|
||||||
stream << indent << "<DL><p>" << endl;
|
stream << indent << "<DL><p>" << Qt::endl;
|
||||||
|
|
||||||
const auto children = item->children();
|
const auto children = item->children();
|
||||||
for (BookmarkItem* child : children) {
|
for (BookmarkItem* child : children) {
|
||||||
writeBookmark(child, stream, level + 1);
|
writeBookmark(child, stream, level + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << indent << "</DL><p>" << endl;
|
stream << indent << "</DL><p>" << Qt::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case BookmarkItem::Root: {
|
case BookmarkItem::Root: {
|
||||||
stream << indent << "<DL><p>" << endl;
|
stream << indent << "<DL><p>" << Qt::endl;
|
||||||
|
|
||||||
const auto children = item->children();
|
const auto children = item->children();
|
||||||
for (BookmarkItem* child : children) {
|
for (BookmarkItem* child : children) {
|
||||||
writeBookmark(child, stream, level + 1);
|
writeBookmark(child, stream, level + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << indent << "</DL><p>" << endl;
|
stream << indent << "</DL><p>" << Qt::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <QBasicTimer>
|
#include <QBasicTimer>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
@ -52,7 +53,7 @@ public:
|
|||||||
QString path() const;
|
QString path() const;
|
||||||
QString fileName() const;
|
QString fileName() const;
|
||||||
~DownloadItem() override;
|
~DownloadItem() override;
|
||||||
void setDownTimer(const QTime &timer) { m_downTimer = timer; }
|
void setDownTimer(const QElapsedTimer &timer) { m_downTimer = timer; }
|
||||||
|
|
||||||
void startDownloading();
|
void startDownloading();
|
||||||
|
|
||||||
@ -87,7 +88,7 @@ private:
|
|||||||
QWebEngineDownloadItem* m_download;
|
QWebEngineDownloadItem* m_download;
|
||||||
QString m_path;
|
QString m_path;
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
QTime m_downTimer;
|
QElapsedTimer m_downTimer;
|
||||||
QTime m_remTime;
|
QTime m_remTime;
|
||||||
QUrl m_downUrl;
|
QUrl m_downUrl;
|
||||||
bool m_openFile;
|
bool m_openFile;
|
||||||
|
@ -260,7 +260,7 @@ void DownloadManager::clearList()
|
|||||||
|
|
||||||
void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
||||||
{
|
{
|
||||||
QTime downloadTimer;
|
QElapsedTimer downloadTimer;
|
||||||
downloadTimer.start();
|
downloadTimer.start();
|
||||||
|
|
||||||
closeDownloadTab(downloadItem);
|
closeDownloadTab(downloadItem);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QTimeZone>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
static QString dateTimeToString(const QDateTime &dateTime)
|
static QString dateTimeToString(const QDateTime &dateTime)
|
||||||
@ -336,7 +337,7 @@ void HistoryModel::historyEntryAdded(const HistoryEntry &entry)
|
|||||||
|
|
||||||
m_todayItem = new HistoryItem(0);
|
m_todayItem = new HistoryItem(0);
|
||||||
m_todayItem->setStartTimestamp(-1);
|
m_todayItem->setStartTimestamp(-1);
|
||||||
m_todayItem->setEndTimestamp(QDateTime(QDate::currentDate()).toMSecsSinceEpoch());
|
m_todayItem->setEndTimestamp(QDateTime(QDate::currentDate(), QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch());
|
||||||
m_todayItem->title = tr("Today");
|
m_todayItem->title = tr("Today");
|
||||||
|
|
||||||
m_rootItem->prependChild(m_todayItem);
|
m_rootItem->prependChild(m_todayItem);
|
||||||
@ -466,17 +467,17 @@ void HistoryModel::init()
|
|||||||
QString itemName;
|
QString itemName;
|
||||||
|
|
||||||
if (timestampDate == today) {
|
if (timestampDate == today) {
|
||||||
endTimestamp = QDateTime(today).toMSecsSinceEpoch();
|
endTimestamp = QDateTime(today, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
|
|
||||||
itemName = tr("Today");
|
itemName = tr("Today");
|
||||||
}
|
}
|
||||||
else if (timestampDate >= week) {
|
else if (timestampDate >= week) {
|
||||||
endTimestamp = QDateTime(week).toMSecsSinceEpoch();
|
endTimestamp = QDateTime(week, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
|
|
||||||
itemName = tr("This Week");
|
itemName = tr("This Week");
|
||||||
}
|
}
|
||||||
else if (timestampDate.month() == month.month() && timestampDate.year() == month.year()) {
|
else if (timestampDate.month() == month.month() && timestampDate.year() == month.year()) {
|
||||||
endTimestamp = QDateTime(month).toMSecsSinceEpoch();
|
endTimestamp = QDateTime(month, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
|
|
||||||
itemName = tr("This Month");
|
itemName = tr("This Month");
|
||||||
}
|
}
|
||||||
@ -484,8 +485,8 @@ void HistoryModel::init()
|
|||||||
QDate startDate(timestampDate.year(), timestampDate.month(), timestampDate.daysInMonth());
|
QDate startDate(timestampDate.year(), timestampDate.month(), timestampDate.daysInMonth());
|
||||||
QDate endDate(startDate.year(), startDate.month(), 1);
|
QDate endDate(startDate.year(), startDate.month(), 1);
|
||||||
|
|
||||||
timestamp = QDateTime(startDate, QTime(23, 59, 59)).toMSecsSinceEpoch();
|
timestamp = QDateTime(startDate, QTime(23, 59, 59), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
endTimestamp = QDateTime(endDate).toMSecsSinceEpoch();
|
endTimestamp = QDateTime(endDate, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
itemName = QString("%1 %2").arg(History::titleCaseLocalizedMonth(timestampDate.month()), QString::number(timestampDate.year()));
|
itemName = QString("%1 %2").arg(History::titleCaseLocalizedMonth(timestampDate.month()), QString::number(timestampDate.year()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <QWebEngineSettings>
|
#include <QWebEngineSettings>
|
||||||
#include <QNetworkDiskCache>
|
#include <QNetworkDiskCache>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QTimeZone>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QWebEngineProfile>
|
#include <QWebEngineProfile>
|
||||||
@ -111,13 +112,13 @@ void ClearPrivateData::dialogAccepted()
|
|||||||
|
|
||||||
switch (ui->historyLength->currentIndex()) {
|
switch (ui->historyLength->currentIndex()) {
|
||||||
case 0: //Later Today
|
case 0: //Later Today
|
||||||
end = QDateTime(today).toMSecsSinceEpoch();
|
end = QDateTime(today, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
break;
|
break;
|
||||||
case 1: //Week
|
case 1: //Week
|
||||||
end = QDateTime(week).toMSecsSinceEpoch();
|
end = QDateTime(week, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
break;
|
break;
|
||||||
case 2: //Month
|
case 2: //Month
|
||||||
end = QDateTime(month).toMSecsSinceEpoch();
|
end = QDateTime(month, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
break;
|
break;
|
||||||
case 3: //All
|
case 3: //All
|
||||||
break;
|
break;
|
||||||
|
@ -45,7 +45,7 @@ QPoint QmlWheelEvent::globalPos() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return QPoint(-1, -1);
|
return QPoint(-1, -1);
|
||||||
}
|
}
|
||||||
return m_wheelEvent->globalPos();
|
return m_wheelEvent->globalPosition().toPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF QmlWheelEvent::globalPosF() const
|
QPointF QmlWheelEvent::globalPosF() const
|
||||||
@ -53,7 +53,7 @@ QPointF QmlWheelEvent::globalPosF() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return QPointF(-1, -1);
|
return QPointF(-1, -1);
|
||||||
}
|
}
|
||||||
return m_wheelEvent->globalPosF();
|
return m_wheelEvent->globalPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
int QmlWheelEvent::globalX() const
|
int QmlWheelEvent::globalX() const
|
||||||
@ -61,7 +61,7 @@ int QmlWheelEvent::globalX() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return m_wheelEvent->globalX();
|
return m_wheelEvent->globalPosition().toPoint().x();
|
||||||
}
|
}
|
||||||
|
|
||||||
int QmlWheelEvent::globalY() const
|
int QmlWheelEvent::globalY() const
|
||||||
@ -69,7 +69,7 @@ int QmlWheelEvent::globalY() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return m_wheelEvent->globalY();
|
return m_wheelEvent->globalPosition().toPoint().x();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlWheelEvent::inverted() const
|
bool QmlWheelEvent::inverted() const
|
||||||
@ -101,7 +101,7 @@ QPoint QmlWheelEvent::pos() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return QPoint(-1, -1);
|
return QPoint(-1, -1);
|
||||||
}
|
}
|
||||||
return m_wheelEvent->pos();
|
return m_wheelEvent->position().toPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF QmlWheelEvent::posF() const
|
QPointF QmlWheelEvent::posF() const
|
||||||
@ -109,7 +109,7 @@ QPointF QmlWheelEvent::posF() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return QPointF(-1, -1);
|
return QPointF(-1, -1);
|
||||||
}
|
}
|
||||||
return m_wheelEvent->posF();
|
return m_wheelEvent->position();
|
||||||
}
|
}
|
||||||
|
|
||||||
int QmlWheelEvent::source() const
|
int QmlWheelEvent::source() const
|
||||||
@ -125,7 +125,7 @@ int QmlWheelEvent::x() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return m_wheelEvent->x();
|
return m_wheelEvent->position().toPoint().x();
|
||||||
}
|
}
|
||||||
|
|
||||||
int QmlWheelEvent::y() const
|
int QmlWheelEvent::y() const
|
||||||
@ -133,7 +133,7 @@ int QmlWheelEvent::y() const
|
|||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return m_wheelEvent->y();
|
return m_wheelEvent->position().toPoint().y();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlWheelEvent::clear()
|
void QmlWheelEvent::clear()
|
||||||
|
@ -386,5 +386,5 @@ void QmlPluginInterface::setAcceptNavigationRequest(const QJSValue &acceptNaviga
|
|||||||
|
|
||||||
QQmlListProperty<QObject> QmlPluginInterface::childItems()
|
QQmlListProperty<QObject> QmlPluginInterface::childItems()
|
||||||
{
|
{
|
||||||
return QQmlListProperty<QObject>(this, m_childItems);
|
return QQmlListProperty<QObject>(this, &m_childItems);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
QString WebPage::s_lastUploadLocation = QDir::homePath();
|
QString WebPage::s_lastUploadLocation = QDir::homePath();
|
||||||
QUrl WebPage::s_lastUnsupportedUrl;
|
QUrl WebPage::s_lastUnsupportedUrl;
|
||||||
QTime WebPage::s_lastUnsupportedUrlTime;
|
QElapsedTimer WebPage::s_lastUnsupportedUrlTime;
|
||||||
QStringList s_supportedSchemes;
|
QStringList s_supportedSchemes;
|
||||||
|
|
||||||
static const bool kEnableJsOutput = qEnvironmentVariableIsSet("FALKON_ENABLE_JS_OUTPUT");
|
static const bool kEnableJsOutput = qEnvironmentVariableIsSet("FALKON_ENABLE_JS_OUTPUT");
|
||||||
@ -365,7 +365,7 @@ void WebPage::desktopServicesOpen(const QUrl &url)
|
|||||||
// Open same url only once in 2 secs
|
// Open same url only once in 2 secs
|
||||||
const int sameUrlTimeout = 2 * 1000;
|
const int sameUrlTimeout = 2 * 1000;
|
||||||
|
|
||||||
if (s_lastUnsupportedUrl != url || s_lastUnsupportedUrlTime.isNull() || s_lastUnsupportedUrlTime.elapsed() > sameUrlTimeout) {
|
if ((s_lastUnsupportedUrl != url) || (!s_lastUnsupportedUrlTime.isValid()) || (s_lastUnsupportedUrlTime.elapsed() > sameUrlTimeout)) {
|
||||||
s_lastUnsupportedUrl = url;
|
s_lastUnsupportedUrl = url;
|
||||||
s_lastUnsupportedUrlTime.restart();
|
s_lastUnsupportedUrlTime.restart();
|
||||||
QDesktopServices::openUrl(url);
|
QDesktopServices::openUrl(url);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <QWebEngineScript>
|
#include <QWebEngineScript>
|
||||||
#include <QWebEngineFullScreenRequest>
|
#include <QWebEngineFullScreenRequest>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
|
|
||||||
@ -104,7 +105,7 @@ private:
|
|||||||
|
|
||||||
static QString s_lastUploadLocation;
|
static QString s_lastUploadLocation;
|
||||||
static QUrl s_lastUnsupportedUrl;
|
static QUrl s_lastUnsupportedUrl;
|
||||||
static QTime s_lastUnsupportedUrlTime;
|
static QElapsedTimer s_lastUnsupportedUrlTime;
|
||||||
|
|
||||||
DelayedFileWatcher* m_fileWatcher;
|
DelayedFileWatcher* m_fileWatcher;
|
||||||
QEventLoop* m_runningLoop;
|
QEventLoop* m_runningLoop;
|
||||||
|
@ -1055,9 +1055,9 @@ void WebView::_wheelEvent(QWheelEvent *event)
|
|||||||
if (event->spontaneous()) {
|
if (event->spontaneous()) {
|
||||||
const qreal multiplier = QApplication::wheelScrollLines() / 3.0;
|
const qreal multiplier = QApplication::wheelScrollLines() / 3.0;
|
||||||
if (multiplier != 1.0) {
|
if (multiplier != 1.0) {
|
||||||
QWheelEvent e(event->pos(), event->globalPos(), event->pixelDelta(),
|
QWheelEvent e(event->position(), event->globalPosition(), event->pixelDelta(),
|
||||||
event->angleDelta() * multiplier, 0, Qt::Horizontal, event->buttons(),
|
event->angleDelta() * multiplier, event->buttons(),
|
||||||
event->modifiers(), event->phase(), event->source(), event->inverted());
|
event->modifiers(), event->phase(), event->inverted(), event->source());
|
||||||
QApplication::sendEvent(m_rwhvqt, &e);
|
QApplication::sendEvent(m_rwhvqt, &e);
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ QVector<PasswordEntry> KWalletPasswordBackend::getEntries(const QUrl &url)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sort to prefer last updated entries
|
// Sort to prefer last updated entries
|
||||||
qSort(list.begin(), list.end());
|
std::sort(list.begin(), list.end());
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -452,7 +452,7 @@ void TabManagerWidget::processActions()
|
|||||||
|
|
||||||
m_refreshBlocked = true;
|
m_refreshBlocked = true;
|
||||||
|
|
||||||
QHash<BrowserWindow*, WebTab*> selectedTabs;
|
QMultiHash<BrowserWindow*, WebTab*> selectedTabs;
|
||||||
|
|
||||||
const QString &command = sender()->objectName();
|
const QString &command = sender()->objectName();
|
||||||
|
|
||||||
@ -477,7 +477,7 @@ void TabManagerWidget::processActions()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedTabs.insertMulti(mainWindow, webTab);
|
selectedTabs.insert(mainWindow, webTab);
|
||||||
}
|
}
|
||||||
winItem->setCheckState(0, Qt::Unchecked);
|
winItem->setCheckState(0, Qt::Unchecked);
|
||||||
}
|
}
|
||||||
@ -518,7 +518,7 @@ void TabManagerWidget::changeGroupType()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabManagerWidget::closeSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash)
|
void TabManagerWidget::closeSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash)
|
||||||
{
|
{
|
||||||
if (tabsHash.isEmpty()) {
|
if (tabsHash.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@ -534,7 +534,7 @@ void TabManagerWidget::closeSelectedTabs(const QHash<BrowserWindow*, WebTab*> &t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void detachTabsTo(BrowserWindow* targetWindow, const QHash<BrowserWindow*, WebTab*> &tabsHash)
|
static void detachTabsTo(BrowserWindow* targetWindow, const QMultiHash<BrowserWindow*, WebTab*> &tabsHash)
|
||||||
{
|
{
|
||||||
const QList<BrowserWindow*> &windows = tabsHash.uniqueKeys();
|
const QList<BrowserWindow*> &windows = tabsHash.uniqueKeys();
|
||||||
for (BrowserWindow* mainWindow : windows) {
|
for (BrowserWindow* mainWindow : windows) {
|
||||||
@ -552,7 +552,7 @@ static void detachTabsTo(BrowserWindow* targetWindow, const QHash<BrowserWindow*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabManagerWidget::detachSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash)
|
void TabManagerWidget::detachSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash)
|
||||||
{
|
{
|
||||||
if (tabsHash.isEmpty() ||
|
if (tabsHash.isEmpty() ||
|
||||||
(tabsHash.uniqueKeys().size() == 1 &&
|
(tabsHash.uniqueKeys().size() == 1 &&
|
||||||
@ -566,7 +566,7 @@ void TabManagerWidget::detachSelectedTabs(const QHash<BrowserWindow*, WebTab*> &
|
|||||||
detachTabsTo(newWindow, tabsHash);
|
detachTabsTo(newWindow, tabsHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TabManagerWidget::bookmarkSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash)
|
bool TabManagerWidget::bookmarkSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash)
|
||||||
{
|
{
|
||||||
auto* dialog = new QDialog(getWindow(), Qt::WindowStaysOnTopHint | Qt::MSWindowsFixedSizeDialogHint);
|
auto* dialog = new QDialog(getWindow(), Qt::WindowStaysOnTopHint | Qt::MSWindowsFixedSizeDialogHint);
|
||||||
auto* layout = new QBoxLayout(QBoxLayout::TopToBottom, dialog);
|
auto* layout = new QBoxLayout(QBoxLayout::TopToBottom, dialog);
|
||||||
@ -608,7 +608,7 @@ bool TabManagerWidget::bookmarkSelectedTabs(const QHash<BrowserWindow*, WebTab*>
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabManagerWidget::unloadSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash)
|
void TabManagerWidget::unloadSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash)
|
||||||
{
|
{
|
||||||
if (tabsHash.isEmpty()) {
|
if (tabsHash.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@ -951,7 +951,7 @@ bool TabTreeWidget::dropMimeData(QTreeWidgetItem *parent, int index, const QMime
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!webTab->isPinned()) {
|
else if (!webTab->isPinned()) {
|
||||||
QHash<BrowserWindow*, WebTab*> tabsHash;
|
QMultiHash<BrowserWindow*, WebTab*> tabsHash;
|
||||||
tabsHash.insert(window, webTab);
|
tabsHash.insert(window, webTab);
|
||||||
|
|
||||||
detachTabsTo(targetWindow, tabsHash);
|
detachTabsTo(targetWindow, tabsHash);
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QHash>
|
#include <QMultiHash>
|
||||||
#include <QTreeWidgetItem>
|
#include <QTreeWidgetItem>
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
@ -68,10 +68,10 @@ public:
|
|||||||
explicit TabManagerWidget(BrowserWindow* mainClass, QWidget* parent = 0, bool defaultWidget = false);
|
explicit TabManagerWidget(BrowserWindow* mainClass, QWidget* parent = 0, bool defaultWidget = false);
|
||||||
~TabManagerWidget() override;
|
~TabManagerWidget() override;
|
||||||
|
|
||||||
void closeSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash);
|
void closeSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash);
|
||||||
void detachSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash);
|
void detachSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash);
|
||||||
bool bookmarkSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash);
|
bool bookmarkSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash);
|
||||||
void unloadSelectedTabs(const QHash<BrowserWindow*, WebTab*> &tabsHash);
|
void unloadSelectedTabs(const QMultiHash<BrowserWindow*, WebTab*> &tabsHash);
|
||||||
|
|
||||||
void setGroupType(GroupType type);
|
void setGroupType(GroupType type);
|
||||||
|
|
||||||
|
@ -321,12 +321,12 @@ bool TLDExtractor::parseData(const QString &dataFile, bool loadPrivateDomains)
|
|||||||
line = line.left(line.indexOf(QLatin1Char(' ')));
|
line = line.left(line.indexOf(QLatin1Char(' ')));
|
||||||
|
|
||||||
if (!line.contains(QLatin1Char('.'))) {
|
if (!line.contains(QLatin1Char('.'))) {
|
||||||
m_tldHash.insertMulti(line, line);
|
m_tldHash.insert(line, line);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString key = line.mid(line.lastIndexOf(QLatin1Char('.')) + 1);
|
QString key = line.mid(line.lastIndexOf(QLatin1Char('.')) + 1);
|
||||||
|
|
||||||
m_tldHash.insertMulti(key, line);
|
m_tldHash.insert(key, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user