diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2015-06-14 18:55:53 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2015-06-14 19:01:34 +0200 |
commit | ed61b1416075b3509b7f1672338182dc21d79d60 (patch) | |
tree | 11bbc148b71d1fe16f51a01faefcab39bfb525ef | |
parent | d7f7fa1f8cc8a5a5ee52ff09bf281366b9ccd3db (diff) |
Fix relative-path pass-store.
-rw-r--r-- | mainwindow.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index cc39d347..120ad5c3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -394,13 +394,15 @@ void MainWindow::on_pushButton_clicked() QString MainWindow::getDir(const QModelIndex &index, bool forPass) { + QString abspath = QDir(passStore).absolutePath() + '/'; if (!index.isValid()) { - return forPass ? "" : passStore; + return forPass ? "" : abspath; } QFileInfo info = model.fileInfo(proxyModel.mapToSource(index)); QString filePath = (info.isFile() ? info.absolutePath() : info.absoluteFilePath()) + '/'; if (forPass) { filePath.replace(QRegExp("^" + passStore), ""); + filePath.replace(QRegExp("^" + abspath), ""); } return filePath; } |