OSDN Git Service

generic: adjust to KUrl changes
authorIvailo Monev <xakepa10@gmail.com>
Sun, 25 Jun 2023 22:41:35 +0000 (01:41 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 25 Jun 2023 22:41:35 +0000 (01:41 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
gwenview/app/mainwindow.cpp
gwenview/importer/thumbnailpage.cpp
gwenview/lib/contextmanager.cpp
kget/core/urlchecker.cpp

index b570a06..d7b84e0 100644 (file)
@@ -970,7 +970,7 @@ void MainWindow::openDirUrl(const KUrl& url)
 {
     const KUrl currentUrl = d->mContextManager->currentDirUrl();
 
-    if (url.equals(currentUrl, KUrl::CompareWithoutTrailingSlash)) {
+    if (url.equals(currentUrl, KUrl::RemoveTrailingSlash)) {
         return;
     }
 
@@ -1039,7 +1039,7 @@ void MainWindow::slotPartCompleted()
 
     KUrl dirUrl = url;
     dirUrl.setFileName(QString());
-    if (dirUrl.equals(d->mContextManager->currentDirUrl(), KUrl::CompareWithoutTrailingSlash)) {
+    if (dirUrl.equals(d->mContextManager->currentDirUrl(), KUrl::RemoveTrailingSlash)) {
         QModelIndex index = d->mDirModel->indexForUrl(url);
         QItemSelectionModel* selectionModel = d->mThumbnailView->selectionModel();
         if (index.isValid() && !selectionModel->isSelected(index)) {
@@ -1145,7 +1145,7 @@ void MainWindow::goToUrl(const KUrl& url)
     }
     KUrl dirUrl = url;
     dirUrl.setFileName("");
-    if (!dirUrl.equals(d->mContextManager->currentDirUrl(), KUrl::CompareWithoutTrailingSlash)) {
+    if (!dirUrl.equals(d->mContextManager->currentDirUrl(), KUrl::RemoveTrailingSlash)) {
         d->mContextManager->setCurrentDirUrl(dirUrl);
         d->mGvCore->addUrlToRecentFolders(dirUrl);
     }
index 1adc088..38225d3 100644 (file)
@@ -362,7 +362,7 @@ public:
         }
         QModelIndex index = sourceModel()->index(sourceRow, 0);
         KFileItem item = itemForIndex(index);
-        return item.url().equals(mUrl, KUrl::CompareWithoutTrailingSlash);
+        return item.url().equals(mUrl, KUrl::RemoveTrailingSlash);
     }
 
     QVariant data(const QModelIndex& index, int role) const // reimp
index 17f4c24..af79236 100644 (file)
@@ -164,7 +164,7 @@ KFileItemList ContextManager::selectedFileItemList() const
 
 void ContextManager::setCurrentDirUrl(const KUrl& url)
 {
-    if (url.equals(d->mCurrentDirUrl, KUrl::CompareWithoutTrailingSlash)) {
+    if (url.equals(d->mCurrentDirUrl, KUrl::RemoveTrailingSlash)) {
         return;
     }
     d->mCurrentDirUrl = url;
index c754645..94c7967 100644 (file)
@@ -115,7 +115,7 @@ void UrlChecker::removeDuplicates(KUrl::List &urls)
     std::sort(urls.begin(), urls.end(), lessThan());//sort the urls, to find duplicates fast
     urls.erase(std::unique(urls.begin(), urls.end(),
                std::bind(&KUrl::equals, std::placeholders::_1, std::placeholders::_2,
-                         KUrl::CompareWithoutTrailingSlash | KUrl::AllowEmptyPath)), urls.end());
+                         KUrl::RemoveTrailingSlash)), urls.end());
 }
 
 UrlChecker::UrlError UrlChecker::checkUrl(const KUrl &url, const UrlChecker::UrlType type, bool showNotification)