Bug 101274 - files are opened directly without respecting Konqueror settings
Summary: files are opened directly without respecting Konqueror settings
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-10 23:54 UTC by Eckhart Wörner
Modified: 2005-03-11 12:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eckhart Wörner 2005-03-10 23:54:57 UTC
Version:            (using KDE KDE 3.3.92)
Installed from:    SuSE RPMs
OS:                Linux

If you click on a link to a file then the file is opened directly, without asking whether to save it (thus ignoring the settings Konqueror is using for that mime type).

This bug could possibly be a security risk as files that include code execution or exploit other security problems are directly opened.
Comment 1 Frank Osterfeld 2005-03-10 23:58:13 UTC
This is important. We should also add a "Save link as" entry to the context menus.
Comment 2 Frank Osterfeld 2005-03-11 04:09:34 UTC
CVS commit by osterfeld: 

show save|open|cancel dialog for mimetypes we don't handle ourselves 
CCBUG: 101274


  M +1 -1      akregator_run.cpp   1.7


--- kdepim/akregator/src/akregator_run.cpp  #1.6:1.7
@@ -47,5 +47,5 @@ void BrowserRun::foundMimeType( const QS
         m_viewer->openPage(url());
     else
-        KParts::BrowserRun::foundMimeType( type );
+        handleNonEmbeddable(type);
 }
 
Comment 3 Frank Osterfeld 2005-03-11 04:13:32 UTC
CVS commit by osterfeld: 

backport: show save|open|cancel dialog for non-html links
BUG: 101274


  M +1 -0      ChangeLog   1.87.4.2
  M +1 -1      src/akregator_run.cpp   1.5.6.2


--- kdepim/akregator/ChangeLog  #1.87.4.1:1.87.4.2
@@ -7,4 +7,5 @@
 
 Bug fixes:
+        - show open|save|cancel dialog for non-html links (101274)
         - make forms work again (regression) #94964 -fo
 

--- kdepim/akregator/src/akregator_run.cpp  #1.5.6.1:1.5.6.2
@@ -47,5 +47,5 @@ void BrowserRun::foundMimeType( const QS
         m_viewer->openPage(url());
     else
-        KParts::BrowserRun::foundMimeType( type );
+        KParts::BrowserRun::handleNonEmbeddable( type );
 }
 
Comment 4 Frank Osterfeld 2005-03-11 12:05:01 UTC
CVS commit by osterfeld: 

add "save link as" to context menus
CCBUG: 101274


  M +4 -0      ChangeLog   1.90
  M +1 -6      src/pageviewer.cpp   1.37
  M +14 -0     src/viewer.cpp   1.44
  M +4 -2      src/viewer.h   1.26


--- kdepim/akregator/ChangeLog  #1.89:1.90
@@ -6,4 +6,7 @@
 -----------------------------
 
+New features:
+       - add "Save link as" to context menus -fo
+
 Bug fixes:
 
@@ -11,4 +14,5 @@
        - fix regression: non-working forms #94634 -fo
 
+
 Changes after 1.0b9:
 -----------------------------

--- kdepim/akregator/src/pageviewer.cpp  #1.36:1.37
@@ -340,10 +340,5 @@ void PageViewer::slotPopupMenu(KXMLGUICl
                 
         popup.insertSeparator();
-        
-        KAction *savelinkas = action("savelinkas");
-        
-        if (savelinkas)
-                savelinkas->plug( &popup);
-        
+        action("savelinkas")->plug(&popup);    
         KAction* copylinkaddress = action("copylinkaddress");
         if (copylinkaddress)

--- kdepim/akregator/src/viewer.cpp  #1.43:1.44
@@ -83,4 +83,7 @@ SIGNAL(popupMenu (KXMLGUIClient*, const 
                                  this, SLOT(slotCopyLinkAddress()),
                                  actionCollection(), "copylinkaddress");
+    new KAction(i18n("&Save Link As"), "", 0,
+                                 this, SLOT(slotSaveLinkAs()),
+                                 actionCollection(), "savelinkas");
 }
 
@@ -180,4 +183,6 @@ void Viewer::slotPopupMenu(KXMLGUIClient
         popup.insertItem(SmallIcon("tab_new"), i18n("Open Link in New &Tab"), this, SLOT(slotOpenLinkInForegroundTab()));
         popup.insertItem(SmallIcon("window_new"), i18n("Open Link in External &Browser"), this, SLOT(slotOpenLinkInBrowser()));
+        popup.insertSeparator();
+        action("savelinkas")->plug(&popup);
         action("copylinkaddress")->plug(&popup);
    }
@@ -238,4 +243,13 @@ void Viewer::slotOpenLinkInBrowser()
 }
 
+void Viewer::slotSaveLinkAs()
+{
+    KURL tmp( m_url );
+
+    if ( tmp.fileName(false).isEmpty() )
+        tmp.setFileName( "index.html" );
+    KParts::BrowserRun::simpleSave(tmp, tmp.fileName());
+}
+
 void Viewer::slotStarted(KIO::Job *)
 {

--- kdepim/akregator/src/viewer.h  #1.25:1.26
@@ -91,4 +91,6 @@ namespace Akregator
             virtual void slotOpenLinkInBackgroundTab();
             
+            virtual void slotSaveLinkAs();
+
             /** This changes cursor to wait cursor */
             void slotStarted(KIO::Job *);