[arch-commits] Commit in deepin-screenshot/trunk (2 files)

Felix Yan felixonmars at archlinux.org
Sun Apr 26 11:42:19 UTC 2020


    Date: Sunday, April 26, 2020 @ 11:42:17
  Author: felixonmars
Revision: 621527

upgpkg: deepin-screenshot 5.0.0-3: rebuild with dtk 5

Modified:
  deepin-screenshot/trunk/PKGBUILD
  deepin-screenshot/trunk/deepin-screenshot-no-notification.patch

-----------------------------------------+
 PKGBUILD                                |    4 
 deepin-screenshot-no-notification.patch |  221 +++++++++++++++++++-----------
 2 files changed, 146 insertions(+), 79 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-26 11:40:35 UTC (rev 621526)
+++ PKGBUILD	2020-04-26 11:42:17 UTC (rev 621527)
@@ -4,7 +4,7 @@
 
 pkgname=deepin-screenshot
 pkgver=5.0.0
-pkgrel=2
+pkgrel=3
 pkgdesc="Easy-to-use screenshot tool for linuxdeepin desktop environment"
 arch=('x86_64')
 url="https://github.com/linuxdeepin/deepin-screenshot"
@@ -15,7 +15,7 @@
 source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-screenshot/archive/$pkgver.tar.gz"
         deepin-screenshot-no-notification.patch)
 sha512sums=('ad073961deaa78a47739af6cf8b0d0fa77a92ee6668c57f9a5bbf51ad2be1d2028681cffabdc26548be1bdbe24c7ccc7e7ff3d49b86907f794495bfbea62aa30'
-            'ffd0b306017e54edd6c910e2eca8881d000d4ef6f879683b2d14a8c685dbd4d5a9e13db2358b1622f6bcff4e0ebf90e15d14c6f084e3ae9c0b3857a0ddafde58')
+            'be84065c3d81b60a3d04180f85b75a58f535a674f8438ee37ffa4f9a9c47128c48a5819d7279a977d64adfb9a25be51ec88f682b0ed632d1c676d6a8af174389')
 
 prepare() {
   cd deepin-screenshot-$pkgver

Modified: deepin-screenshot-no-notification.patch
===================================================================
--- deepin-screenshot-no-notification.patch	2020-04-26 11:40:35 UTC (rev 621526)
+++ deepin-screenshot-no-notification.patch	2020-04-26 11:42:17 UTC (rev 621527)
@@ -1,108 +1,175 @@
-From f8ad99cb28f547ac1295c71cf8228df5ca529e42 Mon Sep 17 00:00:00 2001
-From: Michael Blesel <3blesel at informatik.uni-hamburg.de>
-Date: Mon, 29 Apr 2019 18:59:15 +0200
-Subject: [PATCH] The -s and -n options can now be used together.
-
-When using the -s and -n options together the -n option was ignored
-before.
-I added a noNotify argument to the Screenshot::savePathScreenshot
-and the MainWindow::savePath functions.
-MainWindow::savePath now sets MainWindow::m_noNotify if the program
-was called with -n option.
-Lastly MainWindow::saveSpecificedPath checks m_noNotify before
-sending a notification.
----
- src/main.cpp       |  3 ++-
- src/mainwindow.cpp | 10 +++++++---
- src/mainwindow.h   |  2 +-
- src/screenshot.cpp |  4 ++--
- src/screenshot.h   |  2 +-
- 5 files changed, 13 insertions(+), 8 deletions(-)
-
+diff --git a/src/dbusservice/dbusscreenshotservice.cpp b/src/dbusservice/dbusscreenshotservice.cpp
+index 75ea15b..de057f3 100644
+--- a/src/dbusservice/dbusscreenshotservice.cpp
++++ b/src/dbusservice/dbusscreenshotservice.cpp
+@@ -80,8 +80,10 @@ void DBusScreenshotService::NoNotifyScreenshot()
+ {
+      qDebug() << "DBus screenshot service! nonofiy screenshot";
+     // handle method call com.deepin.Screenshot.NoNotify
+-     if (!m_singleInstance)
+-        parent()->noNotifyScreenshot();
++     if (!m_singleInstance) {
++        parent()->noNotify();
++        parent()->startScreenshot();
++     }
+      m_singleInstance = true;
+ }
+ 
 diff --git a/src/main.cpp b/src/main.cpp
-index f0204f6..3de5180 100644
+index 2ce8658..74668c6 100644
 --- a/src/main.cpp
 +++ b/src/main.cpp
-@@ -107,7 +107,8 @@ int main(int argc, char *argv[])
-              w.topWindowScreenshot();
+@@ -91,6 +91,11 @@ int main(int argc, char *argv[])
+          return 0;
+      }
+ 
++     if (cmdParser.isSet(prohibitNotifyOption)) {
++         qDebug() << "screenshot no notify!";
++         w.noNotify();
++     }
++
+      if (cmdParser.isSet(dbusOption))
+      {
+          qDebug() << "dbus register waiting!";
+@@ -108,9 +113,6 @@ int main(int argc, char *argv[])
           } else if (cmdParser.isSet(savePathOption)) {
               qDebug() << "cmd savepath screenshot";
--             w.savePathScreenshot(cmdParser.value(savePathOption));
-+             w.savePathScreenshot(cmdParser.value(savePathOption),
-+                     cmdParser.isSet(prohibitNotifyOption));
-          } else if (cmdParser.isSet(prohibitNotifyOption)) {
-              qDebug() << "screenshot no notify!";
-              w.noNotifyScreenshot();
+              w.savePathScreenshot(cmdParser.value(savePathOption));
+-         } else if (cmdParser.isSet(prohibitNotifyOption)) {
+-             qDebug() << "screenshot no notify!";
+-             w.noNotifyScreenshot();
+          } else if (cmdParser.isSet(iconOption)) {
+              w.delayScreenshot(0.2);
+          }  else {
 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
-index dcf4c14..b1c6cf1 100644
+index def901e..f1e0a59 100644
 --- a/src/mainwindow.cpp
 +++ b/src/mainwindow.cpp
-@@ -935,8 +935,10 @@ void MainWindow::fullScreenshot()
-     sendNotify(m_saveIndex, m_saveFileName, r);
- }
-
--void MainWindow::savePath(const QString &path)
-+void MainWindow::savePath(const QString &path, bool noNotify)
- {
-+    m_noNotify = noNotify;
-+
-     if (!QFileInfo(path).dir().exists()) {
-         exitApp();
-     }
-@@ -1017,8 +1019,10 @@ void MainWindow::saveSpecificedPath(QString path)
-
+@@ -1042,8 +1042,9 @@ void MainWindow::saveSpecificedPath(QString path)
+ 
      QString summary = QString(tr("Picture has been saved to %1")).arg(savePath);
-
+ 
 -    m_notifyDBInterface->Notify("Deepin Screenshot", 0,  "deepin-screenshot", "",
 -                                summary, actions, hints, 0);
-+    if (!m_noNotify) {
++    if (!m_noNotify)
 +        m_notifyDBInterface->Notify("Deepin Screenshot", 0,  "deepin-screenshot", "",
 +                                    summary, actions, hints, 0);
-+    }
      exitApp();
  }
