Commit 69048d52 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Settingsselector: Simplify code

Remove kindof string, thus making the message handling much easier.

Change-Id: I0b447980a765138ad4be14c1ceb0f1f6e58e0c54
Reviewed-by: default avatarFriedemann Kleint <>
parent 1b5168fd
......@@ -143,13 +143,8 @@ void SettingsSelector::removeButtonClicked()
int pos = currentIndex();
if (pos < 0)
const QString title = m_kindOfDisplayName.isEmpty() ? tr("Remove") :
tr("Remove %1").arg(m_kindOfDisplayName);
const QString message = m_kindOfDisplayName.isEmpty() ?
tr("Do you really want to delete the configuration <b>%1</b>?")
.arg(m_configurationCombo->currentText()) :
tr("Do you really want to delete the %1 <b>%2</b>?")
const QString title = tr("Remove");
const QString message = tr("Do you really want to delete the configuration <b>%1</b>?")
QMessageBox msgBox(QMessageBox::Question, title, message, QMessageBox::Yes|QMessageBox::No, this);
......@@ -172,11 +167,7 @@ void SettingsSelector::renameButtonClicked()
QString baseName = model->data(idx, Qt::EditRole).toString();
bool ok;
const QString &message = m_kindOfDisplayName.isEmpty() ?
tr("New name for configuration <b>%1</b>:")
.arg(baseName) :
tr("New name for %1: <b>%2</b>:")
const QString message = tr("New name for configuration <b>%1</b>:").arg(baseName);
QString name = QInputDialog::getText(this, tr("Rename..."), message,
QLineEdit::Normal, baseName, &ok);
......@@ -82,7 +82,6 @@ private slots:
QLabel *m_label;
QString m_kindOfDisplayName;
QComboBox *m_configurationCombo;
QPushButton *m_addButton;
QPushButton *m_removeButton;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment