diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-10-07 15:35:07 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-10-07 15:35:07 -0500 |
commit | 30c2b7e4bd6fa63d0f3431b8e82fefd81364726f (patch) | |
tree | db230ec7e83392ce981cd80912a2b4fdf6f3a206 /tdenewstuff/downloaddialog.cpp | |
parent | e5f898219af927c9bac3aa9b0c9e9473a52dde15 (diff) | |
download | tdelibs-30c2b7e4bd6fa63d0f3431b8e82fefd81364726f.tar.gz tdelibs-30c2b7e4bd6fa63d0f3431b8e82fefd81364726f.zip |
Autodetect downloaded mime type and compare against category; if wallpaper downloads something other than image abort
This relates to Bug 2127
Diffstat (limited to 'tdenewstuff/downloaddialog.cpp')
-rw-r--r-- | tdenewstuff/downloaddialog.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tdenewstuff/downloaddialog.cpp b/tdenewstuff/downloaddialog.cpp index 9744275e4..0eaa0e685 100644 --- a/tdenewstuff/downloaddialog.cpp +++ b/tdenewstuff/downloaddialog.cpp @@ -46,6 +46,7 @@ #include <tqtimer.h> // hack #define OPENDESKTOP_REDIRECT_URL "opendesktop.org/content/download.php?content=" +#define OPENDESKTOP_REDIRECT_TEXT "If the download does not start in 3 seconds:</span><span class=\"defaulttext\"> <a href=\"" using namespace KNS; @@ -609,7 +610,7 @@ void DownloadDialog::slotInstallPhase2() } else { - m_s = new TDENewStuffGeneric(e->type(), this); + m_s = new TDENewStuffGeneric(m_filter, this); m_entry = e; KURL source = e->payload(); KURL dest = KURL(m_s->downloadDestination(e)); @@ -650,6 +651,12 @@ void DownloadDialog::slotJobResult( TDEIO::Job *job ) realURL = e->payload().protocol() + "://opendesktop.org" + realURL; e->setPayload(realURL); } + else if ((pos = mJobData.find(OPENDESKTOP_REDIRECT_TEXT)) > 0) { + pos = pos + strlen(OPENDESKTOP_REDIRECT_TEXT); + TQString realURL = mJobData.mid(pos); + realURL = realURL.mid(0, realURL.find("\">")); + e->setPayload(realURL); + } } slotInstallPhase2(); |