MCPcopy Create free account
hub / github.com/IJHack/QtPass / getFile

Method getFile

src/mainwindow.cpp:365–376  ·  view source on GitHub ↗

* @brief MainWindow::getFile get the selected file path * @param index * @param forPass returns relative path without '.gpg' extension * @return path * @return */

Source from the content-addressed store, hash-verified

363 * @return
364 */
365auto MainWindow::getFile(const QModelIndex &index, bool forPass) -> QString {
366 if (!index.isValid() ||
367 !model.fileInfo(proxyModel.mapToSource(index)).isFile()) {
368 return {};
369 }
370 QString filePath = model.filePath(proxyModel.mapToSource(index));
371 if (forPass) {
372 filePath = QDir(QtPassSettings::getPassStore()).relativeFilePath(filePath);
373 filePath.replace(Util::endsWithGpg(), "");
374 }
375 return filePath;
376}
377
378/**
379 * @brief MainWindow::on_treeView_clicked read the selected password file

Callers

nothing calls this directly

Calls 2

isValidMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected