Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akregator
Commits
307dde7b
Commit
307dde7b
authored
Mar 27, 2021
by
Tomáš Trnka
Committed by
Laurent Montel
Apr 11, 2021
Browse files
Avoid accidentally generating reserved values of feed IDs
parent
2f6d4e23
Pipeline
#57633
canceled with stage
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/feed/feedlist.cpp
View file @
307dde7b
...
...
@@ -18,6 +18,7 @@
#include "kernel.h"
#include "subscriptionlistjobs.h"
#include <KLocalizedString>
#include <limits>
#include <memory>
#include <QElapsedTimer>
...
...
@@ -436,7 +437,8 @@ void FeedList::setRootNode(Folder *folder)
uint
FeedList
::
generateID
()
const
{
return
QRandomGenerator
::
global
()
->
generate
();
// The values 0 and 1 are reserved, see TreeNode::id()
return
QRandomGenerator
::
global
()
->
bounded
(
2u
,
std
::
numeric_limits
<
quint32
>::
max
());
}
void
FeedList
::
slotNodeAdded
(
TreeNode
*
node
)
...
...
Tomáš Trnka
@ttrnka
mentioned in commit
8464df3a
·
Apr 11, 2021
mentioned in commit
8464df3a
mentioned in commit 8464df3a6a4062b07a5477e04d8526bccded0813
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment