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
8464df3a
Commit
8464df3a
authored
Mar 27, 2021
by
Tomáš Trnka
Committed by
Laurent Montel
Apr 11, 2021
Browse files
Avoid accidentally generating reserved values of feed IDs
(cherry picked from commit
307dde7b
)
parent
546db721
Pipeline
#57634
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/feed/feedlist.cpp
View file @
8464df3a
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
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