| 842 | |
| 843 | |
| 844 | bool 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 | |
| 877 | void Viewer::AutoPropertyWindow() |
nothing calls this directly
no outgoing calls
no test coverage detected