Bug 324962 - Having a file saved, creating a new one, and saving it as same name merges tab and shows dirty flag
Summary: Having a file saved, creating a new one, and saving it as same name merges ta...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: All editors (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-16 14:37 UTC by Shaun Reich
Modified: 2023-02-09 03:54 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shaun Reich 2013-09-16 14:37:10 UTC
This is a regression.

(see steps to repro).

It seems that it wants to merge them now (the tabs), but since it does this you now have no possible way to get your data back, as it just removed the only way. That is, previously you would have one tab  (which is now renamed as the overwritten file) with the new contents, and the old tab of the same name but with the option to reload or resave.

I was depending on that resave functionality, so now my file's data is gone.

(not sure if this just applies to cpp or not. I assume it applies to everything).

Reproducible: Always

Steps to Reproduce:
1. Create a new file in kdevelop called 'test.cpp' (or whatever). (saving it)
2. Create a new file in kdevelop, and save this as the same name and confirm the overwrite 
3. Suddenly, the two tabs of the files have merged into one..the new one, and shows a reload symbol and prompts to reload, view differences, or ignore.
4. Your data in the first file is gone, enjoy :D
Actual Results:  
Data goes bye bye.

Expected Results:  
Not losing my entire source file that I just made :(
Comment 1 Manasij Mukherjee 2013-09-17 05:09:57 UTC
Shouldn't that be the expected behaviour?
You already confirmed the overwrite..so "Reload" loads the new data.
Comment 2 Shaun Reich 2013-09-17 12:02:08 UTC
But then how could I save a file into the place of another and save the other one into the first one's place without overwriting and going through a drawn out process? I tend to accidentally start making .h code in a .cpp file and vice versa.

So no, this isn't the behavior I'd expect, especially since the tabs have merged and the file I just saved into now has a prompt to reload, which doesn't make sense because I just saved it.

So yeah. I don't see how it could be expected behavior.
Comment 3 Milian Wolff 2013-12-01 16:11:37 UTC
I agree that the behavior with the reload button is odd, but otherwise this is expected behavior. You cannot have two different documents with the same url. Thus they are merged. 

You wrote:
"But then how could I save a file into the place of another and save the other one into the first one's place without overwriting and going through a drawn out process?"

I assume you mean swapping two files, yes? Personally I use copy'n'paste for that. You could e.g. copy the contents of A, then save B as A and paste the contents of A into a new file B.

Note that imo this is such an uncommon thing to do that I'm perfectly fine with the way it is right now.

But you mention a regression, the code in place for that did not change recently. So I have no idea what you mean by that comment. The behavior is like that for years already as far as I can see.

Imo the bug is that there is no way to "restore" the old data which you confirmed to overwrite. Maybe eventually such functionality could be added to the undo buffer to restore the previous file contents somehow.
Comment 4 Andrew Crouthamel 2018-11-11 04:32:26 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-11-21 04:37:59 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Justin Zobel 2023-01-10 01:52:22 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 7 Bug Janitor Service 2023-01-25 05:05:49 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Bug Janitor Service 2023-02-09 03:54:02 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!