From 532860db2c5093e2333506b0714588e123949322 Mon Sep 17 00:00:00 2001 From: tanyulong2021 Date: Thu, 29 Jul 2021 20:03:47 +0800 Subject: [PATCH] fix compile build error --- 0001-fix-compile-extern-C-error.patch | 32 +++ 0013-fix-failed-to-view-remote-desktop.patch | 238 ------------------- ukui-control-center.spec | 7 +- 3 files changed, 37 insertions(+), 240 deletions(-) create mode 100644 0001-fix-compile-extern-C-error.patch delete mode 100644 0013-fix-failed-to-view-remote-desktop.patch diff --git a/0001-fix-compile-extern-C-error.patch b/0001-fix-compile-extern-C-error.patch new file mode 100644 index 0000000..d91aeae --- /dev/null +++ b/0001-fix-compile-extern-C-error.patch @@ -0,0 +1,32 @@ +From 32fe5a8b9b8e31e396e52a8121fb1286f838e39a Mon Sep 17 00:00:00 2001 +From: tanyulong +Date: Thu, 29 Jul 2021 19:46:40 +0800 +Subject: [PATCH] fix compile extern C error + +--- + plugins/account/userinfo/run-passwd.cpp | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/plugins/account/userinfo/run-passwd.cpp b/plugins/account/userinfo/run-passwd.cpp +index 6407929..80da0d0 100755 +--- a/plugins/account/userinfo/run-passwd.cpp ++++ b/plugins/account/userinfo/run-passwd.cpp +@@ -7,7 +7,6 @@ + #undef signals + #endif + +-extern "C" { + #include + #include + +@@ -16,7 +15,6 @@ extern "C" { + #include + #include + +-} + + #include "run-passwd.h" + +-- +2.27.0 + diff --git a/0013-fix-failed-to-view-remote-desktop.patch b/0013-fix-failed-to-view-remote-desktop.patch deleted file mode 100644 index 9b00d17..0000000 --- a/0013-fix-failed-to-view-remote-desktop.patch +++ /dev/null @@ -1,238 +0,0 @@ -From bd8712c40eedb0e5fa065f2619a52afc77885d42 Mon Sep 17 00:00:00 2001 -From: tanyulong -Date: Fri, 16 Jul 2021 14:17:00 +0800 -Subject: [PATCH] fix failed to view remote desktop - ---- - plugins/network/vino/sharemain.cpp | 71 ++++++++++++++++++++++++++---- - plugins/network/vino/sharemain.h | 6 +++ - plugins/network/vino/vino.cpp | 15 ++++--- - plugins/network/vino/vino.h | 1 + - 4 files changed, 79 insertions(+), 14 deletions(-) - -diff --git a/plugins/network/vino/sharemain.cpp b/plugins/network/vino/sharemain.cpp -index c80b9ec..5579c77 100755 ---- a/plugins/network/vino/sharemain.cpp -+++ b/plugins/network/vino/sharemain.cpp -@@ -18,6 +18,7 @@ - * - */ - #include "sharemain.h" -+#include - - #include - #include -@@ -41,6 +42,22 @@ void ShareMain::initUI() { - mShareTitleLabel = new QLabel(tr("Share"), this); - mShareTitleLabel->setStyleSheet("QLabel{font-size: 18px; color: palette(windowText);}"); - -+ mEnableFrame = new QFrame(this); -+ mEnableFrame->setFrameShape(QFrame::Shape::Box); -+ mEnableFrame->setMinimumSize(550, 50); -+ mEnableFrame->setMaximumSize(960, 50); -+ -+ QHBoxLayout * enableHLayout = new QHBoxLayout(); -+ -+ mEnableBox = new QCheckBox(this); -+ mEnableLabel = new QLabel(tr("Allow others to view your desktop"), this); -+ enableHLayout->addWidget(mEnableBox); -+ enableHLayout->addWidget(mEnableLabel); -+ enableHLayout->addStretch(); -+ -+ mEnableFrame->setLayout(enableHLayout); -+ -+ - mViewFrame = new QFrame(this); - mViewFrame->setFrameShape(QFrame::Shape::Box); - mViewFrame->setMinimumSize(550, 50); -@@ -49,7 +66,8 @@ void ShareMain::initUI() { - QHBoxLayout * viewHLayout = new QHBoxLayout(); - - mViewBox = new QCheckBox(this); -- mViewLabel = new QLabel(tr("Allow others to view your desktop"), this); -+ mViewLabel = new QLabel(tr("Allow connection to control screen"), this); -+ - viewHLayout->addWidget(mViewBox); - viewHLayout->addWidget(mViewLabel); - viewHLayout->addStretch(); -@@ -90,6 +108,7 @@ void ShareMain::initUI() { - mSecurityPwdFrame->setLayout(pwdHLayout); - - mVlayout->addWidget(mShareTitleLabel); -+ mVlayout->addWidget(mEnableFrame); - mVlayout->addWidget(mViewFrame); - - mVlayout->addWidget(mSecurityTitleLabel); -@@ -109,7 +128,14 @@ void ShareMain::initConnection() { - QByteArray id(kVinoSchemas); - if (QGSettings::isSchemaInstalled(id)) { - mVinoGsetting = new QGSettings(kVinoSchemas, QByteArray(), this); -+ -+ bool isShared = mVinoGsetting->get(kVinoViewOnlyKey).toBool(); -+ bool secPwd = mVinoGsetting->get(kVinoPromptKey).toBool(); - -+ initShareStatus(!isShared, secPwd); -+ initEnableStatus(); -+ -+ connect(mEnableBox, &QCheckBox::clicked, this, &ShareMain::enableSlot); - connect(mViewBox, &QCheckBox::clicked, this, &ShareMain::viewBoxSlot); - connect(mPwdLineEdit, &QLineEdit::textChanged, this, &ShareMain::pwdInputSlot); - connect(mBtnGroup, QOverload::of(&QButtonGroup::buttonClicked), -@@ -117,9 +143,6 @@ void ShareMain::initConnection() { - accessSlot(index); - }); - -- bool isShared = mVinoGsetting->get(kVinoViewOnlyKey).toBool(); -- bool secPwd = mVinoGsetting->get(kVinoPromptKey).toBool(); -- initShareStatus(!isShared, secPwd); - } - } - -@@ -132,11 +155,41 @@ void ShareMain::initShareStatus(bool isConnnect, bool isPwd) { - } - } - --void ShareMain::viewBoxSlot(bool status) { -- Q_UNUSED(status); -- if (status) { -- mVinoGsetting->set(kVinoViewOnlyKey, status); -+void ShareMain::initEnableStatus() { -+ QProcess *process = new QProcess; -+ -+ process->start("systemctl", QStringList() << "--user" << "is-active" << "vino-server.service"); -+ process->waitForFinished(); -+ setFrameVisible((process->readAllStandardOutput().replace("\n","") == "active")); -+ -+ process->close(); -+} -+ -+void ShareMain::setFrameVisible(bool visible) { -+ mEnableBox->setChecked(visible); -+ -+ mViewFrame->setVisible(visible); -+ mSecurityFrame->setVisible(visible); -+ mSecurityPwdFrame->setVisible(visible); -+ mSecurityTitleLabel->setVisible(visible); -+} -+ -+void ShareMain::enableSlot(bool status) { -+ QProcess process; -+ QString cmd; -+ -+ if(status) { -+ cmd = "start"; -+ } else { -+ cmd = "stop"; - } -+ process.startDetached("systemctl", QStringList() << "--user" << cmd << "vino-server.service"); -+ -+ setFrameVisible(status); -+} -+ -+void ShareMain::viewBoxSlot(bool status) { -+ mVinoGsetting->set(kVinoViewOnlyKey, !status); - } - - void ShareMain::accessSlot(int index) { -@@ -151,7 +204,7 @@ void ShareMain::accessSlot(int index) { - mPwdsLabel->setEnabled(true); - mPwdLineEdit->setEnabled(true); - mVinoGsetting->set(kVinoPromptKey, false); -- mVinoGsetting->reset(kAuthenticationKey), 'vnc'; -+ mVinoGsetting->reset(kAuthenticationKey); - } - } - -diff --git a/plugins/network/vino/sharemain.h b/plugins/network/vino/sharemain.h -index e7681c9..49697c4 100755 ---- a/plugins/network/vino/sharemain.h -+++ b/plugins/network/vino/sharemain.h -@@ -51,6 +51,7 @@ public: - ~ShareMain(); - - private: -+ QFrame * mEnableFrame; - QFrame * mViewFrame; - QFrame * mSecurityFrame; - QFrame * mSecurityPwdFrame; -@@ -58,6 +59,7 @@ private: - QFrame * mNoticeOFrame; - QFrame * mNoticeNFrame; - -+ QCheckBox * mEnableBox; - QCheckBox * mViewBox; - QRadioButton * mAccessBox; - QRadioButton * mPwdBox; -@@ -67,6 +69,7 @@ private: - QRadioButton * mNoticeNBtn; - - QLabel * mShareTitleLabel; -+ QLabel * mEnableLabel; - QLabel * mViewLabel; - QLabel * mSecurityTitleLabel; - QLabel * mAccessLabel; -@@ -87,8 +90,11 @@ private: - void initUI(); - void initConnection(); - void initShareStatus(bool isConnnect, bool isPwd); -+ void initEnableStatus(); -+ void setFrameVisible(bool visible); - - private slots: -+ void enableSlot(bool status); - void viewBoxSlot(bool status); - void accessSlot(int index); - void pwdInputSlot(QString pwd); -diff --git a/plugins/network/vino/vino.cpp b/plugins/network/vino/vino.cpp -index 504b6e0..dc16312 100755 ---- a/plugins/network/vino/vino.cpp -+++ b/plugins/network/vino/vino.cpp -@@ -20,16 +20,15 @@ - #include "vino.h" - #include "ui_vino.h" - --Vino::Vino() : ui(new Ui::Vino) { -- pluginWidget = new ShareMain; -- ui->setupUi(pluginWidget); -- -+Vino::Vino() : ui(new Ui::Vino), mFirstLoad(true) { - pluginName = tr("Vino"); - pluginType = NETWORK; - } - - Vino::~Vino() { -- delete ui; -+ if (!mFirstLoad) { -+ delete ui; -+ } - } - - QString Vino::get_plugin_name() { -@@ -41,6 +40,12 @@ int Vino::get_plugin_type() { - } - - QWidget *Vino::get_plugin_ui() { -+ if (mFirstLoad) { -+ mFirstLoad = false; -+ pluginWidget = new ShareMain; -+ ui->setupUi(pluginWidget); -+ } -+ - return pluginWidget; - } - -diff --git a/plugins/network/vino/vino.h b/plugins/network/vino/vino.h -index 272fa0d..6ea603f 100755 ---- a/plugins/network/vino/vino.h -+++ b/plugins/network/vino/vino.h -@@ -52,6 +52,7 @@ private: - QString pluginName; - int pluginType; - ShareMain* pluginWidget; -+ bool mFirstLoad; - - }; - #endif // VINO_H --- -2.23.0 - diff --git a/ukui-control-center.spec b/ukui-control-center.spec index 1d051d8..bcacb97 100644 --- a/ukui-control-center.spec +++ b/ukui-control-center.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: ukui-control-center Version: 3.0.1 -Release: 13 +Release: 14 Summary: utilities to configure the UKUI desktop License: GPL-2+ URL: http://www.ukui.org @@ -82,7 +82,7 @@ patch9: 0009-fix-layout-optimization.patch patch10:0010-Added-translation-using-Weblate-Tibetan.patch patch11:0011-power-add-sleep-function.patch patch12:0012-window-add-title-icon.patch -patch13:0013-fix-failed-to-view-remote-desktop.patch +patch13:0001-fix-compile-extern-C-error.patch Recommends: qt5-qtquickcontrols @@ -160,6 +160,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/polkit-1/actions/org.ukui.groupmanager.policy %changelog +* Tue Jul 29 2021 tanyulong - 3.0.1-14 +- solve compile build error + * Fri Jul 16 2021 tanyulong - 3.0.1-13 - fix failed to view remote desktop