MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / updateConvolverList

Method updateConvolverList

src/interface/TrayIcon.cpp:189–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189void TrayIcon::updateConvolverList()
190{
191 if (tray_convMenu != nullptr)
192 {
193 tray_convMenu->clear();
194 QString path = AppConfig::instance().getPath("irs_favorites");
195
196 QDir dir(path);
197
198 if (!dir.exists())
199 {
200 dir.mkpath(".");
201 }
202
203 QStringList nameFilter({ "*.wav", "*.irs" });
204 QStringList files = dir.entryList(nameFilter);
205
206 if (files.count() < 1)
207 {
208 QAction *noPresets = new QAction(tr("No impulse responses found"));
209 noPresets->setEnabled(false);
210 tray_convMenu->addAction(noPresets);
211 }
212 else
213 {
214 for (int i = 0; i < files.count(); i++)
215 {
216 // Add entry
217 QAction *newEntry = new QAction(files[i]);
218 connect(newEntry, &QAction::triggered, this, [this, path, files, i]()
219 {
220 emit loadIrs(path + "/" + files[i]);
221 });
222 tray_convMenu->addAction(newEntry);
223 }
224 }
225 }
226}
227
228void TrayIcon::updateTrayMenu(QMenu *menu)
229{

Callers

nothing calls this directly

Calls 6

connectFunction · 0.85
countMethod · 0.80
setEnabledMethod · 0.80
clearMethod · 0.45
getPathMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected