BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
GUI_StringUtils Namespace Reference

Functions

QString withTildeHomePath (const QString &path)
 

Function Documentation

◆ withTildeHomePath()

QString GUI_StringUtils::withTildeHomePath ( const QString &  path)

Definition at line 21 of file qstringutils.cpp.

22 {
24  return path;
25 
26  static const QString homePath = QDir::homePath();
27 
28  QFileInfo fi(QDir::cleanPath(path));
29  QString outPath = fi.absoluteFilePath();
30  if (outPath.startsWith(homePath))
31  outPath = QLatin1Char('~') + outPath.mid(homePath.size());
32  else
33  outPath = path;
34  return outPath;
35 }
static bool isWindowsHost()
Definition: hostosinfo.h:67

References GUI_OS_Utils::HostOsInfo::isWindowsHost().

Referenced by WelcomeView::currentProjectFancyName(), WelcomeView::generateRecentProjectList(), and ActionManager::onAboutToShowFileMenu().

Here is the call graph for this function: