* @brief Replace internal root by display root * When we have a archive file open, this function converts physical folder * (that is in the temp folder where archive was extracted) to the virtual * path for showing. The virtual path is path to the archive file, archive * file name and folder inside the archive. * @param [in, out] sText Path to convert. */
| 812 | * @param [in, out] sText Path to convert. |
| 813 | */ |
| 814 | void CDirDoc::ApplyDisplayRoot(int nIndex, String &sText) |
| 815 | { |
| 816 | if (m_pTempPathContext != nullptr) |
| 817 | { |
| 818 | if (sText.find(m_pTempPathContext->m_strRoot[nIndex]) == String::npos) |
| 819 | { |
| 820 | for (int pane = 0; pane < m_nDirs; ++pane) |
| 821 | { |
| 822 | if (sText.find(m_pTempPathContext->m_strRoot[pane]) != String::npos) |
| 823 | { |
| 824 | nIndex = pane; |
| 825 | break; |
| 826 | } |
| 827 | } |
| 828 | } |
| 829 | sText.erase(0, m_pTempPathContext->m_strRoot[nIndex].length()); |
| 830 | sText.insert(0, m_pTempPathContext->m_strDisplayRoot[nIndex]); |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | /** |
| 835 | * @brief Set document title to given string or items compared. |
no test coverage detected