summaryrefslogtreecommitdiffstats
path: root/krandr
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-02 05:39:20 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-02 05:39:20 +0000
commit333cd24e78f8de4aef0530ec5ad20d523ad6f7eb (patch)
tree56e7833be1cc9b19f8b783517719b947e3e06804 /krandr
parentc4b7890322615f756f7553085c75e6e19d6cdf3b (diff)
downloadtdelibs-333cd24e78f8de4aef0530ec5ad20d523ad6f7eb.tar.gz
tdelibs-333cd24e78f8de4aef0530ec5ad20d523ad6f7eb.zip
Added profile "stickiness" support to krandr library
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1121682 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krandr')
-rw-r--r--krandr/libkrandr.cc18
-rw-r--r--krandr/libkrandr.h5
2 files changed, 23 insertions, 0 deletions
diff --git a/krandr/libkrandr.cc b/krandr/libkrandr.cc
index 97286f6c0..db40743a4 100644
--- a/krandr/libkrandr.cc
+++ b/krandr/libkrandr.cc
@@ -205,10 +205,13 @@ QString KRandrSimpleAPI::applyIccConfiguration(QString profileName, QString kde_
Display *randr_display;
ScreenInfo *randr_screen_info;
XRROutputInfo *output_info;
+ KSimpleConfig *t_config;
int screenNumber = 0;
QString errorstr = "";
+ t_config = new KSimpleConfig( QString::fromLatin1( "kiccconfigrc" ));
+
// Find all screens
if (isValid() == true) {
randr_display = XOpenDisplay(NULL);
@@ -224,9 +227,24 @@ QString KRandrSimpleAPI::applyIccConfiguration(QString profileName, QString kde_
else {
return applyIccFile(getIccFileName(profileName, "Default", kde_confdir), "Default");
}
+
+ t_config->writeEntry("CurrentProfile", profileName);
+ t_config->sync();
+ delete t_config;
+
return "";
}
+QString KRandrSimpleAPI::getCurrentProfile () {
+ QString profileName;
+ KSimpleConfig *t_config;
+
+ t_config = new KSimpleConfig( QString::fromLatin1( "kiccconfigrc" ));
+ profileName = t_config->readEntry("CurrentProfile");
+ delete t_config;
+ return profileName;
+}
+
QString KRandrSimpleAPI::applySystemWideIccConfiguration(QString kde_confdir) {
// Apply ICC settings with XCalib
QString icc_command;
diff --git a/krandr/libkrandr.h b/krandr/libkrandr.h
index 7d52ac2ca..2135eb9f8 100644
--- a/krandr/libkrandr.h
+++ b/krandr/libkrandr.h
@@ -76,6 +76,11 @@ class KRANDR_EXPORT KRandrSimpleAPI : public RandRDisplay
QString clearIccConfiguration(void);
/**
+ * Retrieves current profile name
+ */
+ QString getCurrentProfile(void);
+
+ /**
* Reads current screen information.
*/
ScreenInfo* read_screen_info(Display *display);