Skip to content

Commit

Permalink
chore: remove USE_KWAYLAND option
Browse files Browse the repository at this point in the history
now use DWayland instead, it is not useful anymore

Log:
  • Loading branch information
Decodetalkers committed Jul 19, 2023
1 parent c04cfab commit 6199c66
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 36 deletions.
14 changes: 0 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@ find_package(DWayland REQUIRED)

pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-qt)

try_compile(USE_DEEPIN_KF5_WAYLAND
${CMAKE_CURRENT_BINARY_DIR}/try_compile
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/kf5_wayland_test.cc
LINK_LIBRARIES
DWaylandClient
)

message(STATUS "USE_DEEPIN_KF5_WAYLAND ${USE_DEEPIN_KF5_WAYLAND}")

if(USE_DEEPIN_KF5_WAYLAND)
add_definitions(-DUSE_DEEPIN_KF5_WAYLAND)
endif()

find_package(DtkTools REQUIRED)
function(generation_dbus_adaptor xml class_name class_file option)
execute_process(COMMAND qdbusxml2cpp ${option} -a ${class_file} -c ${class_name} ${xml}
Expand Down
13 changes: 1 addition & 12 deletions dde-clipboard-daemon/clipboardloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,15 @@ QString ClipboardLoader::m_pixPath;
ClipboardLoader::ClipboardLoader(QObject *parent)
: QObject(parent)
, m_board(nullptr)
#ifdef USE_DEEPIN_KF5_WAYLAND
, m_waylandCopyClient(nullptr)
#endif
{
if (qEnvironmentVariable("XDG_SESSION_TYPE").contains("wayland")) {
#ifdef USE_DEEPIN_KF5_WAYLAND
m_waylandCopyClient = new WaylandCopyClient(this);
m_waylandCopyClient->init();

connect(m_waylandCopyClient, &WaylandCopyClient::dataChanged, this, [this] {
this->doWork(WAYLAND_PROTOCOL);
});
#else
qWarning() << "we will not work with wayland";
#endif
} else {
m_board = qApp->clipboard();
connect(m_board, &QClipboard::dataChanged, this, [this] {
Expand Down Expand Up @@ -135,10 +129,9 @@ void ClipboardLoader::dataReborned(const QByteArray &buf)

if (m_board)
m_board->setMimeData(mimeData);
#ifdef USE_DEEPIN_KF5_WAYLAND

if (m_waylandCopyClient)
m_waylandCopyClient->setMimeData(mimeData);
#endif
}

void ClipboardLoader::doWork(int protocolType)
Expand All @@ -150,11 +143,7 @@ void ClipboardLoader::doWork(int protocolType)
// The pointer returned might become invalidated when the contents
// of the clipboard changes; either by calling one of the setter functions
// or externally by the system clipboard changing.`
#ifdef USE_DEEPIN_KF5_WAYLAND
const QMimeData *mimeData = protocolType == WAYLAND_PROTOCOL ? m_waylandCopyClient->mimeData() : m_board->mimeData();
#else
const QMimeData *mimeData = m_board->mimeData();
#endif
if (!mimeData || mimeData->formats().isEmpty())
return;

Expand Down
2 changes: 0 additions & 2 deletions dde-clipboard-daemon/clipboardloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ private Q_SLOTS:
QClipboard *m_board;
QByteArray m_lastTimeStamp;
QPixmap m_lastPix;
#ifdef USE_DEEPIN_KF5_WAYLAND
WaylandCopyClient *m_waylandCopyClient;
#endif

static QString m_pixPath;
};
Expand Down
3 changes: 0 additions & 3 deletions dde-clipboard-daemon/waylandcopyclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later

#ifdef USE_DEEPIN_KF5_WAYLAND
#include "waylandcopyclient.h"
#include "readpipedatatask.h"

Expand Down Expand Up @@ -316,5 +315,3 @@ QStringList WaylandCopyClient::filterMimeType(const QStringList &mimeTypeList)

return tmpList;
}

#endif
2 changes: 0 additions & 2 deletions dde-clipboard-daemon/waylandcopyclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later

#ifdef USE_DEEPIN_KF5_WAYLAND
#ifndef COPYCLIENT_H
#define COPYCLIENT_H

Expand Down Expand Up @@ -89,4 +88,3 @@ protected slots:
};

#endif // COPYCLIENT_H
#endif
3 changes: 0 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ export QT_SELECT = qt5

%:
dh $@ --parallel

override_dh_auto_configure:
dh_auto_configure -- -D USE_DEEPIN_KF5_WAYLAND=ON

0 comments on commit 6199c66

Please sign in to comment.