Skip to content

Commit 18dda34

Browse files
committed
Resolve use of QMap::insertMulti for Qt 6
1 parent 0bc3f2b commit 18dda34

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

src/svn.cpp

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,11 @@ int SvnRevision::prepareTransactions()
493493
apr_hash_t *changes;
494494
SVN_ERR(svn_fs_paths_changed2(&changes, fs_root, pool));
495495

496+
#if QT_VERSION >= 0x060000
497+
QMultiMap<QByteArray, svn_fs_path_change2_t*> map;
498+
#else
496499
QMap<QByteArray, svn_fs_path_change2_t*> map;
500+
#endif
497501
for (apr_hash_index_t *i = apr_hash_first(pool, changes); i; i = apr_hash_next(i)) {
498502
const void *vkey;
499503
void *value;
@@ -513,10 +517,18 @@ int SvnRevision::prepareTransactions()
513517
fflush(stderr);
514518
exit(1);
515519
}
520+
#if QT_VERSION >= 0x060000
521+
map.insert(QByteArray(key), change);
522+
#else
516523
map.insertMulti(QByteArray(key), change);
524+
#endif
517525
}
518526

527+
#if QT_VERSION >= 0x060000
528+
QMultiMapIterator<QByteArray, svn_fs_path_change2_t*> i(map);
529+
#else
519530
QMapIterator<QByteArray, svn_fs_path_change2_t*> i(map);
531+
#endif
520532
while (i.hasNext()) {
521533
i.next();
522534
if (exportEntry(i.key(), i.value(), changes) == EXIT_FAILURE)
@@ -991,16 +1003,28 @@ int SvnRevision::recursiveDumpDir(Repository::Transaction *txn, svn_fs_t *fs, sv
9911003

9921004
// While we get a hash, put it in a map for sorted lookup, so we can
9931005
// repeat the conversions and get the same git commit hashes.
1006+
#if QT_VERSION >= 0x060000
1007+
QMultiMap<QByteArray, svn_node_kind_t> map;
1008+
#else
9941009
QMap<QByteArray, svn_node_kind_t> map;
1010+
#endif
9951011
for (apr_hash_index_t *i = apr_hash_first(pool, entries); i; i = apr_hash_next(i)) {
9961012
const void *vkey;
9971013
void *value;
9981014
apr_hash_this(i, &vkey, NULL, &value);
9991015
svn_fs_dirent_t *dirent = reinterpret_cast<svn_fs_dirent_t *>(value);
1016+
#if QT_VERSION >= 0x060000
1017+
map.insert(QByteArray(dirent->name), dirent->kind);
1018+
#else
10001019
map.insertMulti(QByteArray(dirent->name), dirent->kind);
1020+
#endif
10011021
}
10021022

1023+
#if QT_VERSION >= 0x060000
1024+
QMultiMapIterator<QByteArray, svn_node_kind_t> i(map);
1025+
#else
10031026
QMapIterator<QByteArray, svn_node_kind_t> i(map);
1027+
#endif
10041028
while (i.hasNext()) {
10051029
dirpool.clear();
10061030
i.next();
@@ -1059,17 +1083,29 @@ int SvnRevision::recurse(const char *path, const svn_fs_path_change2_t *change,
10591083

10601084
// While we get a hash, put it in a map for sorted lookup, so we can
10611085
// repeat the conversions and get the same git commit hashes.
1086+
#if QT_VERSION >= 0x060000
1087+
QMultiMap<QByteArray, svn_node_kind_t> map;
1088+
#else
10621089
QMap<QByteArray, svn_node_kind_t> map;
1090+
#endif
10631091
for (apr_hash_index_t *i = apr_hash_first(pool, entries); i; i = apr_hash_next(i)) {
10641092
dirpool.clear();
10651093
const void *vkey;
10661094
void *value;
10671095
apr_hash_this(i, &vkey, NULL, &value);
10681096
svn_fs_dirent_t *dirent = reinterpret_cast<svn_fs_dirent_t *>(value);
1097+
#if QT_VERSION >= 0x060000
1098+
map.insert(QByteArray(dirent->name), dirent->kind);
1099+
#else
10691100
map.insertMulti(QByteArray(dirent->name), dirent->kind);
1101+
#endif
10701102
}
10711103

1104+
#if QT_VERSION >= 0x060000
1105+
QMultiMapIterator<QByteArray, svn_node_kind_t> i(map);
1106+
#else
10721107
QMapIterator<QByteArray, svn_node_kind_t> i(map);
1108+
#endif
10731109
while (i.hasNext()) {
10741110
dirpool.clear();
10751111
i.next();
@@ -1286,17 +1322,27 @@ int SvnRevision::addGitIgnoreOnBranch(apr_pool_t *pool, QString key, QString pat
12861322
if (svn_fs_dir_entries(&entries, fs_root, key.toStdString().c_str(), pool) != SVN_NO_ERROR) {
12871323
return EXIT_FAILURE;
12881324
}
1289-
1325+
#if QT_VERSION >= 0x060000
1326+
QMultiMap<QByteArray, svn_node_kind_t> map;
1327+
#else
12901328
QMap<QByteArray, svn_node_kind_t> map;
1329+
#endif
12911330
for (apr_hash_index_t *i = apr_hash_first(pool, entries); i; i = apr_hash_next(i)) {
12921331
const void *vkey;
12931332
void *value;
12941333
apr_hash_this(i, &vkey, NULL, &value);
12951334
svn_fs_dirent_t *dirent = reinterpret_cast<svn_fs_dirent_t *>(value);
1335+
#if QT_VERSION >= 0x060000
1336+
map.insert(QByteArray(dirent->name), dirent->kind);
1337+
#else
12961338
map.insertMulti(QByteArray(dirent->name), dirent->kind);
1339+
#endif
12971340
}
1298-
1341+
#if QT_VERSION >= 0x060000
1342+
QMultiMapIterator<QByteArray, svn_node_kind_t> i(map);
1343+
#else
12991344
QMapIterator<QByteArray, svn_node_kind_t> i(map);
1345+
#endif
13001346
while (i.hasNext()) {
13011347
i.next();
13021348
QString entryName = key + "/" + i.key();

0 commit comments

Comments
 (0)