~nemo-mobile-team/nemo-mobile/lipstick

« back to all changes in this revision

Viewing changes to src/lipsticksettings.cpp

  • Committer: Chris Adams
  • Date: 2015-07-16 07:38:25 UTC
  • mfrom: (1653.1.1)
  • Revision ID: git-v1:bb38d3210e616aec142e7ed38797fe45bb9c97cc
Tags: 0.27.65
Merge pull request #357 from nemomobile/exportscreensize

[lipstick] Export screen size as dconf keys. Contributes to MER#1124

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include <QGuiApplication>
19
19
#include <QScreen>
 
20
#include <MGConfItem>
20
21
#include "screenlock/screenlock.h"
21
22
#include "homeapplication.h"
22
23
#include "lipsticksettings.h"
77
78
    return QGuiApplication::primaryScreen()->size();
78
79
}
79
80
 
 
81
void LipstickSettings::exportScreenSize()
 
82
{
 
83
    const int defaultValue = 0;
 
84
    MGConfItem widthConf("/lipstick/screen/primary/width");
 
85
    if (widthConf.value(defaultValue) != QGuiApplication::primaryScreen()->size().width()) {
 
86
        widthConf.set(QGuiApplication::primaryScreen()->size().width());
 
87
        widthConf.sync();
 
88
    }
 
89
    MGConfItem heightConf("/lipstick/screen/primary/height");
 
90
    if (heightConf.value(defaultValue) != QGuiApplication::primaryScreen()->size().height()) {
 
91
        heightConf.set(QGuiApplication::primaryScreen()->size().height());
 
92
        heightConf.sync();
 
93
    }
 
94
}
 
95
 
80
96
QString LipstickSettings::blankingPolicy()
81
97
{
82
98
    if (screenLock) {