Commit 322ed800 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to build against qt6

parent ce7873ca
Pipeline #190237 passed with stage
in 1 minute
......@@ -53,6 +53,7 @@
#include <QTimer>
#include <QToolBar>
#include <QVBoxLayout>
#include <QRegularExpression>
MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent),
......@@ -224,7 +225,8 @@ QUrl MainWindow::getInputUrl()
QString userInput = m_addressInput->text();
qCDebug(KRDC) << "input url " << userInput;
// percent encode usernames so QUrl can parse it
int lastAtIndex = userInput.indexOf(QRegExp(QStringLiteral("@[^@]+$")));
static QRegularExpression reg(QStringLiteral("@[^@]+$"));
int lastAtIndex = userInput.indexOf(reg);
if (lastAtIndex >0) {
userInput = QString::fromLatin1(QUrl::toPercentEncoding(userInput.left(lastAtIndex))) + userInput.mid(lastAtIndex);
qCDebug(KRDC) << "input url " << userInput;
......
......@@ -229,11 +229,11 @@ void RemoteDesktopsModel::buildModelFromBookmarkGroup(const KBookmarkGroup &grou
QDateTime created = QDateTime();
bool ok = false;
// first the created datetime
created.setTime_t(bm.metaDataItem(QLatin1String("time_added")).toLongLong(&ok));
created = QDateTime::fromMSecsSinceEpoch(bm.metaDataItem(QLatin1String("time_added")).toLongLong(&ok));
if (ok) (newItem ? item : remoteDesktops[index]).created = created;
// then the last visited datetime
ok = false;
connected.setTime_t(bm.metaDataItem(QLatin1String("time_visited")).toLongLong(&ok));
connected = QDateTime::fromMSecsSinceEpoch(bm.metaDataItem(QLatin1String("time_visited")).toLongLong(&ok));
if (ok) (newItem ? item : remoteDesktops[index]).lastConnected = connected;
// finally the visited count
ok = false;
......
......@@ -7,6 +7,7 @@
#include "tabbedviewwidget.h"
#include "krdc_debug.h"
#include <QRegularExpression>
#include <QTabBar>
TabbedViewWidgetModel::TabbedViewWidgetModel(QTabWidget *modelTarget)
......@@ -63,8 +64,10 @@ QVariant TabbedViewWidgetModel::data(const QModelIndex &index, int role) const
switch (role) {
case Qt::EditRole:
case Qt::DisplayRole:
return m_tabWidget->tabText(index.row()).remove(QRegExp(QLatin1String("&(?!&)"))); //remove accelerator string
case Qt::DisplayRole: {
static QRegularExpression reg(QStringLiteral("&(?!&)"));
return m_tabWidget->tabText(index.row()).remove(reg); //remove accelerator string
}
case Qt::ToolTipRole:
return m_tabWidget->tabToolTip(index.row());
case Qt::DecorationRole:
......
......@@ -118,7 +118,7 @@ void VncClientThread::cursorShapeHandlerStatic(rfbClient *cl, int xhot, int yhot
QPixmap cursorPixmap(QPixmap::fromImage(cursorImg));
cursorPixmap.setMask(QBitmap::fromImage(alpha));
Q_EMIT t->gotCursor({cursorPixmap, xhot, yhot});
Q_EMIT t->gotCursor(QCursor{cursorPixmap, xhot, yhot});
}
void VncClientThread::setClientColorDepth(rfbClient* cl, VncClientThread::ColorDepth cd)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment