Support for ICC profiles in subdirectories

see issue #1286
This commit is contained in:
Oliver Duis
2012-03-22 19:12:20 +01:00
parent 9da3425f78
commit 33288c09e8

View File

@@ -213,8 +213,15 @@ void ICCStore::init (Glib::ustring usrICCDir, Glib::ustring rtICCDir) {
void ICCStore::loadICCs(Glib::ustring rootDirName, bool nameUpper, std::map<std::string, cmsHPROFILE>& resultProfiles, std::map<std::string, ProfileContent> &resultProfileContents) {
if (rootDirName!="") {
std::deque<Glib::ustring> qDirs;
qDirs.push_front(rootDirName);
while (qDirs.size()) {
// process directory
Glib::ustring dirname = rootDirName;
Glib::ustring dirname = qDirs.back();
qDirs.pop_back();
Glib::Dir* dir = NULL;
try {
if (!safe_file_test (dirname, Glib::FILE_TEST_IS_DIR)) return;
@@ -241,11 +248,12 @@ void ICCStore::loadICCs(Glib::ustring rootDirName, bool nameUpper, std::map<std:
}
}
}
}
} else qDirs.push_front(fname); // for later scanning
}
delete dir;
}
}
}
// Determine the first monitor default profile of operating system, if selected
void ICCStore::findDefaultMonitorProfile() {