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

Fix and re-enable remaining plugins.

This commit is contained in:
Tiernan Hubble 2023-04-10 19:17:16 -06:00 committed by Juraj Oravec
parent 73554c230b
commit 0152a9cdeb
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
6 changed files with 32 additions and 4 deletions

View File

@ -6,8 +6,8 @@ add_subdirectory(GreaseMonkey)
add_subdirectory(MouseGestures)
add_subdirectory(PIM)
add_subdirectory(StatusBarIcons)
## TODO QT6 ## add_subdirectory(TabManager)
## TODO QT6 ## add_subdirectory(VerticalTabs)
add_subdirectory(TabManager)
add_subdirectory(VerticalTabs)
if (GNOME_KEYRING_FOUND)
add_subdirectory(GnomeKeyringPasswords)

View File

@ -97,7 +97,7 @@ void TabManagerDelegate::paint(QPainter* painter, const QStyleOptionViewItem &op
opt2.state |= QStyle::State_On;
break;
}
style->drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w);
style->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &opt2, painter, w);
}
// draw the icon
@ -244,7 +244,11 @@ void TabManagerDelegate::viewItemDrawText(QPainter *p, const QStyleOptionViewIte
highlightParts << highlightedPart;
}
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
textLayout.setAdditionalFormats(highlightParts);
#else
textLayout.setFormats(highlightParts);
#endif
}
}

View File

@ -44,6 +44,10 @@
#include <QLabel>
#include <QMimeData>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QRegExp>
#endif
TLDExtractor* TabManagerWidget::s_tldExtractor = 0;
@ -124,7 +128,11 @@ QString TabManagerWidget::domainFromUrl(const QUrl &url, bool useHostName)
return urlString.append(appendString);
}
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
if (useHostName || host.contains(QRegExp(R"(^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)"))) {
#else
if (useHostName || QRegExp(R"(^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)").indexIn(host) >= 0) {
#endif
if (host.startsWith("www.", Qt::CaseInsensitive)) {
host.remove(0, 4);
}
@ -758,7 +766,7 @@ TabItem::TabItem(QTreeWidget* treeWidget, bool supportDrag, bool isTab, QTreeWid
, m_webTab(0)
, m_isTab(isTab)
{
Qt::ItemFlags flgs = flags() | (parent ? Qt::ItemIsUserCheckable : Qt::ItemIsUserCheckable | Qt::ItemIsTristate);
Qt::ItemFlags flgs = flags() | (parent ? Qt::ItemIsUserCheckable : Qt::ItemIsUserCheckable | Qt::ItemIsAutoTristate);
if (supportDrag) {
if (isTab) {

View File

@ -27,6 +27,8 @@
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
#include <QDesktopWidget>
#else
#include <QScreen>
#endif
#include <QAction>
#include <QStyle>

View File

@ -23,6 +23,10 @@
#include <QMessageBox>
#include <QUrl>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include <QRegExp>
#endif
TLDExtractor* TLDExtractor::s_instance = 0;
TLDExtractor::TLDExtractor(QObject* parent)
@ -384,7 +388,11 @@ bool TLDExtractor::test()
continue;
}
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
line.indexOf(testRegExp);
#else
testRegExp.indexIn(line);
#endif
const QString hostName = testRegExp.cap(2);
const QString registrableName = testRegExp.cap(4);

View File

@ -240,5 +240,11 @@ void TabListView::updateVisibility()
void TabListView::updateHeight()
{
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
setFixedHeight(m_delegate->sizeHint(viewOptions(), QModelIndex()).height());
#else
QStyleOptionViewItem option;
initViewItemOption(&option);
setFixedHeight(m_delegate->sizeHint(option, QModelIndex()).height());
#endif
}