@@ -1028,15 +1028,46 @@ bool ModList::dropLocalFiles(const ModListDropInfo& dropInfo, int row,
10281028 QList<QPair<QString, QString>> relativePathList;
10291029
10301030 for (auto localUrl : dropInfo.localUrls ()) {
1031-
10321031 QFileInfo sourceInfo (localUrl.url .toLocalFile ());
1033- QString sourceFile = sourceInfo.canonicalFilePath ();
1032+ if (localUrl.originName .compare (" overwrite" , Qt::CaseInsensitive) == 0 ) {
1033+ if (sourceInfo.isDir ()) {
1034+ for (auto dir : m_Organizer->managedGame ()->getModMappings ().keys ()) {
1035+ QDir overDir (m_Organizer->overwritePath ());
1036+ if (sourceInfo.canonicalFilePath ().compare (overDir.absoluteFilePath (dir),
1037+ Qt::CaseInsensitive) == 0 ) {
1038+
1039+ QDirIterator dirIter (overDir.absoluteFilePath (dir),
1040+ QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
1041+ while (dirIter.hasNext ()) {
1042+ auto entry = dirIter.nextFileInfo ();
1043+ QString sourceFile = entry.canonicalFilePath ();
1044+
1045+ QFileInfo targetInfo (modDir.absoluteFilePath (overDir.relativeFilePath (entry.absoluteFilePath ())));
1046+ sourceList << sourceFile;
1047+ targetList << targetInfo.absoluteFilePath ();
1048+ relativePathList << QPair<QString, QString>(localUrl.relativePath ,
1049+ localUrl.originName );
1050+ }
1051+ }
1052+ }
1053+ } else {
1054+ QString sourceFile = sourceInfo.canonicalFilePath ();
10341055
1035- QFileInfo targetInfo (modDir.absoluteFilePath (localUrl.relativePath ));
1036- sourceList << sourceFile;
1037- targetList << targetInfo.absoluteFilePath ();
1038- relativePathList << QPair<QString, QString>(localUrl.relativePath ,
1039- localUrl.originName );
1056+ QFileInfo targetInfo (modDir.absoluteFilePath (localUrl.relativePath ));
1057+ sourceList << sourceFile;
1058+ targetList << targetInfo.absoluteFilePath ();
1059+ relativePathList << QPair<QString, QString>(localUrl.relativePath ,
1060+ localUrl.originName );
1061+ }
1062+ } else {
1063+ QString sourceFile = sourceInfo.canonicalFilePath ();
1064+
1065+ QFileInfo targetInfo (modDir.absoluteFilePath (localUrl.relativePath ));
1066+ sourceList << sourceFile;
1067+ targetList << targetInfo.absoluteFilePath ();
1068+ relativePathList << QPair<QString, QString>(localUrl.relativePath ,
1069+ localUrl.originName );
1070+ }
10401071 }
10411072
10421073 if (sourceList.count ()) {
0 commit comments