From 2caf1dfebc751722ef215f8c91977a26c2d971c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 25 Dec 2021 20:58:09 +0100 Subject: [PATCH] Add dispwin (Argyll) support to set the ICC profile. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdm/kfrontend/kgapp.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tdm/kfrontend/kgapp.cpp b/tdm/kfrontend/kgapp.cpp index 6c77b444b..82630ba09 100644 --- a/tdm/kfrontend/kgapp.cpp +++ b/tdm/kfrontend/kgapp.cpp @@ -308,11 +308,22 @@ kg_main( const char *argv0 ) iccConfigFile += "/kicc/kiccconfigrc"; KSimpleConfig iccconfig(iccConfigFile, true); if (iccconfig.readBoolEntry("EnableICC", false) == true) { - TQString iccCommand = TQString("/usr/bin/xcalib "); - iccCommand += iccconfig.readEntry("ICCFile"); - iccCommand += TQString(" &"); - if (system(iccCommand.ascii()) < 0) { - printf("WARNING: Unable to execute command \"%s\"\n", iccCommand.ascii()); + TQString iccCommand = TDEGlobal::dirs()->findExe("dispwin"); + if (iccCommand.isEmpty()) + { + iccCommand = TDEGlobal::dirs()->findExe("xcalib"); + } + if (iccCommand.isEmpty()) + { + printf("WARNING: Unable to find command to set ICC profile - dispwin or xcalib\n"); + } + else + { + iccCommand += TQString(" %1 &").arg(iccconfig.readEntry("ICCFile")); + if (system(iccCommand.local8Bit()) < 0) + { + printf("WARNING: Unable to execute command \"%s\"\n", iccCommand.local8Bit()); + } } }