From 67d15130305a63abd741f457205db65e96531073 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 7 Aug 2020 22:35:25 +0900 Subject: Improved code for tderandr rotation string to allow translation. This relates to issue TDE/tdelibs#96. Signed-off-by: Michele Calgaro --- kcontrol/displayconfig/displayconfig.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'kcontrol/displayconfig') diff --git a/kcontrol/displayconfig/displayconfig.cpp b/kcontrol/displayconfig/displayconfig.cpp index dacb5cc88..ca8b867ac 100644 --- a/kcontrol/displayconfig/displayconfig.cpp +++ b/kcontrol/displayconfig/displayconfig.cpp @@ -449,8 +449,7 @@ void KDisplayConfig::updateDraggableMonitorInformationInternal (int monitor_id, return; } - TQString rotationDesired = *screendata->rotations.at(screendata->current_rotation_index); - bool isvisiblyrotated = ((rotationDesired == ROTATION_90_DEGREES_STRING) || (rotationDesired == ROTATION_270_DEGREES_STRING)); + bool isvisiblyrotated = (screendata->current_rotation_index == ROTATION_90_DEGREES_INDEX) || (screendata->current_rotation_index == ROTATION_270_DEGREES_INDEX); if (screendata->is_extended) { moved_monitor->show(); @@ -1233,11 +1232,10 @@ void KDisplayConfig::updateDisplayedInformation () { base->orientationVFlip->setChecked(screendata->has_y_flip); } else { - base->rotationSelectDD->insertItem(ROTATION_0_DEGREES_STRING, 0); + base->rotationSelectDD->insertItem(screendata->rotations[ROTATION_0_DEGREES_INDEX], ROTATION_0_DEGREES_INDEX); base->rotationSelectDD->setCurrentItem(0); base->orientationHFlip->hide(); base->orientationVFlip->hide(); - } base->rotationSelectDD->blockSignals(false); base->orientationHFlip->blockSignals(false); @@ -1350,8 +1348,7 @@ void KDisplayConfig::updateDragDropDisplay() { for (i=0;iis_primary==true)) || ((j==1) && (screendata->is_primary==false))) { // This ensures that the primary monitor is always the first one created and placed on the configuration widget - TQString rotationDesired = *screendata->rotations.at(screendata->current_rotation_index); - bool isvisiblyrotated = ((rotationDesired == ROTATION_90_DEGREES_STRING) || (rotationDesired == ROTATION_270_DEGREES_STRING)); + bool isvisiblyrotated = ((screendata->current_rotation_index == ROTATION_90_DEGREES_INDEX) || (screendata->current_rotation_index == ROTATION_270_DEGREES_INDEX)); DraggableMonitor *m = new DraggableMonitor( base->monitorPhyArrange, 0, WStyle_Customize | WDestructiveClose | WStyle_NoBorder | WX11BypassWM ); connect(m, TQT_SIGNAL(workspaceRelayoutNeeded()), this, TQT_SLOT(layoutDragDropDisplay())); connect(m, TQT_SIGNAL(monitorSelected(int)), this, TQT_SLOT(selectScreen(int))); -- cgit v1.2.1