Version: (using Devel)
Installed from: Compiled sources
In openSUSE pressing "Print" opens ksnaphot which takes a screenshot. If one saves that screenshot as e.g. screenshot to some folder and uses "open with..." after that, the application is given the wrong filename, i.e. the filename that would be used for the next screenshot, in this case it would be screenshot1.
I think "open with" means create a /tmp/kde-user/file and open file in e.g. gimp to modify it. Then you can save it in /home/user/file. This command is not "connected" to "save". Clicking save... changes the name for the next screenshot in the title bar.
a.) screenshot -> save > screenshot > save
b.) screenshot -> open with... gimp > save as..., repeat b.)
I just described the buggy behaviour. And of course they are "connected" as after I saved the image and did not take a new one "open with" must refer to what ksnapshot shows that instant which is what I saved.
Even if not, which would be a bug IMHO, ksnapshot uses a non-existent filename when opening the external app which most certainly is a bug in some technique used for that feature.
Open with is a "follow up" action of what you "see" in ksnapshot, not what is on the hard disk. If you want to open your saved file, you must use another app. Your "Open saved file with..." button would be located right of "Save as...", since it has another meaning. If you modify your saved file, what do you "Open with..." now ?
a) the modified file [you]
b) what you see in ksnapshot in the preview window [me]
The "non-existent filename" in the title bar is the filename in the /tmp folder or the proposed filename for the next "Save as..." if you want to have multiple copies/screenshots.
Different views -> different thoughts
Sorry, but you are simply wrong. No matter what, open with... should open a file, be it the temp file or what I saved. Yet it does not, that's a bug.
It worked before, it stopped, it's a bug.
"What you see, is what you get". When you click "open with", the "internal snapshot" is saved to the /tmp/kde-user/ folder and that file as shown in the title bar is opened. There is no logic like:
"if there is a file saved within the last 20 secs but not modified, then do open that file instead of a copy of the "internal snapshot".
Why not satisfy your wish by first clicking "Open with" and then in the external app you can choose "Save as..." when you are happy with the result.
Choose "Save as..." in ksnapshot if no checking or modifying is necessary.
gimp: select -> copy -> insert as > new picture > save
Please read before you write!
ksnaphot does _not_ open the tempfile it shows in its GUI. It does _not_ open _any_ file.
In openSUSE 11.2 it does. I have dolphin with /tmp/kde-hrd/ and ksnapshot open, and then I press in ksnapshot "Open with..." gwenview or gimp and whoop the file appears in dolphin and gwenview shows the snapshot. Maybe your system is different and then you may forget what I wrote, sorry.
"What I see, is what I get"
If you want evidence, you can use the "strace" command in konsole:
> strace -e open -o output ksnapshot
> kwrite output
open("/tmp/kde-hrd/Bug 237353 - 4.png", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE|O_CLOEXEC, 0666) = 11
Are you using the packages from unstable, i.e. kde trunk? This bug is not about KDE 4.3 or KDE 4.4 it's about KDE 4.5 revision 1123195 as you can see in the headers of my first comment.
When I carefully try to read the Description of Bug 237353, and use the strace command in Comment #8 and then
> cat output|grep "Bug 23735"
open("/home/hrd/Dokumente/Bug 237353.png", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE|O_CLOEXEC, 0666) = 14 -> "Save as..."
open("/tmp/kde-hrd/Bug 237354.png", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE|O_CLOEXEC, 0666) = 14 -> "Open with..." gwenview
I get evidence of your Description.
Can confirm that the problem summarised in comment #6 still exists with current KDE trunk (as of r1122514).
Open KSnapshot with an empty ksnapshotrc file (i.e. no file name history). An image will be captured and the window title says "snapshot1.png".
Click "Open With - Okular". Okular reports "Could not open file:///home/user/snapshot1.png". Not surprising, because it doesn't exist.
Click "Save As" then "Save" with the default name. The file is created, and the window title changes to "snapshot2.png".
Click "Open With - Okular" again. Okular reports "Could not open file:///home/user/snapshot2.png".
Now here's another twist. Click "New Snapshot", the title now says "snapshot2.png [modified]". Click "Open With - Okular" and the file is opened from /tmp/kde-user (no file of that name has been saved in the default save location, i.e. home directory).
Possible solution: the initial snapshot taken when ksnapshot starts should set the "[modified]" status, as this is true (the file does not exist on disc), so that "Open With" will use a temporary file.
Created attachment 43775 [details]
Patch to fix
Proposed patch to fix.
Set the initial snapshot state to "modified", clear this when the snapshot is saved as before. Auto-increment the file name only when a new snapshot is taken, not when it is saved (whether under the default name or "as").
Tested following the above scenario, the title bar and modified state correctly reflect whether the file has been saved and its on-disc file name. Open With works as expected whether the file has been saved or not.
Does this patch cause a problem if the snapshot is saved twice? It sounds like the filename wouldn't be increamented.
Regarding comment #13: yes, that is true. But then that is the same as the behaviour of any other application (e.g. KWrite) - repeatedly saving the same file doesn't increment the file name.
Hello, I'm not sure if my bug is related to this one, but I presume it is:
1. Initial state: in ksnapshotrc in [GENERAL] section there is line filename[$e]=file://$HOME/tmp/AAA/snapshot.png
- take a screenshot and save it with different name in different directory as $HOME/picture.png
--> a new name of new created screenshot is suggested as picture1.png
--> the filename line in ksnapshotrc changes to filename[$e]=file://$HOME/picture1.png
3. after every "save as" operation the default directory changes to last saved one and the screenshot name changes to last saved one+1.
Is this correct behaviour? I think the filename line has to stay unchanged. Or is there any reason to dynamicly changed filename line? I understand the counting of names in case of multiples screenshots, but why to change the whole address?
KDE 4.5 RC1, Fedora12 x86_64, installed from kde-redhat-unstable repo.
(In reply to comment #1)
> I think "open with" means create a /tmp/kde-user/file and open file in e.g.
> gimp to modify it. Then you can save it in /home/user/file. This command is not
> "connected" to "save". Clicking save... changes the name for the next
> screenshot in the title bar.
> a.) screenshot > save > screenshot > save
> b.) screenshot > open with... gimp > save as..., repeat b.)
KDE 4.5.0 doesn't pass test case b.) anymore (Could not open file).
c.) screenshot > save > open with... doesn't work either (Could not open file).
Same problem here with KDE 4.5.1 on OpenSuSE 11.3, testcase b.) doesn't work. It worked before with KDE 4.4.X
*** Bug 261039 has been marked as a duplicate of this bug. ***
Still valid for KDE 4.6 RC2.
*** This bug has been marked as a duplicate of bug 258431 ***