-
+ 
+@@ -1073,15 +1074,7 @@ void MainWindow::saveSpecificedPath(QString path)
+ 
+ void MainWindow::noNotify()
+ {
+-    m_controlCenterDBInterface = new DBusControlCenter(this);
+-    m_hotZoneInterface = new DBusZone(this);
+-    m_interfaceExist = true;
+     m_noNotify = true;
+-
+-    initOriginUI();
+-    this->show();
+-    initSecondUI();
+-    initShortcut();
+ }
+ 
+ void MainWindow::topWindow()
+@@ -1414,7 +1407,8 @@ void MainWindow::sendNotify(SaveAction saveAction, QString saveFilePath, const b
+     if (!succeed)
+     {
+         const auto tips = tr("Save failed. Please save it in your home directory.");
+-        m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
++        if (!m_noNotify)
++            m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", QString(), tips, QStringList(), QVariantMap(), 0);
+ 
+ 	exit(0);
+     }
 diff --git a/src/mainwindow.h b/src/mainwindow.h
-index d04d424..4674732 100644
+index d27eade..8915eff 100644
 --- a/src/mainwindow.h
 +++ b/src/mainwindow.h
-@@ -82,7 +82,7 @@ class MainWindow : public QLabel
-
- public slots:
-     void fullScreenshot();
--    void savePath(const QString &path);
-+    void savePath(const QString &path, bool noNotify);
+@@ -72,6 +72,7 @@ public:
+     void initShapeWidget(QString type);
+     void initDBusInterface();
+     void initShortcut();
++    void noNotify();
+ 
+ signals:
+     void deleteShapes();
+@@ -86,7 +87,6 @@ public slots:
+     void savePath(const QString &path);
      void saveSpecificedPath(QString path);
  //    void delayScreenshot(int num);
-     void noNotify();
+-    void noNotify();
+     void topWindow();
+     void expressSaveScreenshot();
+     //Indicate that this program's started by clicking desktop file.
 diff --git a/src/screenshot.cpp b/src/screenshot.cpp
-index 5f4eade..7ca4dfb 100644
+index 4ced427..94542f4 100644
 --- a/src/screenshot.cpp
 +++ b/src/screenshot.cpp
-@@ -114,11 +114,11 @@ void Screenshot::noNotifyScreenshot()
-     m_window->noNotify();
+@@ -38,6 +38,14 @@ Screenshot::Screenshot(QObject *parent)
+ void Screenshot::initUI() {
+     m_eventContainer = new EventContainer(this);
+     m_window = new MainWindow;
++    if (m_noNotify) {
++        m_window->noNotify();
++    }
++}
++
++void Screenshot::noNotify()
++{
++    m_noNotify = true;
  }
-
--void Screenshot::savePathScreenshot(const QString &path)
-+void Screenshot::savePathScreenshot(const QString &path, bool noNotify)
+ 
+ void Screenshot::startScreenshot()
+@@ -54,7 +62,7 @@ void Screenshot::delayScreenshot(double num)
+     QStringList actions = QStringList();
+     QVariantMap hints;
+     DBusNotify* notifyDBus = new DBusNotify(this);
+-    if (num >= 2) {
++    if (num >= 2 && !m_noNotify) {
+         notifyDBus->Notify("Deepin Screenshot", 0,  "deepin-screenshot", "",
+                                     summary, actions, hints, 0);
+     }
+@@ -82,13 +90,6 @@ void Screenshot::topWindowScreenshot()
+     m_window->topWindow();
+ }
+ 
+-void Screenshot::noNotifyScreenshot()
+-{
+-    initUI();
+-    m_window->show();
+-    m_window->noNotify();
+-}
+-
+ void Screenshot::savePathScreenshot(const QString &path)
  {
      initUI();
-     m_window->show();
--    m_window->savePath(path);
-+    m_window->savePath(path, noNotify);
- }
-
- bool Screenshot::eventFilter(QObject* watched, QEvent *event)
 diff --git a/src/screenshot.h b/src/screenshot.h
-index 4e745cd..4a4a8a8 100644
+index 76d3e72..1c1f0dd 100644
 --- a/src/screenshot.h
 +++ b/src/screenshot.h
-@@ -35,7 +35,7 @@ public slots:
+@@ -29,12 +29,13 @@ public:
+     Screenshot(QObject* parent = 0);
+     ~Screenshot();
+ 
++    void noNotify();
++
+ public slots:
+     void startScreenshot();
+     void delayScreenshot(double num);
      void fullscreenScreenshot();
      void topWindowScreenshot();
-     void noNotifyScreenshot();
--    void savePathScreenshot(const QString &path);
-+    void savePathScreenshot(const QString &path, bool noNotify=false);
-
- protected:
-     bool  eventFilter(QObject* watched, QEvent* event) override;
+-    void noNotifyScreenshot();
+     void savePathScreenshot(const QString &path);
+ 
+ private:
+@@ -42,7 +43,7 @@ private:
+ 
+     EventContainer* m_eventContainer = nullptr;
+     MainWindow* m_window = nullptr;
+-
++    bool m_noNotify = false;
+ };
+ 
+ #endif // SCREENSHOT_H


More information about the arch-commits mailing list