Skip to content

Commit

Permalink
fix: Fixed the issue that the camera failed to be turned on (#548)
Browse files Browse the repository at this point in the history
Fixed the issue that the camera failed to be turned on

Log: Fixed the issue that the camera failed to be turned on
  • Loading branch information
pengfeixx authored Dec 19, 2024
1 parent 37c51dd commit a86b68b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
16 changes: 2 additions & 14 deletions src/common/dbus_adpator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ ApplicationAdaptor::ApplicationAdaptor(MainWindow *pMainWid)
initMember();

m_pMainWindow = pMainWid;

m_oldTime = QTime::currentTime();
}

//cppcheck 单元测试 wayland下再用
void ApplicationAdaptor::openFiles(const QStringList &listFiles)
{
// 快速点击,播放不正常问题
QTime current = QTime::currentTime();
if (abs(m_oldTime.msecsTo(current)) > 800) {
m_oldTime = current;
m_pMainWindow->play(listFiles);
}
m_pMainWindow->play(listFiles);
}

//cppcheck 单元测试在用
Expand All @@ -47,12 +40,7 @@ void ApplicationAdaptor::openFile(const QString &sFile)
} else {
url = QUrl::fromLocalFile(sFile);
}

QTime current = QTime::currentTime();
if (abs(m_oldTime.msecsTo(current)) > 800) {
m_oldTime = current;
m_pMainWindow->play({url.toString()});
}
m_pMainWindow->play({url.toString()});
}

void ApplicationAdaptor::funOpenFile(const QString &sFile)
Expand Down
1 change: 0 additions & 1 deletion src/common/dbus_adpator.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public slots:

private:
MainWindow *m_pMainWindow; ///主窗口指针
QTime m_oldTime; ///记录上次播放时的时间
};


Expand Down
16 changes: 2 additions & 14 deletions src/common/platform/platform_dbus_adpator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@ Platform_ApplicationAdaptor::Platform_ApplicationAdaptor(Platform_MainWindow *pM
initMember();

m_pMainWindow = pMainWid;

m_oldTime = QTime::currentTime();
}

//cppcheck 单元测试 wayland下再用
void Platform_ApplicationAdaptor::openFiles(const QStringList &listFiles)
{
// 快速点击,播放不正常问题
QTime current = QTime::currentTime();
if (abs(m_oldTime.msecsTo(current)) > 800) {
m_oldTime = current;
m_pMainWindow->play(listFiles);
}
m_pMainWindow->play(listFiles);
}

//cppcheck 单元测试在用
Expand All @@ -47,12 +40,7 @@ void Platform_ApplicationAdaptor::openFile(const QString &sFile)
} else {
url = QUrl::fromLocalFile(sFile);
}

QTime current = QTime::currentTime();
if (abs(m_oldTime.msecsTo(current)) > 800) {
m_oldTime = current;
m_pMainWindow->play({url.toString()});
}
m_pMainWindow->play({url.toString()});
}

void Platform_ApplicationAdaptor::funOpenFile(const QString &sFile)
Expand Down
1 change: 0 additions & 1 deletion src/common/platform/platform_dbus_adpator.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public slots:

private:
Platform_MainWindow *m_pMainWindow; ///主窗口指针
QTime m_oldTime; ///记录上次播放时的时间
};


Expand Down

0 comments on commit a86b68b

Please sign in to comment.