SocketAPI: If filename has a trailing slash, remove it.
authorKlaas Freitag <freitag@owncloud.com>
Wed, 11 Mar 2015 13:09:06 +0000 (14:09 +0100)
committerKlaas Freitag <freitag@owncloud.com>
Wed, 11 Mar 2015 13:11:18 +0000 (14:11 +0100)
The SyncJournal stores the the names of directories without trailing slash.

src/gui/socketapi.cpp

index 456511d0f45457cbd72c85b916f5c5d8ed704920..e9b62d95c039b2e96636026fa5025c2627aa2f43 100644 (file)
@@ -491,6 +491,10 @@ SyncJournalFileRecord SocketApi::dbFileRecord_capi( Folder *folder, QString file
         fileName.remove(0, folder->path().length());
     }
 
+    // remove trailing slash
+    if( fileName.endsWith( QLatin1Char('/') ) ) {
+        fileName.truncate(fileName.length()-1);
+    }
     SqlQuery *query = getSqlQuery(folder);
     SyncJournalFileRecord rec;