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

Method addPathToTable

pcsx2-qt/Settings/GameListSettingsWidget.cpp:90–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void GameListSettingsWidget::addPathToTable(const std::string& path, bool recursive)
91{
92 const int row = m_ui.searchDirectoryList->rowCount();
93 m_ui.searchDirectoryList->insertRow(row);
94
95 QTableWidgetItem* item = new QTableWidgetItem();
96 item->setText(QString::fromStdString(path));
97 item->setFlags(item->flags() & ~(Qt::ItemIsEditable));
98 m_ui.searchDirectoryList->setItem(row, 0, item);
99
100 QCheckBox* cb = new QCheckBox(m_ui.searchDirectoryList);
101 m_ui.searchDirectoryList->setCellWidget(row, 1, cb);
102 cb->setChecked(recursive);
103
104 connect(cb, &QCheckBox::checkStateChanged, this, [item](Qt::CheckState state) {
105 const std::string path(item->text().toStdString());
106 if (state == Qt::Checked)
107 {
108 Host::RemoveBaseValueFromStringList("GameList", "Paths", path.c_str());
109 Host::AddBaseValueToStringList("GameList", "RecursivePaths", path.c_str());
110 }
111 else
112 {
113 Host::RemoveBaseValueFromStringList("GameList", "RecursivePaths", path.c_str());
114 Host::AddBaseValueToStringList("GameList", "Paths", path.c_str());
115 }
116 Host::CommitBaseSettingChanges();
117 });
118}
119
120void GameListSettingsWidget::refreshDirectoryList()
121{

Callers

nothing calls this directly

Calls 3

rowCountMethod · 0.45
flagsMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected