Commit 06a013de authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix compile against qt6

parent 66131a99
......@@ -91,9 +91,14 @@ static bool askUser(const QString &filename, bool &readonly)
int main(int argc, char **argv)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication app(argc, argv);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// enable high dpi support
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#endif
Kdelibs4ConfigMigrator migrate(QStringLiteral("keditbookmarks"));
migrate.setConfigFiles(QStringList() << QStringLiteral("keditbookmarksrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("keditbookmarksuirc"));
......@@ -150,10 +155,6 @@ int main(int argc, char **argv)
|| parser.isSet(QStringLiteral("importkde3")) || parser.isSet(QStringLiteral("importgaleon")));
const bool browser = !parser.isSet(QStringLiteral("nobrowser"));
// enable high dpi support
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
const bool gotFilenameArg = (parser.positionalArguments().count() == 1);
QString filename = gotFilenameArg ? parser.positionalArguments().at(0)
......
......@@ -308,10 +308,18 @@ static bool lessAddress(const QString &first, const QString &second)
uint bNext = b.indexOf(QLatin1String("/"), bLast + 1);
bool okay;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
uint aNum = a.midRef(aLast + 1, aNext - aLast - 1).toUInt(&okay);
#else
uint aNum = QStringView(a).mid(aLast + 1, aNext - aLast - 1).toUInt(&okay);
#endif
if (!okay)
return false;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
uint bNum = b.midRef(bLast + 1, bNext - bLast - 1).toUInt(&okay);
#else
uint bNum = QStringView(b).mid(bLast + 1, bNext - bLast - 1).toUInt(&okay);
#endif
if (!okay)
return true;
......
Markdown is supported
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