Bug 442979 - Kate --tempfile argument doesn't work
Summary: Kate --tempfile argument doesn't work
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-26 12:27 UTC by Laurent Montel
Modified: 2022-04-09 15:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 22.08.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Montel 2021-09-26 12:27:23 UTC
Kate --tempfile argument doesn't work


When I use kate for displaying text after calling "auto job = new KIO::OpenUrlJob(QUrl::fromLocalFile(fileName), this);" it will display text without problem.
Code uses "job->setDeleteTemporaryFile(true);" => after discussing with David he explained me that KIO will add --tempfile to process.

I used "ps" commandline for verifing it "/.../kde5-install/bin/kate -b /tmp/DjEPQL.log.txt --tempfile"
=> it's ok but when I close kate, temp file is not removed.

It can be critical as tmp file is not removed.

Regards.
Comment 1 Christoph Cullmann 2022-03-13 21:08:38 UTC
Yeah, looks broken :(
Comment 2 Christoph Cullmann 2022-04-07 19:34:44 UTC
https://invent.kde.org/utilities/kate/-/merge_requests/699
Comment 3 Christoph Cullmann 2022-04-09 08:20:47 UTC
Git commit 2489ddc52604821c5e99870ca9ebe0df5bb38052 by Christoph Cullmann.
Committed on 09/04/2022 at 08:14.
Pushed by cullmann into branch 'master'.

fix --tempfile handling

fixes the handling both for Kate & KWrite

simplifies it to just deleting the files on application exit

this avoids any complex bookkeeping and ensures we really just
delete 1:1 the files passed to the command line that got the

--tempfile

option

M  +14   -0    apps/lib/kateapp.cpp
M  +5    -0    apps/lib/kateapp.h
M  +3    -37   apps/lib/katedocmanager.cpp
M  +2    -6    apps/lib/katedocmanager.h
M  +3    -2    apps/lib/katemainwindow.cpp
M  +7    -13   apps/lib/kateviewmanager.cpp
M  +6    -4    apps/lib/kateviewmanager.h

https://invent.kde.org/utilities/kate/commit/2489ddc52604821c5e99870ca9ebe0df5bb38052