| Summary: | temporary file from sftp connection is deleted when kate is started from konqueror | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Christoph Burger-Scheidlin <mail> |
| Component: | general | Assignee: | David Faure <faure> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Christoph Burger-Scheidlin
2005-06-13 16:43:25 UTC
I am not so sure that this is kio related any longer. I edited the File association in the command center to replace "kate" with "kate %u" as the executable. Now opening by clicking and by "open with" works. The only reason of this strange behavior that I can think of is that kate detaches itself when executed. If no file association is set in KDE then konqueror downloads the file and executes the program, waits for it to finish and then prompts the user, if the file should be uploaded (if it has changed). This works nicely for kword and kwrite, but for kate, control is returned immediately to konqueror. Since the file has not changed, it gets deleted and kate is stuck without connection, not knowing where the file originally came from. If konqueror passes the entire url to kate, kate knows what to do with the temporary file and when, so the problem no longer exists (and one also does not get the "file has changed" dialog when using kwrite). "kate %u" in the desktop file of Kate tells Konqueror that Kate understands KIO URL's and can edit files directly via sftp. In the default desktop file of Kate does not contain exec="kate %u" this should be fixed. This can differ from distro to distro, but on my Gentoo install the desktop file is correct. So, my guess is that you simply broke your desktop file. Reassigning to Kate anyway. I am not sure if it is a problem with kate at all and if it should not be reassigned to konqueror. It is very liekly that my desktop file broke, since I remember using konqueror/kate successfully earlier. In konqueror the problem remains, that for applications that detach, like kate does, remote connections do not work correctly. Take OpenOffice as an example. It cannot use KIO URLs AFAIK, but works nicely with konqueror, konqueror downloading the file and prompting for upload when oocalc exits. Suppose oocalc would detach like kate does, then konqueror would delete the file like in my example, without the user having the possibility to upload the changes. Apparently, my desktop file breaks, when I add a new association for kate. In the filetypes, "kate %U" is replaced by "kate", leading to the behaviour outlined above. I filed this as bug 107860 for kcmfiletypes. As far as I can tell, this is not a problem of kate. Should this maybe reassigned to konqueror (see comment 3)? SVN commit 427780 by dfaure:
Keep the full Exec line from the existing service, when checking "remember application association for this type of file".
BUG:107860
BUG:107335
M +6 -3 kopenwith.cpp
--- branches/KDE/3.4/kdelibs/kio/kfile/kopenwith.cpp #427779:427780
@@ -624,7 +624,8 @@
void KOpenWithDlg::slotOK()
{
- QString fullExec(edit->url());
+ QString typedExec(edit->url());
+ QString fullExec(typedExec);
QString serviceName;
QString initialServiceName;
@@ -634,7 +635,7 @@
// No service selected - check the command line
// Find out the name of the service from the command line, removing args and paths
- serviceName = KRun::binaryName( fullExec, true );
+ serviceName = KRun::binaryName( typedExec, true );
if (serviceName.isEmpty())
{
// TODO add a KMessageBox::error here after the end of the message freeze
@@ -653,6 +654,7 @@
if ( serv && serv->type() == "Application")
{
QString exec = serv->exec();
+ fullExec = exec;
exec.replace("%u", "", false);
exec.replace("%f", "", false);
exec.replace("-caption %c", "");
@@ -660,7 +662,7 @@
exec.replace("%i", "");
exec.replace("%m", "");
exec = exec.simplifyWhiteSpace();
- if (exec == fullExec)
+ if (exec == typedExec)
{
ok = true;
m_pService = serv;
@@ -680,6 +682,7 @@
// Existing service selected
serviceName = m_pService->name();
initialServiceName = serviceName;
+ fullExec = m_pService->exec();
}
if (terminal->isChecked())
|