Preferences: Fix detecting active profile

Starting and active profile can be different when passing the profile
as a cli flag.
remotes/origin/falkon
David Rosca 9 years ago
parent 4878265ff6
commit 1695c9bd62
  1. 12
      src/lib/preferences/preferences.cpp

@ -822,16 +822,10 @@ void Preferences::deleteProfile()
void Preferences::startProfileIndexChanged(int index)
{
// Index 0 is current profile
const bool current = ui->startProfile->itemText(index) == ProfileManager::currentProfile();
ui->deleteProfile->setEnabled(index != 0);
if (index == 0) {
ui->cannotDeleteActiveProfileLabel->setText(tr("Note: You cannot delete active profile."));
}
else {
ui->cannotDeleteActiveProfileLabel->setText(" ");
}
ui->deleteProfile->setEnabled(!current);
ui->cannotDeleteActiveProfileLabel->setText(current ? tr("Note: You cannot delete active profile.") : QString());
}
void Preferences::closeEvent(QCloseEvent* event)

Loading…
Cancel
Save