Skip to content

Commit

Permalink
Merge pull request #3785 from Jojo-Schmitz/QDir--separator()
Browse files Browse the repository at this point in the history
Fix #273963: Use `"/"`  rather than `QDir::separator()` for pathnames
  • Loading branch information
anatoly-os committed Jul 7, 2018
2 parents ad75bbc + a96dfec commit c862968
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mscore/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ bool MuseScore::exportParts()
QString skipMessage = tr("Skip");
foreach (Excerpt* e, thisScore->excerpts()) {
Score* pScore = e->partScore();
QString partfn = fi.absolutePath() + QDir::separator() + fi.completeBaseName() + "-" + createDefaultFileName(pScore->title()) + "." + ext;
QString partfn = fi.absolutePath() + "/" + fi.completeBaseName() + "-" + createDefaultFileName(pScore->title()) + "." + ext;
QFileInfo fip(partfn);
if (fip.exists() && !overwrite) {
if(noToAll)
Expand Down Expand Up @@ -1779,7 +1779,7 @@ bool MuseScore::exportParts()
foreach(Excerpt* e, thisScore->excerpts()) {
scores.append(e->partScore());
}
QString partfn(fi.absolutePath() + QDir::separator() + fi.completeBaseName() + "-" + createDefaultFileName(tr("Score_and_Parts")) + ".pdf");
QString partfn(fi.absolutePath() + "/" + fi.completeBaseName() + "-" + createDefaultFileName(tr("Score_and_Parts")) + ".pdf");
QFileInfo fip(partfn);
if(fip.exists() && !overwrite) {
if (!noToAll) {
Expand Down
2 changes: 1 addition & 1 deletion mscore/resourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void ResourceManager::download()
QList<MQZipReader::FileInfo> allFiles = zipFile.fileInfoList();
bool result = true;
foreach (MQZipReader::FileInfo fi, allFiles) {
const QString absPath = destinationDir + QDir::separator() + fi.filePath;
const QString absPath = destinationDir + "/" + fi.filePath;
if (fi.isFile) {
QFile f(absPath);
if (!f.open(QIODevice::WriteOnly)) {
Expand Down
4 changes: 4 additions & 0 deletions mscore3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ Palette handling
(see undo.h undo.cpp for example usage)
TODO: check if they can be removed in system mode

* path separator
Don't use QDir::separtor(), but "/", see https://doc.qt.io/qt-5/qdir.html#separator
and http://agateau.com/2015/qdir-separator-considered-harmful/


====================================================================
some rules
Expand Down

0 comments on commit c862968

Please sign in to comment.