MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / createIdls

Method createIdls

src/envshell.cpp:334–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334std::vector<LPCITEMIDLIST> ShellMenu::createIdls(const std::vector<QFileInfo>& files)
335{
336 std::vector<LPCITEMIDLIST> idls;
337 std::optional<QDir> parent;
338
339 for (auto&& f : files) {
340 const auto path = QDir::toNativeSeparators(f.absoluteFilePath()).toStdWString();
341
342 if (!parent) {
343 parent = f.absoluteDir();
344 } else {
345 if (*parent != f.absoluteDir()) {
346 throw DummyMenu(QObject::tr("Selected files must be in the same directory"));
347 }
348 }
349
350 auto item = createShellItem(path);
351 auto pidlist = getPersistIDList(item.get());
352 auto absIdl = getIDList(pidlist.get());
353
354 idls.push_back(absIdl.release());
355 }
356
357 return idls;
358}
359
360COMPtr<IShellItemArray> ShellMenu::createItemArray(std::vector<LPCITEMIDLIST>& idls)
361{

Callers

nothing calls this directly

Calls 2

DummyMenuClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected