MCPcopy Create free account
hub / github.com/IJHack/QtPass / on_profileBox_currentTextChanged

Method on_profileBox_currentTextChanged

src/mainwindow.cpp:1048–1072  ·  view source on GitHub ↗

* @brief Handles changes to the selected profile in the profile combo box. * @details Ignores the event during a fresh start or when the selected profile * matches the current profile. Otherwise, it clears the password field, updates * the active profile and related settings, refreshes the environment, and * resets the tree view and action states to reflect the newly selected profile. * * @p

Source from the content-addressed store, hash-verified

1046 *
1047 */
1048void MainWindow::on_profileBox_currentTextChanged(const QString &name) {
1049#endif
1050 if (m_qtPass->isFreshStart() || name == QtPassSettings::getProfile()) {
1051 return;
1052 }
1053
1054 ui->lineEdit->clear();
1055
1056 QtPassSettings::setProfile(name);
1057
1058 QtPassSettings::setPassStore(
1059 QtPassSettings::getProfiles().value(name).value("path"));
1060 QtPassSettings::setPassSigningKey(
1061 QtPassSettings::getProfiles().value(name).value("signingKey"));
1062 ui->statusBar->showMessage(tr("Profile changed to %1").arg(name), 2000);
1063
1064 QtPassSettings::getPass()->updateEnv();
1065
1066 const QString passStore = QtPassSettings::getPassStore();
1067 proxyModel.setStore(passStore);
1068 ui->treeView->setRootIndex(
1069 proxyModel.mapFromSource(model.setRootPath(passStore)));
1070 deselect();
1071 ui->treeView->setCurrentIndex(QModelIndex());
1072}
1073
1074/**
1075 * @brief MainWindow::initTrayIcon show a nice tray icon on systems that

Callers

nothing calls this directly

Calls 4

isFreshStartMethod · 0.80
showMessageMethod · 0.80
updateEnvMethod · 0.80
setStoreMethod · 0.80

Tested by

no test coverage detected