~ubuntu-branches/ubuntu/precise/kde4libs/precise-proposed

« back to all changes in this revision

Viewing changes to kfile/knewfilemenu.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-01-19 13:42:40 UTC
  • mfrom: (1.14.14)
  • Revision ID: package-import@ubuntu.com-20120119134240-2ymgu7507u2nubhv
Tags: 4:4.8.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#include <kio/renamedialog.h>
49
49
#include <kio/netaccess.h>
50
50
#include <kio/fileundomanager.h>
 
51
#include <kio/kurifilter.h>
51
52
 
52
53
#include <kpropertiesdialog.h>
53
54
#include <ktemporaryfile.h>
898
899
    KNameAndUrlInputDialog* dlg = (KNameAndUrlInputDialog*) m_fileDialog;
899
900
    
900
901
    m_strategy.m_chosenFileName = dlg->name(); // no path
901
 
    KUrl linkUrl = dlg->url(); // the url to put in the file
902
 
    
 
902
    KUrl linkUrl = dlg->url();
 
903
 
 
904
    // Filter user input so that short uri entries, e.g. www.kde.org, are
 
905
    // handled properly. This not only makes the icon detection below work
 
906
    // properly, but opening the URL link where the short uri will not be
 
907
    // sent to the application (opening such link Konqueror fails).
 
908
    KUriFilterData uriData;
 
909
    uriData.setData(linkUrl); // the url to put in the file
 
910
    uriData.setCheckForExecutables(false);
 
911
 
 
912
    if (KUriFilter::self()->filterUri(uriData, QStringList() << QLatin1String("kshorturifilter"))) {
 
913
        linkUrl = uriData.uri();
 
914
    }
 
915
 
903
916
    if (m_strategy.m_chosenFileName.isEmpty() || linkUrl.isEmpty())
904
917
        return;
905
918