MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / AddShell

Method AddShell

Plugins/Terminal/DlgSettingsTerminal.cpp:163–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163int CDlgSettingsTerminal::AddShell(QString szShell, const QString &name)
164{
165 int nIndex = 0;
166 QString szName = name;
167 QFileInfo fi(szShell);
168 if(!fi.exists())
169 {
170 qCritical(log) << "The shell is not exist:" << szShell;
171 return -1;
172 }
173 if(szName.isEmpty())
174 szName = fi.baseName();
175
176 nIndex = ui->cbShellName->findText(szName, Qt::MatchFixedString);
177 if(-1 == nIndex) {
178 ui->cbShellName->addItem(szName, szShell);
179 nIndex = ui->cbShellName->findText(szName, Qt::MatchFixedString);
180 }
181
182 ui->cbShellName->setItemData(nIndex, szShell, Qt::ToolTipRole);
183 ui->cbShellName->setItemData(nIndex, szShell, Qt::StatusTipRole);
184 ui->cbShellName->setCurrentIndex(nIndex);
185
186 return 0;
187}
188
189void CDlgSettingsTerminal::on_pbShellBrowse_clicked()
190{

Callers

nothing calls this directly

Calls 2

addItemMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected