MCPcopy Create free account
hub / github.com/WinMerge/winmerge / UpdateHeaderPath

Method UpdateHeaderPath

Src/MergeDoc.cpp:2623–2657  ·  view source on GitHub ↗

* @brief Write path and filename to headerbar * @note SetText() does not repaint unchanged text */

Source from the content-addressed store, hash-verified

2621 * @note SetText() does not repaint unchanged text
2622 */
2623void CMergeDoc::UpdateHeaderPath(int pane)
2624{
2625 CMergeEditFrame *pf = GetParentFrame();
2626 ASSERT(pf != nullptr);
2627 String sText;
2628 bool bChanges = false;
2629
2630 if (m_nBufferType[pane] == BUFFERTYPE::UNNAMED ||
2631 m_nBufferType[pane] == BUFFERTYPE::NORMAL_NAMED)
2632 {
2633 sText = m_strDesc[pane];
2634 }
2635 else
2636 {
2637 sText = m_filePaths[pane];
2638 if (m_pDirDoc != nullptr)
2639 {
2640 m_pDirDoc->ApplyDisplayRoot(pane, sText);
2641 }
2642 }
2643 bChanges = m_ptBuf[pane]->IsModified();
2644
2645 if (bChanges)
2646 sText.insert(0, _T("* "));
2647
2648 if (m_sCurrentHeaderTitle[pane] == sText)
2649 return;
2650
2651 m_sCurrentHeaderTitle[pane] = sText;
2652
2653 pf->GetHeaderInterface()->SetCaption(pane, sText);
2654 pf->GetHeaderInterface()->SetPath(pane, m_filePaths[pane]);
2655
2656 SetTitle(nullptr);
2657}
2658
2659/**
2660 * @brief Paint differently the headerbar of the active view

Callers

nothing calls this directly

Calls 6

ApplyDisplayRootMethod · 0.80
SetCaptionMethod · 0.80
IsModifiedMethod · 0.45
insertMethod · 0.45
GetHeaderInterfaceMethod · 0.45
SetPathMethod · 0.45

Tested by

no test coverage detected