Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow build with qt6 #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

neochapay
Copy link

No description provided.

tests/common.h Show resolved Hide resolved
src/event.cpp Show resolved Hide resolved
@@ -1059,7 +1059,7 @@ bool DatabaseIO::getGroups(const QString &localUid, const QString &remoteUid, QL
if (!remoteUid.isEmpty())
q += "Groups.remoteUids = :remoteUid ";
}
q += "GROUP BY Groups.id " + queryOrder;
q += QString("GROUP BY Groups.id " + queryOrder).toUtf8();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to create a string from the whole thing, and better if not needing to use QString(char*). Just do "... + queryOrder.toUtf8()".

@@ -36,7 +36,11 @@ void RecipientEventModelTest::initTestCase()
{
initTestDatabase();

qsrand(QDateTime::currentDateTime().toTime_t());
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
srand( QDateTime::currentDateTime().toSecsSinceEpoch() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why seed srand() since rand() isn't used here? If Qt api is used for random number, qt api should be seeded.

Same issue on multiple places.

bool randomRemote = true;
if (arguments.count() > 3) {
remoteUid = arguments.at(3);
randomRemote = false;
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QRandomGenerator qrand;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid qrand as name since that's used on qt side too. But then again I don't think there's need to declare such an instance at all, could instead just use "QRandomGenerator::global()->generate()" instead of qrand()?

Applies to lot of places.

@@ -21,5 +21,6 @@
###############################################################################

TEMPLATE = subdirs
CONFIG += ORDERED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor

@pvuorela pvuorela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking as needing changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants