Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletion of folder doesn't work on Debian/GNU Linux #181

Closed
tobiasvandriessel opened this issue May 30, 2016 · 7 comments
Closed

Deletion of folder doesn't work on Debian/GNU Linux #181

tobiasvandriessel opened this issue May 30, 2016 · 7 comments

Comments

@tobiasvandriessel
Copy link

Deletion of folders doesn't work on Debian/GNU Linux, both in root of password folder and in the sub folders: After clicking 'Yes' on the dialog window showing 'Are you sure [...]?', it just shows 'Updating password-store' but nothing is deleted. After deleting it manually from CLI, it is removed from the overview.

@annejan
Copy link
Member

annejan commented May 30, 2016

I'll try this on my Debian "stretch" install this evening . .

Are you using the packaged version (apt-get install) or did you build QtPass from source?

@tobiasvandriessel
Copy link
Author

tobiasvandriessel commented May 30, 2016

I'm also on stretch and I used the packaged version.

@tobiasvandriessel
Copy link
Author

Some handy information: This only happens when the folder is created and then removed (so still empty), when it's not empty it's removed and when the only item in it is removed, it is also removed.

@annejan
Copy link
Member

annejan commented May 30, 2016

Ahh . . thanks!!

I'm 90% sure this is a git thing.
Empty folders are not added to git and hence can't be deleted by git.
This is something I have to fix though since it is very inconsistent . .

@tobiasvandriessel
Copy link
Author

Ah that explains a lot, I think you can increase that chance haha. Let me know if I can help in any way!

@tobiasvandriessel
Copy link
Author

Following the next code block is the structure of on_deleteButton_clicked() with a lot left out and my naive view says you have to insert

if (usePass) {
      currentAction = DELETE;
      executePass("rm -f \"" + file + '"');
      if (useGit && autoPush)
        on_pushButton_clicked();
    }

just after the second if (QMessageBox::question([...])){ return; } and before the following else (this else is also redundant, if this block is not inserted):

if (fileOrFolder.isFile()) {
    file = getFile(ui->treeView->currentIndex(), usePass);
    if (QMessageBox::question([...]))
      return;
    if (usePass) {
      currentAction = DELETE;
      executePass("rm -f \"" + file + '"');
      if (useGit && autoPush)
        on_pushButton_clicked();
    } else {
      if (useGit) {
        if (autoPush)
          on_pushButton_clicked();
      } else {
        QFile(file).remove();
      }
    }
  } else {
    file = getDir(ui->treeView->currentIndex(), usePass);
    // TODO: message box should accept enter key
    if (QMessageBox::question([...])){
      return;
    } else {
      if (useGit) {
        if (autoPush)
          on_pushButton_clicked();
      } else {
          [...]
      }
    }
  }

I might just be very wrong, but I hope this helps and if so, it might just have been a bad copying job :P

@annejan
Copy link
Member

annejan commented May 30, 2016

I can reproduce the issue on OSX and Arch.

And I have tried your fix, which only needed some minor tweaks executePass("rm -rf \"" + file + '"'); and adding another exception for using native and git . .

Testing some more but thanks for the help so-far 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants