Manager: Fix UUID generation for manager config headers
Fix different UUIDs generating depending on the whether the path is absolute or relative; they now always match the ones saved inside .cfg files Also reduce some code duplication
This commit is contained in:
@@ -117,11 +117,16 @@ DlgFilter(QStringList extensions, bool last)
|
||||
|
||||
QString currentUuid()
|
||||
{
|
||||
auto configPath = QFileInfo(cfg_path).dir().canonicalPath();
|
||||
if(!configPath.endsWith("/")) {
|
||||
configPath.append("/");
|
||||
return generateUuid(QString(cfg_path));
|
||||
}
|
||||
|
||||
QString generateUuid(const QString &path)
|
||||
{
|
||||
auto dirPath = QFileInfo(path).dir().canonicalPath();
|
||||
if(!dirPath.endsWith("/")) {
|
||||
dirPath.append("/");
|
||||
}
|
||||
return QUuid::createUuidV5(QUuid{}, configPath).toString(QUuid::WithoutBraces);
|
||||
return QUuid::createUuidV5(QUuid{}, dirPath).toString(QUuid::WithoutBraces);
|
||||
}
|
||||
|
||||
bool compareUuid()
|
||||
|
||||
Reference in New Issue
Block a user