You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following sequence should result in moving a file, but instead, it only copies the file:
Open Qtfm and navigate to a folder.
Select a file, right click "Cut"
Select File -> New Window.
In the new window, navigate to some other folder then select Edit -> Paste.
Result:
The file "Cut" in step 2 should be moved to the destination folder and no longer exist in the source folder.
However, Qtfm 6.2.1 incorrectly copies the file to the destination folder while leaving the original file in the source folder.
I have looked around in the source code and tried debugging this problem. From what I've learned, when the user selects files to "Cut" in qtfm, the program stores a list of the selected "Cut" files in "/tmp/qtfm.temp" and also puts some mimeData into the clipboard (but this mimeData does not contain "Urls").
A problem occurs when a new qtfm process is started. Right away, the new qtfm process deletes the "/tmp/qtfm.temp" file for no good reason. Without the temp file, when the user tries to paste, Qtfm no longer thinks of it as a Cut and Paste action and instead does a Copy and Paste.
Qtfm deletes the temp file due to the following code from fm/src/mainwindow.cpp:
void MainWindow::clipboardChanged()
{
qDebug() << "clipboard changed";
if (QApplication::clipboard()->mimeData()) {
// if (QApplication::clipboard()->mimeData()->hasUrls()) {
qDebug() << "clipboard has data, enable paste";
pasteAct->setEnabled(true);
return;
// }
}
// clear tmp and disable paste if no mime
modelList->clearCutItems();
pasteAct->setEnabled(false);
}
Commenting out the if (... hasUrls()) { block (as shown above) seems to fix the problem for me. I do not know if this causes other problems though.
The text was updated successfully, but these errors were encountered:
Not relevant to this bug report and am just pointing out that guessable file names under world read/writable directories like /tmp can be a security issue.
The following sequence should result in moving a file, but instead, it only copies the file:
Result:
The file "Cut" in step 2 should be moved to the destination folder and no longer exist in the source folder.
However, Qtfm 6.2.1 incorrectly copies the file to the destination folder while leaving the original file in the source folder.
I have looked around in the source code and tried debugging this problem. From what I've learned, when the user selects files to "Cut" in qtfm, the program stores a list of the selected "Cut" files in "/tmp/qtfm.temp" and also puts some mimeData into the clipboard (but this mimeData does not contain "Urls").
A problem occurs when a new qtfm process is started. Right away, the new qtfm process deletes the "/tmp/qtfm.temp" file for no good reason. Without the temp file, when the user tries to paste, Qtfm no longer thinks of it as a Cut and Paste action and instead does a Copy and Paste.
Qtfm deletes the temp file due to the following code from fm/src/mainwindow.cpp:
Commenting out the
if (... hasUrls()) {
block (as shown above) seems to fix the problem for me. I do not know if this causes other problems though.The text was updated successfully, but these errors were encountered: