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

Comments

Projects
None yet
2 participants
@tobiasvandriessel

tobiasvandriessel commented May 30, 2016

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

This comment has been minimized.

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

This comment has been minimized.

tobiasvandriessel commented May 30, 2016

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

@tobiasvandriessel

This comment has been minimized.

tobiasvandriessel commented May 30, 2016

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

This comment has been minimized.

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

This comment has been minimized.

tobiasvandriessel commented May 30, 2016

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

@tobiasvandriessel

This comment has been minimized.

tobiasvandriessel commented May 30, 2016

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

This comment has been minimized.

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