Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Datovka projects
mobile Datovka
Commits
081138ac
Commit
081138ac
authored
Oct 17, 2017
by
Karel Slaný
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added DataboxListModel::allEntries().
parent
1358c874
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
src/models/databoxmodel.cpp
src/models/databoxmodel.cpp
+19
-0
src/models/databoxmodel.h
src/models/databoxmodel.h
+7
-0
No files found.
src/models/databoxmodel.cpp
View file @
081138ac
...
...
@@ -247,6 +247,25 @@ QVariant DataboxListModel::data(const QModelIndex &index, int role) const
return
QVariant
();
}
QList
<
DataboxModelEntry
>
DataboxListModel
::
allEntries
(
void
)
const
{
QList
<
DataboxModelEntry
>
entries
;
foreach
(
const
QString
&
boxId
,
m_boxIds
)
{
QMap
<
QString
,
InternalEntry
>::
const_iterator
it
=
m_entries
.
find
(
boxId
);
if
(
Q_UNLIKELY
(
it
==
m_entries
.
end
()))
{
continue
;
}
if
(
Q_UNLIKELY
(
it
->
entry
.
dbID
().
isEmpty
()))
{
continue
;
}
entries
.
append
(
it
->
entry
);
}
return
entries
;
}
bool
DataboxListModel
::
addEntry
(
const
DataboxModelEntry
&
entry
)
{
const
QString
key
(
entry
.
dbID
());
...
...
src/models/databoxmodel.h
View file @
081138ac
...
...
@@ -196,6 +196,13 @@ public:
virtual
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
Q_DECL_OVERRIDE
;
/*!
* @brief Return list of all entries.
*
* @return List of all entries.
*/
QList
<
DataboxModelEntry
>
allEntries
(
void
)
const
;
/*!
* @brief Add data-box entry into model.
*
...
...
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