stolowski / QComicBook

Viewer for comic book archives that aims at convenience and simplicity
https://github.com/stolowski/QComicBook
GNU General Public License v2.0
86 stars 30 forks source link

Strange behavior in QComicsBook 0.8.2 #9

Open JoelMon opened 9 years ago

JoelMon commented 9 years ago

Hello,

I installed QComicsBook 0.8.2 via apt-get and something is not right. A qcomics-????????? folder appears -- ? represents a digit -- where I have ODS files and the ODS file in the directory is deleted. Good thing I had all my work backed up.

Anyone knows why this happens?

I'm using Linux Mint 17 Cinnamon 64bit

stolowski commented 9 years ago

This is very weird. This qcomic-* folders are temporary folders where comic book archives get unpacked; these folders are removed when not needed, but nothing outside of them should ever get removed; are you saying you had documents outside of qcomic-* folder and they got removed?

Also, by default these temporary folders are created in /tmp directory (or whatever QDir::tempPath() thinks is a temporary folder - http://doc.qt.io/qt-4.8/qdir.html#tempPath); what was the directory you saw qcomic-* folder in?

JoelMon commented 9 years ago

Hello @stolowski,

The qcomic-* folders appeared in my Desktop and Document folder, also sub directories in the Document dir.

It seems to appear where I have ODS files and placed in the root dir of the ODS file. Say I have a ~/Document/Work/File.ods then later I find ~/Document/Work/qcomic-* and the File.ods is missing. The deletions were of the ODS files but not the qcomic-* folder.

JoelMon commented 9 years ago

I just ran find ~/ -type d -name 'qcomic-* and found that all my comics cbr files have been deleted but the qcomics-* folder remain in it's place. Also the qcomics-* folder only contains the comicbook JPGs of each page. Also found the problem in my Geneology dir! Files there have been deleted and replaced with qcomics-*. :scream:

Update- It seems that it is going to town with anything that is an archive, zip files too.

stolowski commented 9 years ago

Is it correct to say that qcomic-* folders were created in the same folders which previously held cbr files? Have you modified the setting of temporary path via QComicBook's config dialog?

I'm terribly sorry for the problem you experienced and any data loss it could have caused. This issue has my full attention now and I'm trying to understand what went wrong. Thank you for your report.

JoelMon commented 9 years ago

Some folders that have CBR files were affected but also directories that had no cdr files were touched. For example my ~/Dropbox/Genealogy/books dir that had a book in epub file format was deleted and it's content was in a qcomic-* folder. Every time I found a file missing I would find a qcomic-* folder. Actually, the way I restored my files from CrashPlan was by looking for qcomic-* folders.

Interestingly it affected epub but not mobi formats... It's almost like it went trough my home dir and uncompiled everything that it can, removing the original file and dumping the uncompressed files into a qcomic-* folder.

Also had a zip file deleted and it's content inside a qcomic-* folder. The zip file was the log files of a chat program.

weird...

I didn't change the configuration of the program. Only had it for 2 days or so. Could the problem be with the packaging?

stolowski commented 9 years ago

I've installed Linux Mint 17 Cinnamon in a VM but cannot reproduce the issue... I had partial "success" after adjusting temporary directory path in the settings dialog (after which qcomicbook would create empty qcomic-* folders in my home directory and would unpack images from cbr outside of it; I couldn't however make it remove any files, so no data loss). Also out-of-the-box experience after I installed qcomicbook from the apt-get repository and haven't touched temp dir setting was all fine (all cbrs were unpacked into /tmp/qcomic-*).

Just to double check, can you please attach or paste your ~/.config/PawelStolowski/QComicBook.conf ?

It's definitely not a packaging issue, but it's probably a problem with how qcomicbook unpacks archives into temporary directories, scans them for images or other cbrs (if it finds cbr-inside-cbr it also unpacks it recursievely) and then cleans them up; there must be a bug / edge case with that somewhere...

JoelMon commented 9 years ago

I'll reinstall QComicbook and try it again.

stolowski commented 9 years ago

I wasn't able to reproduce this issue, however in the meantime I got a report from another user who experienced it and claims it's random misbehaviour for him. I'm going to refactor the relevant bit of code to make use of new Qt5 features (QTemporaryDir) and possibly force temporary files to be extracted under /tmp/; that should fix the problem.

GreenLanternX commented 9 years ago

0.9.0 version has the same problem too, includes .zip;.rar;.docx;.xlsx, .odt, .epub it's a random issue, and picks random files in home folder, and documents folder

JoelMon commented 9 years ago

I haven't been reproduce the problem on my side since it first happened.