Changeset View
Changeset View
Standalone View
Standalone View
daemon/backends/upower/backlighthelper.cpp
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | 128 | #ifdef USE_SYSCTL | |||
---|---|---|---|---|---|
168 | } | 168 | } | ||
169 | // acpi_video(4) supports only some predefined brightness levels. | 169 | // acpi_video(4) supports only some predefined brightness levels. | ||
170 | int nlevels = len / sizeof(int); | 170 | int nlevels = len / sizeof(int); | ||
171 | for (int i = 0; i < nlevels; i++) { | 171 | for (int i = 0; i < nlevels; i++) { | ||
172 | m_sysctlBrightnessLevels << levels[i]; | 172 | m_sysctlBrightnessLevels << levels[i]; | ||
173 | } | 173 | } | ||
174 | free(levels); | 174 | free(levels); | ||
175 | // Sorting helps when finding max value and when scanning for the nearest level in setbrightness(). | 175 | // Sorting helps when finding max value and when scanning for the nearest level in setbrightness(). | ||
176 | qSort(m_sysctlBrightnessLevels.begin(), m_sysctlBrightnessLevels.end()); | 176 | std::sort(m_sysctlBrightnessLevels.begin(), m_sysctlBrightnessLevels.end()); | ||
177 | #endif | 177 | #endif | ||
178 | } | 178 | } | ||
179 | 179 | | |||
180 | ActionReply BacklightHelper::brightness(const QVariantMap &args) | 180 | ActionReply BacklightHelper::brightness(const QVariantMap &args) | ||
181 | { | 181 | { | ||
182 | Q_UNUSED(args); | 182 | Q_UNUSED(args); | ||
183 | 183 | | |||
184 | ActionReply reply; | 184 | ActionReply reply; | ||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |