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

Method copyPasswordFromTreeview

src/mainwindow.cpp:1367–1380  ·  view source on GitHub ↗

* @brief Copies the password of the selected file from the tree view to the * clipboard. * @example * MainWindow::copyPasswordFromTreeview(); * * @return void - This function does not return a value. */

Source from the content-addressed store, hash-verified

1365 * @return void - This function does not return a value.
1366 */
1367void MainWindow::copyPasswordFromTreeview() {
1368 QFileInfo fileOrFolder =
1369 model.fileInfo(proxyModel.mapToSource(ui->treeView->currentIndex()));
1370
1371 if (fileOrFolder.isFile()) {
1372 QString file = getFile(ui->treeView->currentIndex(), true);
1373 // Disconnect any previous connection to avoid accumulation
1374 disconnect(QtPassSettings::getPass(), &Pass::finishedShow, this,
1375 &MainWindow::passwordFromFileToClipboard);
1376 connect(QtPassSettings::getPass(), &Pass::finishedShow, this,
1377 &MainWindow::passwordFromFileToClipboard);
1378 QtPassSettings::getPass()->Show(file);
1379 }
1380}
1381
1382void MainWindow::passwordFromFileToClipboard(const QString &text) {
1383 QStringList tokens = text.split('\n');

Callers

nothing calls this directly

Calls 1

ShowMethod · 0.45

Tested by

no test coverage detected