I try to find the path from GPL Ghostscript ..
I find the path ... and is installed 8.60.
Now how i can make QSettings read only...
to not make 39 new Regedit empty path?
/* find gpl GhostScript path or exe */
QString PS_utils
::getGSDefaultExeName() {
#if defined Q_WS_WIN
// Try to locate GhostScript thanks to the qsetting
gsName = "gswin32c.exe";
for(int i=0;i<99;i++) {
/* loop all avaiable version on 8+ */
if (gs_sett.allKeys().size() > 2) {
if (gs_sett.value("GS_DLL").toString().size() > 4) {
Pinfo.setFile(gs_sett.value("GS_DLL").toString());
return gsName.prepend(Pinfo.absolutePath()+"/");
}
}
}
for(int e=0;e<99;e++) {
/* loop all avaiable version on 7+ */
if (gs_sett7.allKeys().size() > 2) {
if (gs_sett7.value("GS_DLL").toString().size() > 4) {
Pinfo.setFile(gs_sett7.value("GS_DLL").toString());
return gsName.prepend(Pinfo.absolutePath()+"/");
}
}
}
/* win not having GPL Ghostscript ! */
gsName = "gs";
#else
gsName = "gs";
#endif
return gsName;
}
/* find gpl GhostScript path or exe */
QString PS_utils::getGSDefaultExeName()
{
QString gsName;
#if defined Q_WS_WIN
QFileInfo Pinfo;
// Try to locate GhostScript thanks to the qsetting
gsName = "gswin32c.exe";
for(int i=0;i<99;i++) {
/* loop all avaiable version on 8+ */
QSettings gs_sett("HKEY_LOCAL_MACHINE\\Software\\GPL Ghostscript\\8."+QString("%1").arg(100 - i),QSettings::NativeFormat);
if (gs_sett.allKeys().size() > 2) {
if (gs_sett.value("GS_DLL").toString().size() > 4) {
Pinfo.setFile(gs_sett.value("GS_DLL").toString());
return gsName.prepend(Pinfo.absolutePath()+"/");
}
}
}
for(int e=0;e<99;e++) {
/* loop all avaiable version on 7+ */
QSettings gs_sett7("HKEY_LOCAL_MACHINE\\Software\\GPL Ghostscript\\7."+QString("%1").arg(100 - e),QSettings::NativeFormat);
if (gs_sett7.allKeys().size() > 2) {
if (gs_sett7.value("GS_DLL").toString().size() > 4) {
Pinfo.setFile(gs_sett7.value("GS_DLL").toString());
return gsName.prepend(Pinfo.absolutePath()+"/");
}
}
}
/* win not having GPL Ghostscript ! */
gsName = "gs";
#else
gsName = "gs";
#endif
return gsName;
}
To copy to clipboard, switch view to plain text mode
Bookmarks