Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:serantes:branches:openSUSE:Factory
baloo5
fix-for-rename-bug-392793.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-for-rename-bug-392793.patch of Package baloo5
qt-bugs@ issue : None Trolltech task ID : None bugs.kde.org number : 392793 applied: no author: Ignacio Serantes <kde@aynoa.net> Renamed files and directories lost all File Name Terms. --- a/src/file/metadatamover.cpp +++ b/src/file/metadatamover.cpp @@ -95,6 +95,23 @@ void MetadataMover::updateMetadata(Transaction* tr, const QString& from, const Q quint64 parentId = tr->documentId(parentPath); if (!parentId) { qCDebug(BALOO) << "Parent directory not (yet) known, signaling newFile" << to; + + auto previousSlash = toPath.lastIndexOf('/', toPath.size() - 2); + const QByteArray dirParentPath = toPath.left(previousSlash); + const quint64 dirParentId = tr->documentId(dirParentPath); + + if (dirParentId) { + // Only if parent dir has Id. + Document doc; + TermGenerator tg(doc); + tg.indexFileNameText(QFile::decodeName(toPath.mid(previousSlash + 1, lastSlash - previousSlash - 1))); + + doc.setId(id); + doc.setParentId(dirParentId); + doc.setUrl(toPath.left(lastSlash)); + tr->replaceDocument(doc, DocumentUrl | FileNameTerms); + } + Q_EMIT movedWithoutData(QFile::decodeName(parentPath)); return; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor