MCPcopy Create free account
hub / github.com/bluescan/tacentview / SetCurrentImage

Method SetCurrentImage

Src/TacentView.cpp:844–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842
843
844bool Viewer::SetCurrentImage(const tString& currFilename, bool forceReload)
845{
846 bool found = false;
847 for (Image* si = Images.First(); si; si = si->Next())
848 {
849 tString siName = tSystem::tGetFileName(si->Filename);
850 tString imgName = tSystem::tGetFileName(currFilename);
851
852 // We want a case-sensitive compare on Linux.
853 if (tPstrcmp(siName.Chars(), imgName.Chars()) == 0)
854 {
855 CurrImage = si;
856 found = true;
857 break;
858 }
859 }
860
861 if (!CurrImage)
862 {
863 CurrImage = Images.First();
864 if (!currFilename.IsEmpty())
865 tPrintf("Could not display [%s].\n", tSystem::tGetFileName(currFilename).Chr());
866 if (CurrImage && !CurrImage->Filename.IsEmpty())
867 tPrintf("First image [%s].\n", tSystem::tGetFileName(CurrImage->Filename).Chr());
868 }
869
870 if (CurrImage)
871 LoadCurrImage(forceReload);
872
873 return found;
874}
875
876
877void Viewer::AutoPropertyWindow()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected