diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-05-12 16:42:50 +0300 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-05-12 16:42:50 +0300 |
commit | 752d6256e5204b958b0ef7905675a940b5e9172f (patch) | |
tree | 330d16e6362a49cbed8875a777fe641a43376cd3 /kde-plasma/plasma-desktop/files | |
parent | 0c100b7dd2b30e75b799d806df4ef899fd98e1ea (diff) |
gentoo resync : 12.05.2022
Diffstat (limited to 'kde-plasma/plasma-desktop/files')
2 files changed, 132 insertions, 57 deletions
diff --git a/kde-plasma/plasma-desktop/files/plasma-desktop-5.23.5-attica-add-granular-cache-pref.patch b/kde-plasma/plasma-desktop/files/plasma-desktop-5.23.5-attica-add-granular-cache-pref.patch deleted file mode 100644 index fb4d0bacbd90..000000000000 --- a/kde-plasma/plasma-desktop/files/plasma-desktop-5.23.5-attica-add-granular-cache-pref.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 346dafd3a0e19805f77147a9515a7333a05ed584 Mon Sep 17 00:00:00 2001 -From: Dan Leinir Turthra Jensen <admin@leinir.dk> -Date: Tue, 8 Feb 2022 11:16:16 +0000 -Subject: [PATCH] Add a granular cache preference thing to attica-kde - -Commit 798027fd17ab86eea022e5d269aa86138b28b130 - -This allows us to explicitly add cache preference to specific calls. -Usually attica calls want to be very current, but in some cases we can -assume things aren't going to change often (such as the categories -call), and we can just use the cached version for those calls. - -Fix missing variable name -Commit 8e164050c594855ee3728678d6d0907a10b28db6 - -Only trust the expiration date if it's less than 24 hours -Commit b85cf34298c274b5f16cb6c2aead7b87f0dabbb8 - -Fix build -Commit 6e8626f2d65a03af3cd12fb5390040c56ca3258d ---- - attica-kde/kdeplugin/kdeplatformdependent.cpp | 20 ++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/attica-kde/kdeplugin/kdeplatformdependent.cpp b/attica-kde/kdeplugin/kdeplatformdependent.cpp -index c2c90107e..850c91284 100644 ---- a/attica-kde/kdeplugin/kdeplatformdependent.cpp -+++ b/attica-kde/kdeplugin/kdeplatformdependent.cpp -@@ -125,6 +125,25 @@ QNetworkRequest KdePlatformDependent::addOAuthToRequest(const QNetworkRequest &r - const QString bearer = bearer_format.arg(token); - notConstReq.setRawHeader("Authorization", bearer.toUtf8()); - } -+ -+ // Add cache preference in a granular fashion (we will almost certainly want more of these, but...) -+ static const QStringList preferCacheEndpoints{QLatin1String{"/content/categories"}}; -+ for (const QString &endpoint : preferCacheEndpoints) { -+ if (notConstReq.url().toString().endsWith(endpoint)) { -+ QNetworkCacheMetaData cacheMeta{m_accessManager->cache()->metaData(notConstReq.url())}; -+ if (cacheMeta.isValid()) { -+ // If the expiration date is valid, but longer than 24 hours, don't trust that things -+ // haven't changed and check first, otherwise just use the cached version to relieve -+ // server strain and reduce network traffic. -+ const QDateTime tomorrow{QDateTime::currentDateTime().addDays(1)}; -+ if (cacheMeta.expirationDate().isValid() && cacheMeta.expirationDate() < tomorrow) { -+ notConstReq.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); -+ } -+ } -+ break; -+ } -+ } -+ - return notConstReq; - } - --- -2.34.1 - diff --git a/kde-plasma/plasma-desktop/files/plasma-desktop-5.24.4-folderview-icons-per-resolution.patch b/kde-plasma/plasma-desktop/files/plasma-desktop-5.24.4-folderview-icons-per-resolution.patch new file mode 100644 index 000000000000..fce29f49536a --- /dev/null +++ b/kde-plasma/plasma-desktop/files/plasma-desktop-5.24.4-folderview-icons-per-resolution.patch @@ -0,0 +1,132 @@ +From 8f85c4658adfdf7a01c591afd79baa9eed8b79dd Mon Sep 17 00:00:00 2001 +From: Bharadwaj Raju <bharadwaj.raju777@protonmail.com> +Date: Tue, 12 Apr 2022 15:01:15 +0000 +Subject: [PATCH] Folder View: save desktop containment icon positions on a + per-resolution basis + +BUG: 360478 +BUG: 354802 +FIXED-IN: 5.24.5 +(cherry picked from commit 2dca17060c06f85abc365bab9484ee4446d78772) +--- + .../package/contents/ui/FolderView.qml | 15 +-------- + .../package/contents/ui/FolderViewLayer.qml | 32 +++++++++++++++++-- + .../desktop/plugins/folder/positioner.cpp | 1 + + 3 files changed, 31 insertions(+), 17 deletions(-) + +diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml +index 218a3da77..72ae4903a 100644 +--- a/containments/desktop/package/contents/ui/FolderView.qml ++++ b/containments/desktop/package/contents/ui/FolderView.qml +@@ -30,6 +30,7 @@ FocusScope { + property alias currentIndex: gridView.currentIndex + property alias url: dir.url + property alias status: dir.status ++ property alias perStripe: positioner.perStripe + property alias positions: positioner.positions + property alias errorString: dir.errorString + property alias dragging: dir.dragging +@@ -828,20 +829,6 @@ FocusScope { + } + } + +- onFlowChanged: { +- // FIXME TODO: Preserve positions. +- if (positioner.enabled) { +- positioner.reset(); +- } +- } +- +- onLayoutDirectionChanged: { +- // FIXME TODO: Preserve positions. +- if (positioner.enabled) { +- positioner.reset(); +- } +- } +- + onCurrentIndexChanged: { + positionViewAtIndex(currentIndex, GridView.Contain); + } +diff --git a/containments/desktop/package/contents/ui/FolderViewLayer.qml b/containments/desktop/package/contents/ui/FolderViewLayer.qml +index 3f9b29937..f2044e1b0 100644 +--- a/containments/desktop/package/contents/ui/FolderViewLayer.qml ++++ b/containments/desktop/package/contents/ui/FolderViewLayer.qml +@@ -29,6 +29,8 @@ FocusScope { + property alias overflowing: folderView.overflowing + property alias flow: folderView.flow + ++ property string resolution: Math.round(plasmoid.screenGeometry.width) + "x" + Math.round(plasmoid.screenGeometry.height) ++ + readonly property bool lockedByKiosk: !KAuthorized.authorize("editable_desktop_icons") + + focus: true +@@ -178,6 +180,26 @@ FocusScope { + } + } + ++ function getPositions() { ++ try { ++ var allPositions = JSON.parse(plasmoid.configuration.positions); ++ } catch (err) { ++ var allPositions = {}; ++ allPositions[resolution] = plasmoid.configuration.positions; ++ } ++ return allPositions[resolution] || ""; ++ } ++ ++ function savePositions(positions) { ++ try { ++ var allPositions = JSON.parse(plasmoid.configuration.positions); ++ } catch (err) { ++ var allPositions = {}; ++ } ++ allPositions[resolution] = positions; ++ plasmoid.configuration.positions = JSON.stringify(allPositions, Object.keys(allPositions).sort()); ++ } ++ + Connections { + target: plasmoid.configuration + +@@ -211,7 +233,7 @@ FocusScope { + } + + function onPositionsChanged() { +- folderView.positions = plasmoid.configuration.positions; ++ folderView.positions = getPositions(); + } + } + +@@ -241,12 +263,16 @@ FocusScope { + } + + onPositionsChanged: { +- plasmoid.configuration.positions = folderView.positions; ++ savePositions(folderView.positions); ++ } ++ ++ onPerStripeChanged: { ++ folderView.positions = getPositions(); + } + + Component.onCompleted: { + folderView.sortMode = plasmoid.configuration.sortMode; +- folderView.positions = plasmoid.configuration.positions; ++ folderView.positions = getPositions(); + } + } + +diff --git a/containments/desktop/plugins/folder/positioner.cpp b/containments/desktop/plugins/folder/positioner.cpp +index 859c16754..3b2df8c5a 100644 +--- a/containments/desktop/plugins/folder/positioner.cpp ++++ b/containments/desktop/plugins/folder/positioner.cpp +@@ -854,6 +854,7 @@ void Positioner::applyPositions() + } + + if (pos > m_perStripe) { ++ qDebug() << "Some items did not fit, rearranging"; + name = positions.at(offset); + + if (!sourceIndices.contains(name)) { +-- +GitLab + |