Folders which don't have non-directory entries as their first level children won't be added to RAR archives
Closed, ResolvedPublic

Description

Folders which don't have non-directory entries as their first level children won't be added to RAR archives.

For testing you can recreate the following file structure:
folder/
folder/folder1/
folder/folder2/
folder/folder2/file.txt

If you try to add folder/ or folder/folder1/, they won't be added to RAR archive, but folder/folder2/ will.

mvlabat created this task.Jul 6 2016, 7:00 PM
mvlabat renamed this task from Folders which have only other folders as their first level children won't be added to RAR archives to Folders which don't have non-directory entries as their first level children won't be added to RAR archives.Jul 6 2016, 7:03 PM
mvlabat updated the task description. (Show Details)

P.S. just discovered that subfolders are not added at all.
folder/
folder/subfolder/subfile.txt
folder/file.txt

If you add folder/, only folder/ and folder/file.txt entries will be added. Tested on the latest master (13721e2a673a578ac955fb4f4be8e409668b3f84).

I can reproduce both issues on master...

This is weird, needs more investigating

Confirming that even non-empty subfolders are not added. This is a serious bug.

I found the reason! It's the slash that ark adds after the folder name. It causes rar to not add any subfolders of it.

Ragnar, can you try to add a test case for this in addtoarchivetest?
Il 09 lug 2016 10:34 AM, "rthomsen (Ragnar Thomsen)" <
noreply@phabricator.kde.org> ha scritto:

Ragnar, can you try to add a test case for this in addtoarchivetest?

The damage is done in Part::slotAddFiles() where a trailing slash is added to all folders. Since AddToArchive doesn't involve Part at all, this is not the right place to catch this bug.
I tried simply commenting out line 1192 in part.cpp and then subfolders are added correctly for rar archives. However, I guess we are adding the trailing slash for a reason so this needs further investigation.

elvisangelaccio moved this task from Backlog to In progress on the Ark board.Jul 10 2016, 3:15 PM
rthomsen claimed this task.Jul 17 2016, 4:55 PM
rthomsen moved this task from In progress to Under review on the Ark board.Jul 17 2016, 5:02 PM
rthomsen moved this task from Under review to Done on the Ark board.Jul 18 2016, 4:48 PM
elvisangelaccio closed this task as Resolved.Aug 16 2016, 5:15 PM