|
a/src/common/rclconfig.cpp |
|
b/src/common/rclconfig.cpp |
|
... |
|
... |
883 |
find_if(v.begin(), v.end(), StringIcmpPred(mimetype)) != v.end())
|
883 |
find_if(v.begin(), v.end(), StringIcmpPred(mimetype)) != v.end())
|
884 |
return false;
|
884 |
return false;
|
885 |
return true;
|
885 |
return true;
|
886 |
}
|
886 |
}
|
887 |
|
887 |
|
888 |
/**
|
|
|
889 |
* Return icon name and path
|
|
|
890 |
*/
|
|
|
891 |
string RclConfig::getMimeIconName(const string &mtype, string *path)
|
888 |
string RclConfig::getMimeIconPath(const string &mtype, const string &apptag)
|
892 |
{
|
889 |
{
|
893 |
string iconname;
|
890 |
string iconname;
|
|
|
891 |
if (!apptag.empty())
|
|
|
892 |
mimeconf->get(mtype + string("|") + apptag, iconname, "icons");
|
|
|
893 |
if (iconname.empty())
|
894 |
mimeconf->get(mtype, iconname, "icons");
|
894 |
mimeconf->get(mtype, iconname, "icons");
|
895 |
if (iconname.empty())
|
895 |
if (iconname.empty())
|
896 |
iconname = "document";
|
896 |
iconname = "document";
|
897 |
|
897 |
|
898 |
if (path) {
|
898 |
string iconpath;
|
899 |
string iconsdir;
|
|
|
900 |
|
|
|
901 |
#if defined (__FreeBSD__) && __FreeBSD_version < 500000
|
899 |
#if defined (__FreeBSD__) && __FreeBSD_version < 500000
|
902 |
// gcc 2.95 dies if we call getConfParam here ??
|
900 |
// gcc 2.95 dies if we call getConfParam here ??
|
903 |
if (m_conf) m_conf->get(string("iconsdir"), iconsdir, m_keydir);
|
901 |
if (m_conf) m_conf->get(string("iconsdir"), iconpath, m_keydir);
|
904 |
#else
|
902 |
#else
|
905 |
getConfParam("iconsdir", iconsdir);
|
903 |
getConfParam("iconsdir", iconpath);
|
906 |
#endif
|
904 |
#endif
|
|
|
905 |
|
907 |
if (iconsdir.empty()) {
|
906 |
if (iconpath.empty()) {
|
908 |
iconsdir = path_cat(m_datadir, "images");
|
907 |
iconpath = path_cat(m_datadir, "images");
|
909 |
} else {
|
908 |
} else {
|
910 |
iconsdir = path_tildexpand(iconsdir);
|
909 |
iconpath = path_tildexpand(iconpath);
|
911 |
}
|
910 |
}
|
912 |
*path = path_cat(iconsdir, iconname) + ".png";
|
911 |
return path_cat(iconpath, iconname) + ".png";
|
913 |
}
|
|
|
914 |
return iconname;
|
|
|
915 |
}
|
912 |
}
|
916 |
|
913 |
|
917 |
string RclConfig::getDbDir()
|
914 |
string RclConfig::getDbDir()
|
918 |
{
|
915 |
{
|
919 |
string dbdir;
|
916 |
string dbdir;
|