# HG changeset patch # User Santeri Piippo # Date 1387792135 -7200 # Node ID 720f7480c6b77d32f231607c68e47623b26eb013 # Parent 507e5d5c348cd99c4b09a0dd29bb2cb6d134fa06 - now recognizes the recently added 8\ subdirectory diff -r 507e5d5c348c -r 720f7480c6b7 changelog.txt --- a/changelog.txt Mon Dec 23 10:57:54 2013 +0200 +++ b/changelog.txt Mon Dec 23 11:48:55 2013 +0200 @@ -30,6 +30,7 @@ - Upon first start the configuration prompt pops up on its own, defaulting on the profile tab. This way the user can fill in the profile data on the first start and get that out of the way (and gives the opportunity to see the other config fields) +- Now recognizes "8\" as a special subdirectory alongside "48\" and "s\" - Added new action "Add History Line" for quickly inserting 0 !HISTORY lines to headers - Added new action "Go to line", default shortcut Ctrl-G. It should be obvious what it does. - Added new actions "Hide" and "Reveal" which allow direct setting of objects' visibility setting instead of diff -r 507e5d5c348c -r 720f7480c6b7 src/document.cc --- a/src/document.cc Mon Dec 23 10:57:54 2013 +0200 +++ b/src/document.cc Mon Dec 23 11:48:55 2013 +0200 @@ -43,6 +43,8 @@ LDDocument* LDDocument::m_curdoc = null; +const QStringList g_specialSubdirectories ({ "s", "48", "8" }); + // ============================================================================= // ----------------------------------------------------------------------------- namespace LDPaths @@ -226,10 +228,14 @@ { // ensure we don't mix subfiles and 48-primitives with non-subfiles and non-48 str proptop = basename (dirname (partpath)); - bool bogus = (proptop == "s" && reltop != "s") || - (proptop == "48" && reltop != "48") || - (reltop == "s" && proptop != "s") || - (reltop == "48" && proptop != "48"); + bool bogus = false; + + for (str s : g_specialSubdirectories) + { if ((proptop == s && reltop != s) || (reltop == s && proptop != s)) + { bogus = true; + break; + } + } if (!bogus) return f; @@ -610,8 +616,7 @@ return false; // If the second object in the list holds the file name, update that now. - // Only do this if the file is explicitly open. If it's saved into a directory - // called "s" or "48", prepend that into the name. + // Only do this if the file is explicitly open. LDComment* fpathComment = null; LDObject* first = getObject (1); @@ -1224,7 +1229,7 @@ { str shortname = basename (a); str topdirname = basename (dirname (a)); - if (topdirname == "s" || topdirname == "48") + if (g_specialSubdirectories.contains (topdirname)) shortname.prepend (topdirname + "\\"); return shortname;