From c72ee78bbbc47c30ebabf03c7e99394dcf87779c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 8 Apr 2019 13:31:21 +0200 Subject: [PATCH] mov the mobile text actions in own import this avoids a qml type resolution recurtion which can in some cases stuck the component to loading forever this was particularly visible in plasma mobile --- src/declarativeimports/plasmacomponents3/ComboBox.qml | 3 ++- src/declarativeimports/plasmacomponents3/TextArea.qml | 3 ++- src/declarativeimports/plasmacomponents3/TextField.qml | 3 ++- .../{private => mobiletextselection}/MobileCursor.qml | 0 .../MobileTextActionsToolBar.qml | 3 +-- .../plasmacomponents3/mobiletextselection/qmldir | 3 +++ src/declarativeimports/plasmacomponents3/private/qmldir | 2 -- 7 files changed, 10 insertions(+), 7 deletions(-) rename src/declarativeimports/plasmacomponents3/{private => mobiletextselection}/MobileCursor.qml (100%) rename src/declarativeimports/plasmacomponents3/{private => mobiletextselection}/MobileTextActionsToolBar.qml (98%) create mode 100644 src/declarativeimports/plasmacomponents3/mobiletextselection/qmldir diff --git a/src/declarativeimports/plasmacomponents3/ComboBox.qml b/src/declarativeimports/plasmacomponents3/ComboBox.qml index 082f67008..7cfa477d9 100644 --- a/src/declarativeimports/plasmacomponents3/ComboBox.qml +++ b/src/declarativeimports/plasmacomponents3/ComboBox.qml @@ -25,6 +25,7 @@ import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.5 as Kirigami import "private" as Private +import "mobiletextselection" as MobileTextSelection T.ComboBox { id: control @@ -154,7 +155,7 @@ T.ComboBox { opacity: control.enabled ? 1 : 0.3 onFocusChanged: { if (focus) { - Private.MobileTextActionsToolBar.controlRoot = textField; + MobileTextSelection.MobileTextActionsToolBar.controlRoot = textField; } } diff --git a/src/declarativeimports/plasmacomponents3/TextArea.qml b/src/declarativeimports/plasmacomponents3/TextArea.qml index 4222f100c..c3b4c9758 100644 --- a/src/declarativeimports/plasmacomponents3/TextArea.qml +++ b/src/declarativeimports/plasmacomponents3/TextArea.qml @@ -24,6 +24,7 @@ import QtQuick.Templates @QQC2_VERSION@ as T import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private import org.kde.kirigami 2.5 as Kirigami +import "mobiletextselection" as MobileTextSelection T.TextArea { id: control @@ -78,7 +79,7 @@ T.TextArea { onFocusChanged: { if (focus) { - Private.MobileTextActionsToolBar.controlRoot = control; + MobileTextSelection.MobileTextActionsToolBar.controlRoot = control; } } diff --git a/src/declarativeimports/plasmacomponents3/TextField.qml b/src/declarativeimports/plasmacomponents3/TextField.qml index 1395bbf95..5ce213aef 100644 --- a/src/declarativeimports/plasmacomponents3/TextField.qml +++ b/src/declarativeimports/plasmacomponents3/TextField.qml @@ -24,6 +24,7 @@ import QtQuick.Templates @QQC2_VERSION@ as T import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private import org.kde.kirigami 2.5 as Kirigami +import "mobiletextselection" as MobileTextSelection T.TextField { id: control @@ -57,7 +58,7 @@ T.TextField { } onFocusChanged: { if (focus) { - Private.MobileTextActionsToolBar.controlRoot = control; + MobileTextSelection.MobileTextActionsToolBar.controlRoot = control; } } diff --git a/src/declarativeimports/plasmacomponents3/private/MobileCursor.qml b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml similarity index 100% rename from src/declarativeimports/plasmacomponents3/private/MobileCursor.qml rename to src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml diff --git a/src/declarativeimports/plasmacomponents3/private/MobileTextActionsToolBar.qml b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml similarity index 98% rename from src/declarativeimports/plasmacomponents3/private/MobileTextActionsToolBar.qml rename to src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml index d4df4f1c8..9b14748da 100644 --- a/src/declarativeimports/plasmacomponents3/private/MobileTextActionsToolBar.qml +++ b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml @@ -23,7 +23,6 @@ import QtQuick 2.1 import QtQuick.Layouts 1.2 import QtQuick.Window 2.2 import QtQuick.Controls @QQC2_VERSION@ -import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.5 as Kirigami Popup { @@ -81,4 +80,4 @@ Popup { } } } - + diff --git a/src/declarativeimports/plasmacomponents3/mobiletextselection/qmldir b/src/declarativeimports/plasmacomponents3/mobiletextselection/qmldir new file mode 100644 index 000000000..7b5d9be27 --- /dev/null +++ b/src/declarativeimports/plasmacomponents3/mobiletextselection/qmldir @@ -0,0 +1,3 @@ + +singleton MobileTextActionsToolBar 1.0 MobileTextActionsToolBar.qml +MobileCursor 1.0 MobileCursor.qml diff --git a/src/declarativeimports/plasmacomponents3/private/qmldir b/src/declarativeimports/plasmacomponents3/private/qmldir index 1a9e8d038..d91a06928 100644 --- a/src/declarativeimports/plasmacomponents3/private/qmldir +++ b/src/declarativeimports/plasmacomponents3/private/qmldir @@ -1,7 +1,5 @@ -singleton MobileTextActionsToolBar 1.0 MobileTextActionsToolBar.qml ButtonShadow 1.0 ButtonShadow.qml DefaultListItemBackground 1.0 DefaultListItemBackground.qml -MobileCursor 1.0 MobileCursor.qml RoundShadow 1.0 RoundShadow.qml TextFieldFocus 1.0 TextFieldFocus.qml