Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0dcb637

Browse files
committed
Resolve use of QMap::insertMulti for Qt 6
1 parent 205d7fc commit 0dcb637

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

‎src/svn.cpp

Lines changed: 48 additions & 0 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();
@@ -1287,16 +1323,28 @@ int SvnRevision::addGitIgnoreOnBranch(apr_pool_t *pool, QString key, QString pat
12871323
return EXIT_FAILURE;
12881324
}
12891325

1326+
#if QT_VERSION >= 0x060000
1327+
QMultiMap<QByteArray, svn_node_kind_t> map;
1328+
#else
12901329
QMap<QByteArray, svn_node_kind_t> map;
1330+
#endif
12911331
for (apr_hash_index_t *i = apr_hash_first(pool, entries); i; i = apr_hash_next(i)) {
12921332
const void *vkey;
12931333
void *value;
12941334
apr_hash_this(i, &vkey, NULL, &value);
12951335
svn_fs_dirent_t *dirent = reinterpret_cast<svn_fs_dirent_t *>(value);
1336+
#if QT_VERSION >= 0x060000
1337+
map.insert(QByteArray(dirent->name), dirent->kind);
1338+
#else
12961339
map.insertMulti(QByteArray(dirent->name), dirent->kind);
1340+
#endif
12971341
}
12981342

1343+
#if QT_VERSION >= 0x060000
1344+
QMultiMapIterator<QByteArray, svn_node_kind_t> i(map);
1345+
#else
12991346
QMapIterator<QByteArray, svn_node_kind_t> i(map);
1347+
#endif
13001348
while (i.hasNext()) {
13011349
i.next();
13021350
QString entryName = key + "/" + i.key();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /