diff options
Diffstat (limited to 'src/urlnavigator.cpp')
-rw-r--r-- | src/urlnavigator.cpp | 58 |
1 files changed, 45 insertions, 13 deletions
diff --git a/src/urlnavigator.cpp b/src/urlnavigator.cpp index 47eab75..96edc9d 100644 --- a/src/urlnavigator.cpp +++ b/src/urlnavigator.cpp @@ -22,6 +22,7 @@ #include "urlnavigator.h" #include <assert.h> +#include <dcopref.h> #include <kurl.h> #include <tqobjectlist.h> #include <tqcombobox.h> @@ -39,6 +40,7 @@ #include <kurlcombobox.h> #include <kurlcompletion.h> #include <kbookmarkmanager.h> +#include <kstandarddirs.h> #include "dolphin.h" #include "dolphinsettings.h" @@ -81,17 +83,17 @@ URLNavigator::URLNavigator(const KURL& url, m_toggleButton = new TQPushButton(SmallIcon("editurl"), 0, this); m_toggleButton->setFlat(true); m_toggleButton->setToggleButton(true); - m_toggleButton->setFocusPolicy(TQ_NoFocus); + m_toggleButton->setFocusPolicy(TQWidget::NoFocus); m_toggleButton->setMinimumHeight(minimumHeight()); - connect(m_toggleButton, TQT_SIGNAL(clicked()), - this, TQT_SLOT(slotClicked())); + connect(m_toggleButton, TQ_SIGNAL(clicked()), + this, TQ_SLOT(slotClicked())); if (DolphinSettings::instance().isURLEditable()) { m_toggleButton->toggle(); } m_bookmarkSelector = new BookmarkSelector(this); - connect(m_bookmarkSelector, TQT_SIGNAL(bookmarkActivated(int)), - this, TQT_SLOT(slotBookmarkActivated(int))); + connect(m_bookmarkSelector, TQ_SIGNAL(bookmarkActivated(int)), + this, TQ_SLOT(slotBookmarkActivated(int))); m_pathBox = new KURLComboBox(KURLComboBox::Directories, true, this); @@ -99,13 +101,13 @@ URLNavigator::URLNavigator(const KURL& url, m_pathBox->setCompletionObject(kurlCompletion); m_pathBox->setAutoDeleteCompletionObject(true); - connect(m_pathBox, TQT_SIGNAL(returnPressed(const TQString&)), - this, TQT_SLOT(slotReturnPressed(const TQString&))); - connect(m_pathBox, TQT_SIGNAL(urlActivated(const KURL&)), - this, TQT_SLOT(slotURLActivated(const KURL&))); + connect(m_pathBox, TQ_SIGNAL(returnPressed(const TQString&)), + this, TQ_SLOT(slotReturnPressed(const TQString&))); + connect(m_pathBox, TQ_SIGNAL(urlActivated(const KURL&)), + this, TQ_SLOT(slotURLActivated(const KURL&))); - connect(dolphinView, TQT_SIGNAL(contentsMoved(int, int)), - this, TQT_SLOT(slotContentsMoved(int, int))); + connect(dolphinView, TQ_SIGNAL(contentsMoved(int, int)), + this, TQ_SLOT(slotContentsMoved(int, int))); updateContent(); } @@ -117,7 +119,8 @@ void URLNavigator::setURL(const KURL& url) { TQString urlStr(url.prettyURL()); - if (url.protocol() == "zip") { + if (url.protocol() == "zip") + { bool stillInside = false; if( KMimeType::findByPath( url.url(-1) )->is("application/x-zip") || KMimeType::findByPath( url.url(-1) )->is("application/x-jar") ) { @@ -180,6 +183,35 @@ void URLNavigator::setURL(const KURL& url) urlStr = url.path(); } } + else if (urlStr.startsWith("system:/media") || urlStr.startsWith("media:/")) + { + DCOPRef mediamanager("kded", "mediamanager"); + DCOPReply reply = mediamanager.call("mimeType", urlStr ); + if (reply.isValid()) + { + TQString itemMimeType = reply; + if (itemMimeType.contains("encrypted")) + { + if (itemMimeType.contains("encrypted_locked")) + { + TQString lockingService = TDEGlobal::dirs()->findResource("data", "d3lphin/servicemenus/media_unlock.desktop"); + if (!lockingService.isEmpty()) + { + TQValueList<KDEDesktopMimeType::Service> serviceList = KDEDesktopMimeType::userDefinedServices(lockingService, url.isLocalFile()); + if (serviceList.count() == 1) + { + KURL::List m_lstURLs; + m_lstURLs.append(url); + KDEDesktopMimeType::executeService(m_lstURLs, serviceList[0]); + } + } + } + setURL(KURL("system:/media")); + return; + } + } + + } if (urlStr.at(0) == '~') { @@ -410,7 +442,7 @@ void URLNavigator::updateContent() // Don't close and delete the navigator button immediatly, otherwise // the iterator won't work anymore and an object would get deleted more // than once (-> crash). - deleteList.append(TQT_TQWIDGET(object)); + deleteList.append(static_cast<TQWidget*>(object)); } ++it; } |