MCPcopy Create free account
hub / github.com/KDE/labplot / updateTitleBar

Method updateTitleBar

src/frontend/MainWin.cpp:1896–1924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1894}
1895
1896void MainWin::updateTitleBar() {
1897 QString title;
1898 if (m_project) {
1899 switch (m_titleBarMode) {
1900 case TitleBarMode::ShowProjectName:
1901 title = m_project->name();
1902 break;
1903 case TitleBarMode::ShowFileName:
1904 if (m_project->fileName().isEmpty())
1905 title = m_project->name();
1906 else {
1907 QFileInfo fi(m_project->fileName());
1908 title = fi.baseName();
1909 }
1910 break;
1911 case TitleBarMode::ShowFilePath:
1912 if (m_project->fileName().isEmpty())
1913 title = m_project->name();
1914 else
1915 title = m_project->fileName();
1916 }
1917
1918 if (m_project->hasChanged())
1919 title += QLatin1String(" [") + i18n("Changed") + QLatin1Char(']');
1920 } else
1921 title = QLatin1String("LabPlot");
1922
1923 setCaption(title);
1924}
1925
1926/*!
1927 prints the current sheet (worksheet, spreadsheet or matrix)

Callers

nothing calls this directly

Calls 4

hasChangedMethod · 0.80
nameMethod · 0.45
isEmptyMethod · 0.45
fileNameMethod · 0.45

Tested by

no test coverage detected