src/lddocument.cpp

changeset 1329
025578d6e491
parent 1326
69a90bd2dba2
child 1340
ea1b3ea9a3ca
--- a/src/lddocument.cpp	Sat Mar 24 13:03:02 2018 +0200
+++ b/src/lddocument.cpp	Sat Mar 24 13:11:17 2018 +0200
@@ -548,15 +548,15 @@
 
 // =============================================================================
 //
-QString LDDocument::shortenName (QString a) // [static]
+QString LDDocument::shortenName(const QFileInfo& path) // [static]
 {
-	QString shortname = Basename (a);
-	QString topdirname = Basename (Dirname (a));
+	QString shortname = path.fileName();
+	QString topdirname = QFileInfo {path.absoluteFilePath()}.dir().dirName();
 
-	if (DocumentManager::specialSubdirectories.contains (topdirname))
-		shortname.prepend (topdirname + "\\");
-
-	return shortname;
+	if (isOneOf(topdirname, "s", "48", "8"))
+		return topdirname + "\\" + shortname;
+	else
+		return shortname;
 }
 
 // =============================================================================

mercurial