Warning, /plasma/latte-dock/containment/package/contents/ui/abilities/Indexer.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 import QtQuick 2.7
0007 import org.kde.plasma.plasmoid 2.0
0008 
0009 import "./privates" as Ability
0010 
0011 Ability.IndexerPrivate {
0012     objectName: "IndexerAbilityHost"
0013 
0014     //! do not update during dragging/moving applets inConfigureAppletsMode
0015     updateIsBlocked: (root.dragOverlay && root.dragOverlay.pressed)
0016                      || layouter.appletsInParentChange
0017 
0018     function getClientBridge(index) {
0019         if (clientsBridges.length<=0) {
0020             return false;
0021         }
0022 
0023         var ibl = clientsBridges.length;
0024 
0025         for(var i=0; i<ibl; ++i) {
0026             if (clientsBridges[i].appletIndex === index) {
0027                 return clientsBridges[i];
0028             }
0029         }
0030 
0031         return false;
0032     }
0033 
0034     function appletIdForVisibleIndex(itemVisibleIndex) {
0035         var sLayout = layouts.startLayout;
0036         for (var i=0; i<sLayout.children.length; ++i){
0037             var appletItem = sLayout.children[i];
0038 
0039             if (visibleIndexBelongsAtApplet(appletItem, itemVisibleIndex)) {
0040                 return appletItem.applet ? appletItem.applet.id : -1;
0041             }
0042         }
0043 
0044         var mLayout = layouts.mainLayout;
0045         for (var i=0; i<mLayout.children.length; ++i){
0046             var appletItem = mLayout.children[i];
0047 
0048             if (visibleIndexBelongsAtApplet(appletItem, itemVisibleIndex)) {
0049                 return appletItem.applet ? appletItem.applet.id : -1;
0050             }
0051         }
0052 
0053         var eLayout = layouts.endLayout;
0054         for (var i=0; i<eLayout.children.length; ++i){
0055             var appletItem = eLayout.children[i];
0056 
0057             if (visibleIndexBelongsAtApplet(appletItem, itemVisibleIndex)) {
0058                 return appletItem.applet ? appletItem.applet.id : -1;
0059             }
0060         }
0061 
0062         return -1;
0063     }
0064 }