mirror of
https://invent.kde.org/plasma/plasma-desktop.git
synced 2026-11-03 22:59:45 -09:00
FolderView: More robust drop url generation
In order to generate a correct url as the dropUrl pass the mappedUrl (with the local part removed) as path for the base url BUG:521713 (cherry picked from commit22788f4199)22788f41FolderView: More robust drop url generation Co-authored-by: Marco Martin <notmart@gmail.com>
This commit is contained in:
parent
e4955cf007
commit
6e8368620e
1 changed files with 4 additions and 3 deletions
|
|
@ -1308,11 +1308,12 @@ void FolderModel::drop(QQuickItem *target, QObject *dropEvent, int row, bool sho
|
|||
if (dropTargetUrl != m_dirModel->dirLister()->url()) {
|
||||
QString mappedUrl = url.toString();
|
||||
const auto local = dropTargetUrl.toString();
|
||||
const auto internal = m_dirModel->dirLister()->url().toString();
|
||||
auto internal = m_dirModel->dirLister()->url();
|
||||
if (mappedUrl.startsWith(local)) {
|
||||
mappedUrl.replace(0, local.size(), internal);
|
||||
mappedUrl.replace(0, local.size(), QString());
|
||||
}
|
||||
return ScreenMapper::stringToUrl(mappedUrl);
|
||||
internal.setPath(mappedUrl);
|
||||
return ScreenMapper::stringToUrl(internal.toString());
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue