浏览代码

Make certain host commands work again

For some reason, commit baa9d41 (or one of the following ones) broke
dispatching of host commands on our CI builds. (I cannot reproduce
the problem with local builds.) We get this:

2016-01-05 20:37:34 [ WARN  ] main.cpp @ 69 - "QMetaObject::invokeMethod: No such method PlayerComponent::userCommand()\nCandidates are:\n    userCommand(QString)"

On the other hand, with this commit applied, it works.

This makes not the slightest sense to me, because userCommand has the
correct signature (and the Qt log message also shows the correct
signature). The Qt documentation also assues that the signatures
changed in this commit should be equivalent, as far as the signal
code is concerned.

I can only guess that this is caused by an unclean build or possibly
a slightly broken Qt snapshot (unlikely).

Push it anyway, so I can go on.
Vincent Lang 9 年之前
父节点
当前提交
0fb21db0d3
共有 4 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      src/player/PlayerComponent.cpp
  2. 1 1
      src/player/PlayerComponent.h
  3. 1 1
      src/system/SystemComponent.cpp
  4. 1 1
      src/system/SystemComponent.h

+ 1 - 1
src/player/PlayerComponent.cpp

@@ -778,7 +778,7 @@ void PlayerComponent::updateVideoSettings()
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
-void PlayerComponent::userCommand(const QString& command)
+void PlayerComponent::userCommand(QString command)
 {
   QByteArray cmd_utf8 = command.toUtf8();
   mpv_command_string(m_mpv, cmd_utf8.data());

+ 1 - 1
src/player/PlayerComponent.h

@@ -79,7 +79,7 @@ public:
   // only. If no video is running, render a black background only.
   Q_INVOKABLE virtual void setVideoOnlyMode(bool enable);
 
-  Q_INVOKABLE void userCommand(const QString& command);
+  Q_INVOKABLE void userCommand(QString command);
 
   const mpv::qt::Handle getMpvHandle() const { return m_mpv; }
 

+ 1 - 1
src/system/SystemComponent.cpp

@@ -272,7 +272,7 @@ void SystemComponent::openExternalUrl(const QString& url)
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
-void SystemComponent::runUserScript(const QString& script)
+void SystemComponent::runUserScript(QString script)
 {
   // We take the path the user supplied and run it through fileInfo and
   // look for the fileName() part, this is to avoid people sharing keymaps

+ 1 - 1
src/system/SystemComponent.h

@@ -42,7 +42,7 @@ public:
 
   Q_INVOKABLE void openExternalUrl(const QString& url);
 
-  Q_INVOKABLE void runUserScript(const QString& script);
+  Q_INVOKABLE void runUserScript(QString script);
 
   // possible os types type enum
   enum PlatformType