Changeset View
Changeset View
Standalone View
Standalone View
kcm/output_model.cpp
Show All 10 Lines | |||||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | 12 | GNU General Public License for more details. | ||
13 | 13 | | |||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | *********************************************************************/ | 16 | *********************************************************************/ | ||
17 | #include "output_model.h" | 17 | #include "output_model.h" | ||
18 | 18 | | |||
19 | #include "../common/utils.h" | ||||
20 | | ||||
19 | #include "config_handler.h" | 21 | #include "config_handler.h" | ||
20 | 22 | | |||
21 | #include <KLocalizedString> | 23 | #include <KLocalizedString> | ||
22 | 24 | | |||
23 | #include <QRect> | 25 | #include <QRect> | ||
24 | 26 | | |||
25 | OutputModel::OutputModel(ConfigHandler *configHandler) | 27 | OutputModel::OutputModel(ConfigHandler *configHandler) | ||
26 | : QAbstractListModel(configHandler) | 28 | : QAbstractListModel(configHandler) | ||
Show All 12 Lines | |||||
39 | { | 41 | { | ||
40 | if (index.row() < 0 || index.row() >= m_outputs.count()) { | 42 | if (index.row() < 0 || index.row() >= m_outputs.count()) { | ||
41 | return QVariant(); | 43 | return QVariant(); | ||
42 | } | 44 | } | ||
43 | 45 | | |||
44 | const KScreen::OutputPtr &output = m_outputs[index.row()].ptr; | 46 | const KScreen::OutputPtr &output = m_outputs[index.row()].ptr; | ||
45 | switch (role) { | 47 | switch (role) { | ||
46 | case Qt::DisplayRole: | 48 | case Qt::DisplayRole: | ||
47 | return output->name(); | 49 | return Utils::outputName(output); | ||
48 | case EnabledRole: | 50 | case EnabledRole: | ||
49 | return output->isEnabled(); | 51 | return output->isEnabled(); | ||
50 | case PrimaryRole: | 52 | case PrimaryRole: | ||
51 | return output->isPrimary(); | 53 | return output->isPrimary(); | ||
52 | case SizeRole: | 54 | case SizeRole: | ||
53 | return output->geometry().size(); | 55 | return output->geometry().size(); | ||
54 | case PositionRole: | 56 | case PositionRole: | ||
55 | return m_outputs[index.row()].pos; | 57 | return m_outputs[index.row()].pos; | ||
▲ Show 20 Lines • Show All 814 Lines • Show Last 20 Lines |