File linphoneqt-fix-qt-5.11.patch of Package linphoneqt

--- a/resources.qrc
+++ b/resources.qrc
@@ -388,6 +388,7 @@
     <file>ui/views/App/Calls/IncomingCall.qml</file>
     <file>ui/views/App/Calls/OutgoingCall.qml</file>
     <file>ui/views/App/Calls/ZrtpTokenAuthentication.qml</file>
+    <file>ui/views/App/Main/+5.9/MainWindowMenuBar.qml</file>
     <file>ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithEmail.qml</file>
     <file>ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithPhoneNumber.qml</file>
     <file>ui/views/App/Main/Assistant/AssistantAbstractView.qml</file>
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -23,6 +23,7 @@
 #include <QCommandLineParser>
 #include <QDir>
 #include <QFileSelector>
+#include <QLibraryInfo>
 #include <QMenu>
 #include <QQmlFileSelector>
 #include <QSystemTrayIcon>
@@ -176,8 +177,14 @@ void App::initContentApp () {
   // Init engine content.
   mEngine = new QQmlApplicationEngine();
 
-  // Provide `+custom` folders for custom components.
-  (new QQmlFileSelector(mEngine, mEngine))->setExtraSelectors(QStringList("custom"));
+  // Provide `+custom` folders for custom components and `5.9` for old components.
+  {
+    QStringList selectors("custom");
+    const QVersionNumber &version = QLibraryInfo::version();
+    if (version.majorVersion() == 5 && version.minorVersion() == 9)
+      selectors.push_back("5.9");
+    (new QQmlFileSelector(mEngine, mEngine))->setExtraSelectors(selectors);
+  }
   qInfo() << QStringLiteral("Activated selectors:") << QQmlFileSelector::get(mEngine)->selector()->allSelectors();
 
   // Set modules paths.
--- a/src/app/translator/DefaultTranslator.cpp
+++ b/src/app/translator/DefaultTranslator.cpp
@@ -33,10 +33,12 @@ DefaultTranslator::DefaultTranslator (QObject *parent) : QTranslator(parent) {
     QFileInfo info(it.next());
 
     if (info.suffix() == "qml") {
-      // Ignore extra selectors.
       QString dir = info.absoluteDir().absolutePath();
-      if (dir.contains("+linux") || dir.contains("+mac") || dir.contains("+windows"))
-        continue;
+
+      // Ignore extra selectors.
+      for (const auto &selector : { "+linux", "+mac", "+windows", "+5.9" })
+        if (dir.contains(selector))
+          goto end;
 
       // Ignore default imports.
       if (dir.startsWith(":/QtQuick"))
@@ -48,6 +51,7 @@ DefaultTranslator::DefaultTranslator (QObject *parent) : QTranslator(parent) {
       else
         mContexts << basename;
     }
+    end:;
   }
 }
 
--- a/ui/modules/Common/Form/Buttons/ExclusiveButtons.spec.qml
+++ b/ui/modules/Common/Form/Buttons/ExclusiveButtons.spec.qml
@@ -27,13 +27,6 @@ Item {
 
         texts: ['A', 'B', 'C', 'D', 'E']
       }
-
-      SignalSpy {
-        id: spy
-
-        signalName: 'clicked'
-        target: exclusiveButtons
-      }
     }
   }
 
