@@ -408,7 +408,7 @@ void DBManager::recalculateChildNotesCount()
408
408
qDebug () << __FUNCTION__ << __LINE__ << query.lastError ();
409
409
}
410
410
query.clear ();
411
- for (const auto &id : qAsConst (tagIds)) {
411
+ for (const auto &id : std::as_const (tagIds)) {
412
412
query.prepare (" SELECT count(*) FROM tag_relationship WHERE tag_id=:id" );
413
413
query.bindValue (QStringLiteral (" :id" ), id);
414
414
status = query.exec ();
@@ -925,7 +925,7 @@ QList<NodeData> DBManager::readOldNBK(const QString &fileName)
925
925
// notified
926
926
}
927
927
if (!nl.isEmpty ()) {
928
- for (const auto &n : qAsConst (nl)) {
928
+ for (const auto &n : std::as_const (nl)) {
929
929
noteList.append (*n);
930
930
}
931
931
}
@@ -1175,14 +1175,14 @@ void DBManager::moveNode(int nodeId, const NodeData &target)
1175
1175
&& target.id () == SpecialNodeID::TrashFolder) {
1176
1176
decreaseChildNotesCountFolder (SpecialNodeID::RootFolder);
1177
1177
auto allTagInNote = getAllTagForNote (node.id ());
1178
- for (const auto &tagId : qAsConst (allTagInNote)) {
1178
+ for (const auto &tagId : std::as_const (allTagInNote)) {
1179
1179
decreaseChildNotesCountTag (tagId);
1180
1180
}
1181
1181
} else if (node.parentId () == SpecialNodeID::TrashFolder
1182
1182
&& target.id () != SpecialNodeID::TrashFolder) {
1183
1183
increaseChildNotesCountFolder (SpecialNodeID::RootFolder);
1184
1184
auto allTagInNote = getAllTagForNote (node.id ());
1185
- for (const auto &tagId : qAsConst (allTagInNote)) {
1185
+ for (const auto &tagId : std::as_const (allTagInNote)) {
1186
1186
increaseChildNotesCountTag (tagId);
1187
1187
}
1188
1188
}
@@ -1325,7 +1325,7 @@ void DBManager::searchForNotes(const QString &keyword, const ListViewInfo &inf)
1325
1325
nds_id = i;
1326
1326
}
1327
1327
}
1328
- for (const int id : qAsConst (nds[nds_id])) {
1328
+ for (const int id : std::as_const (nds[nds_id])) {
1329
1329
bool ok = true ;
1330
1330
for (int i = 0 ; i < nds.size (); ++i) {
1331
1331
if (i == nds_id) {
@@ -1680,7 +1680,7 @@ void DBManager::onNotesListInTagsRequested(const QSet<int> &tagIds, bool newNote
1680
1680
nds_id = i;
1681
1681
}
1682
1682
}
1683
- for (const int id : qAsConst (nds[nds_id])) {
1683
+ for (const int id : std::as_const (nds[nds_id])) {
1684
1684
bool ok = true ;
1685
1685
for (int i = 0 ; i < nds.size (); ++i) {
1686
1686
if (i == nds_id) {
@@ -1784,7 +1784,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
1784
1784
out_qr.finish ();
1785
1785
std::sort (tagList.begin (), tagList.end (),
1786
1786
[](auto a, auto b) { return a.relativePosition () < b.relativePosition (); });
1787
- for (const auto &tag : qAsConst (tagList)) {
1787
+ for (const auto &tag : std::as_const (tagList)) {
1788
1788
QSqlQuery qr (m_db);
1789
1789
qr.prepare (R"( SELECT "id" FROM tag_table WHERE name = :name AND color = :color;)" );
1790
1790
qr.bindValue (QStringLiteral (" :name" ), tag.name ());
@@ -1877,7 +1877,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
1877
1877
}
1878
1878
} else {
1879
1879
auto prL = NodePath (node.absolutePath ()).separate ();
1880
- for (const auto &pr : qAsConst (prL)) {
1880
+ for (const auto &pr : std::as_const (prL)) {
1881
1881
matchFolderFunctor (pr.toInt (), matchFolderFunctor);
1882
1882
}
1883
1883
}
@@ -1891,7 +1891,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
1891
1891
};
1892
1892
Folder *rootFolder = nullptr ;
1893
1893
QHash<int , Folder> needImportFolderMap;
1894
- for (const auto &node : qAsConst (nodeList)) {
1894
+ for (const auto &node : std::as_const (nodeList)) {
1895
1895
Folder f;
1896
1896
f.id = node.id ();
1897
1897
f.parentId = node.parentId ();
@@ -1901,7 +1901,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
1901
1901
}
1902
1902
}
1903
1903
if (rootFolder) {
1904
- for (const auto &folder : qAsConst (needImportFolderMap)) {
1904
+ for (const auto &folder : std::as_const (needImportFolderMap)) {
1905
1905
if (folder.id != SpecialNodeID::RootFolder) {
1906
1906
needImportFolderMap[folder.parentId ].children .push_back (
1907
1907
&needImportFolderMap[folder.id ]);
@@ -1930,7 +1930,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
1930
1930
matchFunc (rootFolder, matchFunc);
1931
1931
} else {
1932
1932
qDebug () << __FUNCTION__ << " Error while keeping folder position" ;
1933
- for (const auto &node : qAsConst (nodeList)) {
1933
+ for (const auto &node : std::as_const (nodeList)) {
1934
1934
matchFolderFunc (node.id (), matchFolderFunc);
1935
1935
}
1936
1936
}
@@ -1960,7 +1960,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
1960
1960
bool status = out_qr.exec ();
1961
1961
QVector<NodeData> nodeList;
1962
1962
QMap<int , std::pair<NodeData, int >> parents;
1963
- for (const auto &id : qAsConst (folderIdMap)) {
1963
+ for (const auto &id : std::as_const (folderIdMap)) {
1964
1964
if (parents.contains (id)) {
1965
1965
continue ;
1966
1966
}
@@ -1993,7 +1993,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
1993
1993
}
1994
1994
m_db.transaction ();
1995
1995
auto nodeId = nextAvailableNodeId ();
1996
- for (auto node : qAsConst (nodeList)) {
1996
+ for (auto node : std::as_const (nodeList)) {
1997
1997
if (folderIdMap.contains (node.parentId ())
1998
1998
&& parents.contains (folderIdMap[node.parentId ()])) {
1999
1999
auto parentId = folderIdMap[node.parentId ()];
@@ -2035,7 +2035,7 @@ void DBManager::onImportNotesRequested(const QString &fileName)
2035
2035
std::make_pair (out_qr.value (0 ).toInt (), out_qr.value (1 ).toInt ()));
2036
2036
}
2037
2037
m_db.transaction ();
2038
- for (const auto &rel : qAsConst (tagRela)) {
2038
+ for (const auto &rel : std::as_const (tagRela)) {
2039
2039
if (tagIdMap.contains (rel.first ) && noteIdMap.contains (rel.second )) {
2040
2040
addNoteToTag (noteIdMap[rel.second ], tagIdMap[rel.first ]);
2041
2041
} else {
0 commit comments