1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-25 19:21:41 +03:00

fix warnings

This commit is contained in:
Michail Vourlakos 2020-05-15 20:21:24 +03:00
parent 23f3c1f5c1
commit 14a6d73284
5 changed files with 26 additions and 13 deletions

View File

@ -247,8 +247,12 @@ Item{
Binding{
target: latteView
property: "isTouchingTopViewAndIsBusy"
when: latteView
when: root.viewIsAvailable
value: {
if (!root.viewIsAvailable) {
return false;
}
var isTouchingTopScreenEdge = (latteView.y === latteView.screenGeometry.y);
var hasTopBorder = ((latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.TopBorder)) > 0);
@ -261,6 +265,10 @@ Item{
property: "isTouchingBottomViewAndIsBusy"
when: latteView
value: {
if (!root.viewIsAvailable) {
return false;
}
var latteBottom = latteView.y + latteView.height;
var screenBottom = latteView.screenGeometry.y + latteView.screenGeometry.height;
var isTouchingBottomScreenEdge = (latteBottom === screenBottom);
@ -514,7 +522,7 @@ Item{
///test maskArea
function updateMaskArea() {
if (!latteView || blockUpdateMask) {
if (!latteView || !root.viewIsAvailable || blockUpdateMask) {
return;
}
@ -522,7 +530,7 @@ Item{
var localY = 0;
normalState = ((animations.needBothAxis.count === 0) && (animations.needLength.count === 0))
|| (latteView.visibility.isHidden && !latteView.visibility.containsMouse && animations.needThickness.count === 0);
|| (latteView && latteView.visibility.isHidden && !latteView.visibility.containsMouse && animations.needThickness.count === 0);
// debug maskArea criteria
@ -974,6 +982,10 @@ Item{
}
function init() {
if (!root.viewIsAvailable) {
return;
}
inSlidingIn = true;
if (slidingAnimationAutoHiddenOut.running) {
@ -993,7 +1005,7 @@ Item{
id: slidingInRealFloating
PropertyAnimation {
target: latteView.positioner
target: latteView ? latteView.positioner : null
property: "slideOffset"
to: 0
duration: manager.animationSpeed
@ -1005,7 +1017,7 @@ Item{
id: slidingOutRealFloating
PropertyAnimation {
target: latteView.positioner
target: latteView ? latteView.positioner : null
property: "slideOffset"
to: plasmoid.configuration.screenEdgeMargin
duration: manager.animationSpeed
@ -1016,6 +1028,10 @@ Item{
Connections {
target: root
onHideThickScreenGapChanged: {
if (!latteView || !root.viewIsAvailable) {
return;
}
if (root.behaveAsPlasmaPanel && !latteView.visibility.isHidden && !inSlidingIn && !inSlidingOut && !inStartup) {
if (hideThickScreenGap) {
latteView.positioner.inSlideAnimation = true;

View File

@ -31,11 +31,11 @@ Loader {
TaskManager.TasksModel {
id: tasksModel
virtualDesktop: virtualDesktopInfo.currentDesktop
screenGeometry: latteView.screenGeometry
screenGeometry: latteView ? latteView.screenGeometry : Qt.rect(-1, -1, 0, 0)
activity: activityInfo.currentActivity
filterByVirtualDesktop: true
filterByScreen: true
filterByScreen:latteView ? true : false
filterByActivity: true
launchInPlace: true

View File

@ -104,6 +104,8 @@ Item {
readonly property bool behaveAsDockWithMask: !behaveAsPlasmaPanel
readonly property bool viewIsAvailable: latteView && latteView.visibility && latteView.effects
property int viewType: {
var staticLayout = (plasmoid.configuration.minLength === plasmoid.configuration.maxLength);

View File

@ -208,7 +208,7 @@ Item {
svg: groupSvg
elementId: elementForLocation(plasmoid.location)
readonly property QtObject groupSvg: indicator.resources.svgs.length > 0 ? indicator.resources.svgs[0] : null
readonly property QtObject groupSvg: indicator.resources && indicator.resources.svgs.length > 0 ? indicator.resources.svgs[0] : null
function elementForLocation(location) {
switch (location) {

View File

@ -47,11 +47,6 @@ Item {
updateTasksEdgesIndexes();
}
Component.onDestruction: {
parManager.sglUpdateLowerItemScale.disconnect(sltTrackLowerItemScale);
parManager.sglUpdateHigherItemScale.disconnect(sltTrackHigherItemScale);
}
function updateTasksEdgesIndexes() {
var newFirstTask = firstRealTask();
var newLastTask = lastRealTask();