diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-28 10:30:26 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-05-28 10:30:26 -0400 |
| commit | d3c244c83427174f80d59d3ebbafd2c4263f9b4f (patch) | |
| tree | 409868f39ebc91a6f60c772db904049f86d5c6e0 /src | |
| parent | 1ec2260db594a728ce811c78c83d9bdf460dafc5 (diff) | |
also reversed 'hide' parameter to 'visible' for changeFiletreeVisibility()
Diffstat (limited to 'src')
| -rw-r--r-- | src/modinfodialog.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 4cb23081..06c065fe 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -1326,25 +1326,27 @@ void ModInfoDialog::renameTriggered() void ModInfoDialog::hideTriggered() { - changeFiletreeVisibility(true); + changeFiletreeVisibility(false); } void ModInfoDialog::unhideTriggered() { - changeFiletreeVisibility(false); + changeFiletreeVisibility(true); } -void ModInfoDialog::changeFiletreeVisibility(bool hide) +void ModInfoDialog::changeFiletreeVisibility(bool visible) { bool changed = false; bool stop = false; qDebug().nospace() - << (hide ? "hiding" : "unhiding") << " " + << (visible ? "unhiding" : "hiding") << " " << m_FileSelection.size() << " filetree files"; - QFlags<FileRenamer::RenameFlags> flags = (hide ? FileRenamer::HIDE : FileRenamer::UNHIDE); + QFlags<FileRenamer::RenameFlags> flags = + (visible ? FileRenamer::UNHIDE : FileRenamer::HIDE); + if (m_FileSelection.size() > 1) { flags |= FileRenamer::MULTIPLE; } @@ -1359,19 +1361,18 @@ void ModInfoDialog::changeFiletreeVisibility(bool hide) const QString path = m_FileSystemModel->filePath(index); auto result = FileRenamer::RESULT_CANCEL; - if (hide) { - if (!canHideFile(false, path)) { - qDebug().nospace() << "cannot hide " << path << ", skipping"; - continue; - } - result = hideFile(renamer, path); - - } else { + if (visible) { if (!canUnhideFile(false, path)) { qDebug().nospace() << "cannot unhide " << path << ", skipping"; continue; } result = unhideFile(renamer, path); + } else { + if (!canHideFile(false, path)) { + qDebug().nospace() << "cannot hide " << path << ", skipping"; + continue; + } + result = hideFile(renamer, path); } switch (result) { @@ -1394,7 +1395,7 @@ void ModInfoDialog::changeFiletreeVisibility(bool hide) } } - qDebug().nospace() << (hide ? "hiding" : "unhiding") << " filetree files done"; + qDebug().nospace() << (visible ? "unhiding" : "hiding") << " filetree files done"; if (changed) { qDebug().nospace() << "triggering refresh"; |
