28 QFileInfo info(projectFileName);
29 return info.baseName();
34 QFileInfo info(projectFileName);
60 QFileInfo info(fileName);
71 QFileInfo info(fileName);
72 return info.lastModified().toString(
"hh:mm:ss, MMMM d, yyyy");
92 throw GUIHelpers::Error(
"ProjectUtils::removeRecursively() -> Error. Non existing "
96 return dir.removeRecursively();
116 for (
auto&
name : filenames)
124 #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
125 auto lhs_set = QSet<QString>{lhs.begin(), lhs.end()};
126 auto rhs_set = QSet<QString>{rhs.begin(), rhs.end()};
127 QSet<QString> diff = lhs_set.subtract(rhs_set);
128 return diff.values();
130 QSet<QString> diff = lhs.toSet().subtract(rhs.toSet());
131 return diff.toList();
137 QFile file(fileName);
138 if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
139 throw GUIHelpers::Error(
"ProjectUtils::readTextFile -> Error. Can't open the file '"
140 + fileName +
"' for reading.");
141 QTextStream in(&file);
Defines class GUIHelpers functions.
Defines class ProjectManager.
Defines auxiliary functions in ItemFileNameUtils namespace.
Defines ProjectUtils namespace.
static ProjectManager * projectManager()
static QString projectFileExtension()
QString userExportDir() const
Returns directory name suitable for saving plots.
std::string filename(const std::string &path)
Returns path without directory part ("Foo/Bar/Doz.int.gz" -> "Doz.int.gz")
QStringList nonXMLFileNameFilters()
Returns list of fileName filters related to nonXML data stored by JobModel and RealDataModel.
QStringList substract(const QStringList &lhs, const QStringList &rhs)
Returns list of string from lhs, which are not in rhs.
QStringList nonXMLDataInDir(const QString &dirname)
Returns list of files on disk representing nonXML data.
bool exists(const QString &fileName)
Returns true if file exists.
bool removeRecursively(const QString &dirname)
Removes recursively directory with given name.
bool removeFiles(const QString &dirname, const QStringList &filenames)
QString lastModified(const QString &fileName)
Returns a string representing modification time of given file.
QString autosaveName(const QString &projectFileName)
Returns name of project for autoSave from given project file name.
bool removeFile(const QString &dirname, const QString &filename)
Remove file from given directory.
QString projectName(const QString &projectFileName)
Returns project name deduced from project file name.
bool hasAutosavedData(const QString &projectFileName)
Returns true if project with given projectFileName contains autosaved data.
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.
QString autosaveDir(const QString &projectFileName)
Returns name of autosave directory for project with given project file name.
QString userExportDir()
Returns directory which user is normally using to export files.
QString readTextFile(const QString &fileName)
Returns multi-lione string representing content of text file.
QString autosaveSubdir()
Returns fixed name for autosave sub-directory.
QString const & name(EShape k)
Defines class ProjectDocument.