OSDN Git Service

generic: adjust to KUrl changes
authorIvailo Monev <xakepa10@gmail.com>
Mon, 26 Jun 2023 17:48:03 +0000 (20:48 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 26 Jun 2023 17:48:03 +0000 (20:48 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
dolphin/src/views/versioncontrol/versioncontrolobserver.cpp
kcontrol/autostart/autostartitem.cpp
kfind/kfindtreeview.cpp
kfind/kquery.cpp
kioslave/mtp/kio_mtp.cpp
libs/konq/konq_operations.cpp

index ba119b7..ccfac2a 100644 (file)
@@ -251,7 +251,7 @@ int VersionControlObserver::createItemStatesList(QMap<QString, QVector<ItemState
 
     if (items.count() > 0) {
         const KUrl& url = items.first().item.url();
-        itemStates.insert(url.directory(KUrl::AppendTrailingSlash), items);
+        itemStates.insert(url.directory(KUrl::AddTrailingSlash), items);
     }
 
     return index - firstIndex; // number of processed items
index 854ccbe..7a1d006 100644 (file)
@@ -47,7 +47,7 @@ void AutoStartItem::setPath(const QString &path)
 {
     Q_ASSERT(path.endsWith(QDir::separator()));
 
-    if (path == m_fileName.directory(KUrl::AppendTrailingSlash)) {
+    if (path == m_fileName.directory(KUrl::AddTrailingSlash)) {
         return;
     }
 
index f3866b3..db8e43a 100644 (file)
@@ -101,7 +101,7 @@ void KFindItemModel::insertFileItems( const QList< QPair<KFileItem,QString> > &
         {
             QPair<KFileItem,QString> pair = *it;
 
-            QString subDir = m_view->reducedDir(pair.first.url().directory(KUrl::AppendTrailingSlash));
+            QString subDir = m_view->reducedDir(pair.first.url().directory(KUrl::AddTrailingSlash));
             m_itemList.append( KFindItem( pair.first, subDir, pair.second ) );
         }
 
@@ -258,7 +258,7 @@ QVariant KFindItem::data( int column, int role ) const
         switch( column )
         {
             case 0:
-                return m_fileItem.url().fileName(KUrl::ObeyTrailingSlash);
+                return m_fileItem.url().fileName(KUrl::LeaveTrailingSlash);
             case 1:
                 return m_subDir;
             case 2:
index bf84487..50055ff 100644 (file)
@@ -204,7 +204,7 @@ void KQuery::processQuery( const KFileItem &file)
   while ( nextItem.hasNext() )
   {
     QRegExp *reg = nextItem.next();
-    matched = matched || ( reg == 0L ) || ( reg->exactMatch( file.url().fileName( KUrl::IgnoreTrailingSlash ) ) ) ;
+    matched = matched || ( reg == 0L ) || ( reg->exactMatch( file.url().fileName( KUrl::RemoveTrailingSlash ) ) ) ;
   }
   if (!matched)
     return;
index efc695a..84f87fa 100644 (file)
@@ -615,7 +615,7 @@ void MTPSlave::copy(const KUrl& src, const KUrl& dest, int, JobFlags flags)
         }
 
         kDebug(KIO_MTP) << "Copy file" << src.fileName() << "from filesystem to device"
-            << src.directory(KUrl::AppendTrailingSlash) << dest.directory(KUrl::AppendTrailingSlash);
+            << src.directory(KUrl::AddTrailingSlash) << dest.directory(KUrl::AddTrailingSlash);
 
         if (!(flags & KIO::Overwrite) && getPath(dest.path()).first) {
             error(ERR_FILE_ALREADY_EXIST, dest.path());
@@ -627,7 +627,7 @@ void MTPSlave::copy(const KUrl& src, const KUrl& dest, int, JobFlags flags)
         QPair<void*, LIBMTP_mtpdevice_t*> pair = getPath(dest.directory());
 
         if (!pair.first) {
-            error(ERR_DOES_NOT_EXIST, dest.directory(KUrl::AppendTrailingSlash));
+            error(ERR_DOES_NOT_EXIST, dest.directory(KUrl::AddTrailingSlash));
             return;
         }
 
@@ -688,7 +688,7 @@ void MTPSlave::copy(const KUrl& src, const KUrl& dest, int, JobFlags flags)
         }
 
         kDebug(KIO_MTP) << "Copy file" << src.fileName() << "from device to filesystem"
-            << dest.directory(KUrl::AppendTrailingSlash) << dest.directory(KUrl::AppendTrailingSlash);
+            << dest.directory(KUrl::AddTrailingSlash) << dest.directory(KUrl::AddTrailingSlash);
 
         QFileInfo destination(dest.path());
 
index 1280945..95271b0 100644 (file)
@@ -833,7 +833,7 @@ void KonqOperations::slotResult(KJob *job)
 KonqOperations *KonqOperations::rename( QWidget * parent, const KUrl & oldurl, const QString & name )
 {
     KUrl newurl( oldurl );
-    newurl.setPath( oldurl.directory( KUrl::AppendTrailingSlash ) + name );
+    newurl.setPath( oldurl.directory( KUrl::AddTrailingSlash ) + name );
     kDebug(1203) << "KonqOperations::rename("<<name<<") called. newurl=" << newurl;
     return rename( parent, oldurl, newurl );
 }