Skip to content

Commit

Permalink
Assets now always in a tacentview/Assets/ directory. e.g. If XDG repo…
Browse files Browse the repository at this point in the history
…rts the data home as /usr/share/, the viewer assets are looked for in /usr/share/tacentview/Assets/
  • Loading branch information
bluescan committed Sep 8, 2024
1 parent 446e774 commit cd78fb8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Src/TacentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4235,18 +4235,19 @@ int main(int argc, char** argv)
// Everything other than SNAP, including Nix/Deb, support XDG. We never use the default for tGetXDGDataHome
// but will use the tGetXDGDataDirs default if both are unset. First we check data-home.
tString dataDir;
tString subAssetDir = "tacentview/Assets/";
bool dataHomeWasSet = tSystem::tGetXDGDataHome(dataDir);
if (dataHomeWasSet && tSystem::tDirExists(dataDir + "tacentview/"))
if (dataHomeWasSet && tSystem::tDirExists(dataDir + subAssetDir))
{
assetsDir = dataDir + "tacentview/";
assetsDir = dataDir + subAssetDir;
}
else
{
tList<tStringItem> dataDirs;
tSystem::tGetXDGDataDirs(dataDirs);
for (tStringItem* ddir = dataDirs.First(); ddir; ddir = ddir->Next())
{
tString contender = *ddir + "tacentview/";
tString contender = *ddir + subAssetDir;
if (tSystem::tDirExists(contender))
{
assetsDir = contender;
Expand All @@ -4255,7 +4256,7 @@ int main(int argc, char** argv)
}
}
if (assetsDir.IsEmpty())
assetsDir = "/usr/share/tacentview/";
assetsDir = "/usr/share/" + subAssetDir;

tString xdgConfigHome; tSystem::tGetXDGConfigHome(xdgConfigHome);
tString xdgCacheHome; tSystem::tGetXDGCacheHome(xdgCacheHome);
Expand Down

0 comments on commit cd78fb8

Please sign in to comment.