Bug 107860 - "Open With" behaves differently than default association
Summary: "Open With" behaves differently than default association
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_filetypes (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Marie Loise Nolden
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-21 17:04 UTC by Christoph Burger-Scheidlin
Modified: 2005-06-21 22:09 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Burger-Scheidlin 2005-06-21 17:04:47 UTC
Version:            (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1) 
OS:                Linux

Setup: SFTP connection with konqueror, trying to open file of unknown/unassociated extension. 

If I select kate in the list of applications, kate opens the file sftp://......
Apparently, konqueror executes "kate %U", giving kate the whole file name.

Now I did the same but ticked "Remember application association for this type of file"
Kate starts up, but displays file://.... Checking the file associtations tab, the association shows up to only execute "kate" and not "kate %U".

I would expect the file association to be made to reflect just what happens when I do not tick "Remember...".

Note: this bug is related to bug 107335, insofar as it has the same setup. 107335 deals with konqueror deleting the temporary file for kate, since it returns control to konqueror
Comment 1 Maksim Orlovich 2005-06-21 17:11:53 UTC
Filed twice
Comment 2 Christoph Burger-Scheidlin 2005-06-21 17:22:14 UTC
I get exactly one bug on my query for the summary (all bug categories). I did submit twice, but only because I got an "Internal Server Error" on my first attempt and assumed (correctly as it appears) that the bug was not entered the first time.
Comment 3 Christoph Burger-Scheidlin 2005-06-21 17:24:09 UTC
It appears, that all of my file associations with kate get overridden. Do I need to write "kate %U" in the box where it asks me for the application to run? So far I just put "kate"
Comment 4 Maksim Orlovich 2005-06-21 20:40:24 UTC
see also bug #81133
Comment 5 David Faure 2005-06-21 22:09:39 UTC
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())