@@ -54,24 +47,32 @@ Item {
 
     function test_signals (data) {
       var container = buildExclusiveButtons(data.defaultSelectedButton)
-      var spy = container.data[1]
       var exclusiveButtons = container.data[0]
-
       var buttonToClick = data.buttonToClick
 
       // Test default selected button.
       compare(exclusiveButtons.selectedButton, data.defaultSelectedButton)
 
+      var button = -1
+      var count = 0
+      exclusiveButtons.clicked.connect(function (_button) {
+        button = _button;
+        count += 1
+      })
+
       // Test a click to change the selected button.
       mouseClick(exclusiveButtons.data[buttonToClick])
-      spy.wait(100)
-      compare(spy.signalArguments[0][0], buttonToClick)
+
+      compare(button, buttonToClick)
       compare(exclusiveButtons.selectedButton, buttonToClick)
+      compare(count, 1)
 
       // No signal must be emitted.
       mouseClick(exclusiveButtons.data[buttonToClick])
-      wait(100)
-      compare(spy.count, 1)
+
+      compare(button, buttonToClick)
+      compare(exclusiveButtons.selectedButton, buttonToClick)
+      compare(count, 1)
 
       container.destroy()
     }
--- a/ui/modules/Common/Form/ComboBox.qml
+++ b/ui/modules/Common/Form/ComboBox.qml
@@ -1,5 +1,5 @@
 import QtQuick 2.7
-import QtQuick.Controls 2.1
+import QtQuick.Controls 2.1 as Controls
 import QtQuick.Layouts 1.3
 
 import Common 1.0
@@ -11,7 +11,7 @@ import 'ComboBox.js' as Logic
 
 // =============================================================================
 
-ComboBox {
+Controls.ComboBox {
   id: comboBox
 
   // ---------------------------------------------------------------------------
@@ -83,7 +83,7 @@ ComboBox {
 
   // ---------------------------------------------------------------------------
 
-  delegate: ItemDelegate {
+  delegate: Controls.ItemDelegate {
     id: item
 
     readonly property var flattenedModel: comboBox.textRole.length &&
--- a/ui/modules/Common/Form/Tab/TabButton.qml
+++ b/ui/modules/Common/Form/Tab/TabButton.qml
@@ -12,8 +12,8 @@ Controls.TabButton {
 
   // ---------------------------------------------------------------------------
 
-  property string icon
   property int iconSize: TabButtonStyle.icon.size
+  property string iconName
 
   readonly property bool _isSelected: parent.parent.currentItem === button
 
@@ -66,9 +66,9 @@ Controls.TabButton {
       Layout.leftMargin: TabButtonStyle.text.leftPadding
 
       icon: {
-        var icon = button.icon
-        return icon.length
-          ? (icon + '_' + (button._isSelected ? 'selected' : 'normal'))
+        var iconName = button.iconName
+        return iconName.length
+          ? (iconName + '_' + (button._isSelected ? 'selected' : 'normal'))
           : ''
       }
       iconSize: button.iconSize
--- a/ui/modules/Linphone/Calls/Calls.qml
+++ b/ui/modules/Linphone/Calls/Calls.qml
@@ -93,9 +93,7 @@ ListView {
   // ---------------------------------------------------------------------------
 
   header: ConferenceControls {
-    readonly property bool isSelected: calls.currentIndex === -1 &&
-      calls._selectedCall == null &&
-      visible
+    readonly property bool isSelected: calls.currentIndex === -1 && calls._selectedCall == null
 
     height: visible ? ConferenceControlsStyle.height : 0
     width: parent.width
--- a/ui/views/App/Main/+5.9/MainWindowMenuBar.qml
+++ b/ui/views/App/Main/+5.9/MainWindowMenuBar.qml
@@ -0,0 +1,79 @@
+import QtQuick 2.7
+
+// Experimental.
+import Qt.labs.platform 1.0
+
+import Linphone 1.0
+
+// =============================================================================
+
+Item {
+  function open () {
+    menu.open()
+  }
+
+  // ---------------------------------------------------------------------------
+  // Shortcuts.
+  // ---------------------------------------------------------------------------
+
+  Shortcut {
+    id: settingsShortcut
+
+    sequence: 'Ctrl+P'
+
+    onActivated: App.smartShowWindow(App.getSettingsWindow())
+  }
+
+  Shortcut {
+    id: quitShortcut
+
+    context: Qt.ApplicationShortcut
+    sequence: StandardKey.Quit
+
+    onActivated: Qt.quit()
+  }
+
+  Shortcut {
+    id: aboutShortcut
+
+    sequence: StandardKey.HelpContents
+
+    onActivated: {
+      window.detachVirtualWindow()
+      window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/About.qml'))
+    }
+  }
+
+  // ---------------------------------------------------------------------------
+  // Menu.
+  // ---------------------------------------------------------------------------
+
+  MenuBar {
+    Menu {
+      id: menu
+
+      MenuItem {
+        role: MenuItem.PreferencesRole
+        shortcut: settingsShortcut.sequence
+        text: qsTr('settings')
+
+        onTriggered: settingsShortcut.onActivated()
+      }
+
+      MenuItem {
+        role: MenuItem.AboutRole
+        text: qsTr('about')
+
+        onTriggered: aboutShortcut.onActivated()
+      }
+
+      MenuItem {
+        role: MenuItem.QuitRole
+        shortcut: quitShortcut.sequence
+        text: qsTr('quit')
+
+        onTriggered: quitShortcut.onActivated()
+      }
+    }
+  }
+}
--- a/ui/views/App/Main/MainWindowMenuBar.qml
+++ b/ui/views/App/Main/MainWindowMenuBar.qml
@@ -1,7 +1,5 @@
 import QtQuick 2.7
-
-// Experimental.
-import Qt.labs.platform 1.0
+import QtQuick.Controls 2.3
 
 import Linphone 1.0
 
@@ -48,32 +46,25 @@ Item {
   // Menu.
   // ---------------------------------------------------------------------------
 
-  MenuBar {
-    Menu {
-      id: menu
-
-      MenuItem {
-        role: MenuItem.PreferencesRole
-        shortcut: settingsShortcut.sequence
-        text: qsTr('settings')
-
-        onTriggered: settingsShortcut.onActivated()
-      }
-
-      MenuItem {
-        role: MenuItem.AboutRole
-        text: qsTr('about')
-
-        onTriggered: aboutShortcut.onActivated()
-      }
-
-      MenuItem {
-        role: MenuItem.QuitRole
-        shortcut: quitShortcut.sequence
-        text: qsTr('quit')
+  Menu {
+    id: menu
+
+    MenuItem {
+      text: qsTr('settings')
+
+      onTriggered: settingsShortcut.onActivated()
+    }
+
+    MenuItem {
+      text: qsTr('about')
+
+      onTriggered: aboutShortcut.onActivated()
+    }
+
+    MenuItem {
+      text: qsTr('quit')
 
-        onTriggered: quitShortcut.onActivated()
-      }
+      onTriggered: quitShortcut.onActivated()
     }
   }
 }
--- a/ui/views/App/Settings/SettingsWindow.qml
+++ b/ui/views/App/Settings/SettingsWindow.qml
@@ -48,43 +48,43 @@ ApplicationWindow {
         id: tabBar
 
         TabButton {
-          icon: 'settings_sip_accounts'
+          iconName: 'settings_sip_accounts'
           text: qsTr('sipAccountsTab')
           width: implicitWidth
         }
 
         TabButton {
-          icon: 'settings_audio'
+          iconName: 'settings_audio'
           text: qsTr('audioTab')
           width: implicitWidth
         }
 
         TabButton {
-          icon: 'settings_video'
+          iconName: 'settings_video'
           text: qsTr('videoTab')
           width: implicitWidth
         }
 
         TabButton {
-          icon: 'settings_call'
+          iconName: 'settings_call'
           text: qsTr('callsAndChatTab')
           width: implicitWidth
         }
 
         TabButton {
-          icon: 'settings_network'
+          iconName: 'settings_network'
           text: qsTr('networkTab')
           width: implicitWidth
         }
 
         TabButton {
-          icon: 'settings_advanced'
+          iconName: 'settings_advanced'
           text: qsTr('uiTab')
           width: implicitWidth
         }
 
         TabButton {
-          icon: 'settings_advanced'
+          iconName: 'settings_advanced'
           text: qsTr('uiAdvanced')
           width: implicitWidth
         }
openSUSE Build Service is sponsored by