MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / addPathToTable

Method addPathToTable

pcsx2-qt/SetupWizardDialog.cpp:326–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void SetupWizardDialog::addPathToTable(const std::string& path, bool recursive)
327{
328 const int row = m_ui.searchDirectoryList->rowCount();
329 m_ui.searchDirectoryList->insertRow(row);
330
331 QTableWidgetItem* item = new QTableWidgetItem();
332 item->setText(QString::fromStdString(path));
333 item->setFlags(item->flags() & ~(Qt::ItemIsEditable));
334 m_ui.searchDirectoryList->setItem(row, 0, item);
335
336 QCheckBox* cb = new QCheckBox(m_ui.searchDirectoryList);
337 m_ui.searchDirectoryList->setCellWidget(row, 1, cb);
338 cb->setChecked(recursive);
339
340 connect(cb, &QCheckBox::checkStateChanged, this, [item](Qt::CheckState state) {
341 const std::string path(item->text().toStdString());
342 if (state == Qt::Checked)
343 {
344 Host::RemoveBaseValueFromStringList("GameList", "Paths", path.c_str());
345 Host::AddBaseValueToStringList("GameList", "RecursivePaths", path.c_str());
346 }
347 else
348 {
349 Host::RemoveBaseValueFromStringList("GameList", "RecursivePaths", path.c_str());
350 Host::AddBaseValueToStringList("GameList", "Paths", path.c_str());
351 }
352 Host::CommitBaseSettingChanges();
353 });
354}
355
356void SetupWizardDialog::refreshDirectoryList()
357{

Callers

nothing calls this directly

Calls 3

rowCountMethod · 0.45
flagsMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected