From d9d7926c49c097fd1f5b72576e2c84c3989e89e7 Mon Sep 17 00:00:00 2001 From: Lukáš Tinkl Date: Tue, 21 Oct 2014 00:27:42 +0200 Subject: port Konqueror from KUrl to QUrl REVIEW: 120650 --- src/views/dolphinview.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 4ed32ed43..3e35be54b 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -80,7 +80,7 @@ namespace { const int MaxModeEnum = DolphinView::CompactView; }; -DolphinView::DolphinView(const KUrl& url, QWidget* parent) : +DolphinView::DolphinView(const QUrl& url, QWidget* parent) : QWidget(parent), m_active(true), m_tabsForFiles(false), @@ -203,7 +203,7 @@ DolphinView::~DolphinView() { } -KUrl DolphinView::url() const +QUrl DolphinView::url() const { return m_url; } @@ -362,12 +362,12 @@ int DolphinView::selectedItemsCount() const return selectionManager->selectedItems().count(); } -void DolphinView::markUrlsAsSelected(const QList& urls) +void DolphinView::markUrlsAsSelected(const QList& urls) { m_selectedUrls = urls; } -void DolphinView::markUrlAsCurrent(const KUrl& url) +void DolphinView::markUrlAsCurrent(const QUrl &url) { m_currentItemUrl = url; m_scrollToCurrentItem = true; @@ -1049,7 +1049,7 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even // Mark the dropped urls as selected. m_clearSelectionBeforeSelectingNewItems = true; m_markFirstNewlySelectedItemAsCurrent = true; - connect(op, static_cast(&KonqOperations::aboutToCreate), this, &DolphinView::slotAboutToCreate); + connect(op, static_cast&)>(&KonqOperations::aboutToCreate), this, &DolphinView::slotAboutToCreate); } setActive(true); @@ -1085,14 +1085,14 @@ void DolphinView::slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons } } -void DolphinView::slotAboutToCreate(const KUrl::List& urls) +void DolphinView::slotAboutToCreate(const QList& urls) { if (!urls.isEmpty()) { if (m_markFirstNewlySelectedItemAsCurrent) { markUrlAsCurrent(urls.first()); m_markFirstNewlySelectedItemAsCurrent = false; } - m_selectedUrls << KUrl::List(KDirModel::simplifiedUrlList(urls)); + m_selectedUrls << KDirModel::simplifiedUrlList(urls); } } @@ -1184,7 +1184,7 @@ void DolphinView::restoreState(QDataStream& stream) stream >> m_restoredContentsPosition; // Restore expanded folders (only relevant for the details view - will be ignored by the view in other view modes) - QSet urls; + QSet urls; stream >> urls; m_model->restoreExpandedDirectories(urls); } @@ -1271,18 +1271,18 @@ KUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh return KUrl(); } -void DolphinView::observeCreatedItem(const KUrl& url) +void DolphinView::observeCreatedItem(const QUrl& url) { if (m_active) { clearSelection(); markUrlAsCurrent(url); - markUrlsAsSelected(QList() << url); + markUrlsAsSelected(QList() << url); } } -void DolphinView::slotDirectoryRedirection(const KUrl& oldUrl, const KUrl& newUrl) +void DolphinView::slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl) { - if (oldUrl.equals(url(), KUrl::CompareWithoutTrailingSlash)) { + if (oldUrl.matches(url(), QUrl::StripTrailingSlash)) { emit redirection(oldUrl, newUrl); m_url = newUrl; // #186947 } @@ -1290,7 +1290,7 @@ void DolphinView::slotDirectoryRedirection(const KUrl& oldUrl, const KUrl& newUr void DolphinView::updateViewState() { - if (m_currentItemUrl != KUrl()) { + if (m_currentItemUrl != QUrl()) { KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager(); const int currentIndex = m_model->index(m_currentItemUrl); if (currentIndex != -1) { @@ -1305,7 +1305,7 @@ void DolphinView::updateViewState() selectionManager->setCurrentItem(0); } - m_currentItemUrl = KUrl(); + m_currentItemUrl = QUrl(); } if (!m_restoredContentsPosition.isNull()) { @@ -1327,7 +1327,7 @@ void DolphinView::updateViewState() KItemSet selectedItems = selectionManager->selectedItems(); - QList::iterator it = m_selectedUrls.begin(); + QList::iterator it = m_selectedUrls.begin(); while (it != m_selectedUrls.end()) { const int index = m_model->index(*it); if (index >= 0) { @@ -1389,7 +1389,7 @@ void DolphinView::slotRenamingResult(KJob* job) KIO::CopyJob *copyJob = qobject_cast(job); Q_ASSERT(copyJob); const QUrl newUrl = copyJob->destUrl(); - const int index = m_model->index(KUrl(newUrl)); + const int index = m_model->index(newUrl); if (index >= 0) { QHash data; const QUrl oldUrl = copyJob->srcUrls().first(); @@ -1650,7 +1650,7 @@ void DolphinView::pasteToUrl(const KUrl& url) if (op) { m_clearSelectionBeforeSelectingNewItems = true; m_markFirstNewlySelectedItemAsCurrent = true; - connect(op, static_cast(&KonqOperations::aboutToCreate), this, &DolphinView::slotAboutToCreate); + connect(op, static_cast&)>(&KonqOperations::aboutToCreate), this, &DolphinView::slotAboutToCreate); } } -- cgit v1.3