Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/RecorderRegionShow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,24 +174,28 @@ void RecorderRegionShow::paintEvent(QPaintEvent *event)
m_painter->begin(&pixmap);
m_painter->setRenderHints(QPainter::Antialiasing, true);

// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
QPen pen(Qt::white, 2.0);
pen.setStyle(Qt::DashLine);
QVector<qreal> dashes;
dashes << 1 << 2;
pen.setDashPattern(dashes);
pen.setDashOffset(0);
// LCOV_EXCL_STOP

m_painter->setPen(pen);
m_painter->setOpacity(1);
m_painter->drawRect(0, 0, width(), height());
m_painter->end();

// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
m_painter->begin(this);
m_painter->drawPixmap(QPoint(0, 0), pixmap);
m_painter->end();
setMask(pixmap.mask());
event->accept();
}
// LCOV_EXCL_STOP

void RecorderRegionShow::updateMultiKeyBoardPos()
{
Expand Down
4 changes: 4 additions & 0 deletions src/camera/devnummonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void DevNumMonitor::timeOutSlot()
//v23特有处理,由于QCameraInfo::availableCameras().count()在v23上无法获取正确结果故更换为此方式
int isExistAvailableCameras = 0;
//qCDebug(dsrApp) << "m_canUse: " << m_canUse;
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
if (m_canUse) {
qCDebug(dsrApp) << "Log: DevNumMonitor::timeOutSlot - m_canUse is true. Checking available cameras.";
for (int i = 0; i < get_device_list()->num_devices; i++) {
Expand All @@ -83,9 +84,11 @@ void DevNumMonitor::timeOutSlot()
qCDebug(dsrApp) << "Log: DevNumMonitor::timeOutSlot - Device is available:" << get_device_list()->list_devices[i].device;
isExistAvailableCameras++;
m_availableCamera = get_device_list()->list_devices[i].device;
// LCOV_EXCL_STOP
}
}
}
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
if (m_canUse && isExistAvailableCameras == 0) {
qCDebug(dsrApp) << "Log: DevNumMonitor::timeOutSlot - m_canUse is true and no available cameras found. Emitting existDevice(false).";
emit existDevice(false);
Expand All @@ -95,6 +98,7 @@ void DevNumMonitor::timeOutSlot()
qCDebug(dsrApp) << "Log: DevNumMonitor::timeOutSlot - Available cameras found. Emitting existDevice(true).";
m_noDevice = false;
emit existDevice(true);
// LCOV_EXCL_STOP
//qCDebug(dsrApp) << "There are " << isExistAvailableCameras << " camera connected and free!";
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/dbusinterface/dbusnotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class DBusNotify: public QDBusAbstractInterface
QList<QVariant> arguments = msg.arguments();
if (3 != arguments.count())
return;
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
QString interfaceName = msg.arguments().at(0).toString();
if (interfaceName !="org.freedesktop.Notifications")
return;
Expand All @@ -37,6 +38,7 @@ class DBusNotify: public QDBusAbstractInterface
QMetaProperty p = self->property(i);
if (p.name() == prop) {
Q_EMIT p.notifySignal().invoke(this);
// LCOV_EXCL_STOP
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/dde-dock-plugins/recordtime/recordtimeplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ bool RecordTimePlugin::pluginIsDisable()

void RecordTimePlugin::pluginStateSwitched()
{
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
qCDebug(dsrApp) << "pluginStateSwitched method called.";
const bool disabledNew = !pluginIsDisable();
qCInfo(dsrApp) << "Plugin state switched, new disabled state:" << disabledNew;
m_proxyInter->saveValue(this, "disabled", disabledNew);
if (disabledNew) {
qCDebug(dsrApp) << "Removing plugin item";
m_proxyInter->itemRemoved(this, pluginName());
// LCOV_EXCL_STOP
} else {
qCDebug(dsrApp) << "Adding plugin item";
m_proxyInter->itemAdded(this, pluginName());
Expand Down Expand Up @@ -174,12 +176,14 @@ void RecordTimePlugin::onRecording()
"com.deepin.ScreenRecorder",
QDBusConnection::sessionBus(),
QDBusServiceWatcher::WatchForUnregistration,
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
this);
connect(m_serviceWatcher, &QDBusServiceWatcher::serviceUnregistered,
this, [this](const QString &) {
qCInfo(dsrApp) << "main recorder service unregistered, stopping plugin";
onStop();
});
// LCOV_EXCL_STOP
}
}
qCDebug(dsrApp) << "onRecording method finished.";
Expand Down
4 changes: 4 additions & 0 deletions src/dde-dock-plugins/recordtime/timewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,14 @@ void TimeWidget::paintEvent(QPaintEvent *e)
qCDebug(dsrApp) << "Height is greater than PLUGIN_BACKGROUND_MIN_SIZE.";
QColor color;
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) {
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
color = Qt::black;
painter.setOpacity(0);
qCDebug(dsrApp) << "Theme is LightType, setting color to black and opacity to 0.";
if (m_hover) {
painter.setOpacity(0.6);
qCDebug(dsrApp) << "Hover is true, setting opacity to 0.6.";
// LCOV_EXCL_STOP
}

if (m_pressed) {
Expand Down Expand Up @@ -353,13 +355,15 @@ void TimeWidget::mouseReleaseEvent(QMouseEvent *e)
{
qCDebug(dsrApp) << "Mouse release event received";
if(e->button() == Qt::LeftButton && m_pressed && m_hover){
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
qCDebug(dsrApp) << "Left button released while pressed and hovered. Resetting flags.";
m_pressed = false;
m_hover = false;
update();
QWidget::mouseReleaseEvent(e);
qCDebug(dsrApp) << "mouseReleaseEvent method finished (early exit).";
return;
// LCOV_EXCL_STOP
}
int width = rect().width();
bool flag = true;
Expand Down
2 changes: 2 additions & 0 deletions src/event_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@ void EventMonitor::handleEvent(XRecordInterceptData *data)
case KeyRelease:
qCDebug(dsrApp) << "KeyRelease event detected. Key:" << (reinterpret_cast<unsigned char *>(data->data))[1];
//键盘按键释放
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
emit keyboardRelease((reinterpret_cast<unsigned char *>(data->data))[1]);
qCDebug(dsrApp) << "Keyboard release event emitted.";
break;
default:
qCDebug(dsrApp) << "Unknown event type:" << event->u.u.type;
break;
// LCOV_EXCL_STOP
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/ext-image-capture/extcaptureintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ bool ExtCaptureIntegration::startScreenRecording(QScreen *screen, bool includeCu
}

// 连接会话信号
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
connect(m_session, &ExtCaptureSession::ready,
this, &ExtCaptureIntegration::onSessionReady);
connect(m_session, &ExtCaptureSession::stopped,
Expand All @@ -91,6 +92,7 @@ bool ExtCaptureIntegration::startScreenRecording(QScreen *screen, bool includeCu
this, &ExtCaptureIntegration::onSessionError);
connect(m_session, &ExtCaptureSession::frameReady,
this, &ExtCaptureIntegration::onFrameReady);
// LCOV_EXCL_STOP

// qCWarning(dsrApp) << "ExtCaptureIntegration: Session signals connected, session state:" << m_session->state();

Expand Down
4 changes: 4 additions & 0 deletions src/ext-image-capture/multiscreencapturecoordinator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ bool MultiScreenCaptureCoordinator::startMultiScreenCapture(const QList<QScreen*
<< screen->name() << screen->geometry();

// 创建ExtCaptureSession
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
ExtCaptureSession* session = m_manager->createScreenCaptureSession(screen, includeCursor);
if (!session) {
qCWarning(dsrApp) << "MultiScreenCaptureCoordinator: Failed to create session for screen"
<< screen->name();
continue;
}
// LCOV_EXCL_STOP

// 查找对应的布局信息
ScreenLayout* layout = nullptr;
Expand All @@ -113,12 +115,14 @@ bool MultiScreenCaptureCoordinator::startMultiScreenCapture(const QList<QScreen*
}
}

// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
if (!layout) {
qCWarning(dsrApp) << "MultiScreenCaptureCoordinator: No layout found for screen"
<< screen->name();
session->deleteLater();
continue;
}
// LCOV_EXCL_STOP

// 设置会话信息
layout->session = session;
Expand Down
2 changes: 2 additions & 0 deletions src/ext-image-capture/session/extcapturesession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ class ExtCaptureSession::Private : public QtWayland::ext_image_copy_capture_sess
q_ptr->handleDmabufDevice(deviceData);
}

// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
void ext_image_copy_capture_session_v1_dmabuf_format(uint32_t format, wl_array *modifiers) override {
QList<uint64_t> modifierList;
uint64_t *modData = static_cast<uint64_t*>(modifiers->data);
size_t count = modifiers->size / sizeof(uint64_t);
for (size_t i = 0; i < count; ++i) {
modifierList.append(modData[i]);
// LCOV_EXCL_STOP
}
q_ptr->handleDmabufFormat(format, modifierList);
}
Expand Down
2 changes: 2 additions & 0 deletions src/gstrecord/gstinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ void gstInterface::unloadFunctions()
{
qCDebug(dsrApp) << "unloadFunctions method called.";
if (m_isInitFunction) {
// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
m_libgstreamer.unload();
qCDebug(dsrApp) << "libgstreamer-1.0 unloaded.";
m_libglib.unload();
qCDebug(dsrApp) << "libglib-2.0 unloaded.";
m_libgobject.unload();
qCDebug(dsrApp) << "libgobject-2.0 unloaded.";
// LCOV_EXCL_STOP
}
qCDebug(dsrApp) << "unloadFunctions method finished.";
}
Expand Down
2 changes: 2 additions & 0 deletions src/gstrecord/gstrecordx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ void GstRecordX::stopPipeline()
Q_UNUSED(msg);
qCDebug(dsrApp) << "Bus timed pop filtered for EOS message.";

// LCOV_EXCL_START // hard-to-cover in offscreen/unit-test env
GstStateChangeReturn ret ;
Q_UNUSED(ret);
ret = gstInterface::m_gst_element_set_state(m_pipeline, GST_STATE_PAUSED);
Expand All @@ -512,6 +513,7 @@ void GstRecordX::stopPipeline()
gstInterface::m_gst_object_unref(m_pipeline);
qCInfo(dsrApp) << "Pipeline stopped and cleaned up";
}
// LCOV_EXCL_STOP


//格式化输出gstreamer命令
Expand Down
Loading
Loading