Remove pre-QQC2.3 workaround
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 14 Sep 2020 15:25:20 +0000 (17:25 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Tue, 15 Sep 2020 08:46:09 +0000 (08:46 +0000)
Now that we depend on Qt 5.12 anyway, the count property is available
just fine on the Menu item.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/tray/UserModel.cpp
src/gui/tray/Window.qml

index b092fbdb15f0c6c329ac077bfcb3f6d69d4e6f38..c0da8137b6109fc039e60a12b6fbaf9a4537ad72 100644 (file)
@@ -654,9 +654,6 @@ Q_INVOKABLE void UserModel::openCurrentAccountTalk()
 
 Q_INVOKABLE void UserModel::openCurrentAccountServer()
 {
-    // Don't open this URL when the QML appMenu pops up on click (see Window.qml)
-    if (appList().count() > 0)
-        return;
     if (_users.isEmpty())
         return;
 
index ee2bff8417078fe0f777ac612a22e511b50f86bc..b0a32464556ec92490ac9c2951e05af2a688afaf 100644 (file)
@@ -2,7 +2,7 @@ import QtQml 2.1
 import QtQml.Models 2.1\r
 import QtQuick 2.9\r
 import QtQuick.Window 2.3\r
-import QtQuick.Controls 2.2\r
+import QtQuick.Controls 2.3\r
 import QtQuick.Layouts 1.2\r
 import QtGraphicalEffects 1.0\r
 \r
@@ -387,22 +387,11 @@ Window {
                     id: trayWindowAppsButton\r
                     icon.source: "qrc:///client/theme/white/more-apps.svg"\r
                     onClicked: {\r
-                        /*\r
-                        // The count() property was introduced in QtQuick.Controls 2.3 (Qt 5.10)\r
-                        // so we handle this with UserModel.openCurrentAccountServer()\r
-                        //\r
-                        // See UserModel::openCurrentAccountServer() to disable this workaround\r
-                        // in the future for Qt >= 5.10\r
-\r
-                        if(appsMenu.count() > 0) {\r
-                            appsMenu.popup();\r
+                        if(appsMenu.count > 0) {\r
+                            appsMenu.open()\r
                         } else {\r
-                            UserModel.openCurrentAccountServer();\r
+                            UserModel.openCurrentAccountServer()\r
                         }\r
-                        */\r
-\r
-                        appsMenu.open();\r
-                        UserModel.openCurrentAccountServer();\r
                     }\r
 \r
                     Menu {\r