[git] GpgOL - branch, master, updated. gpgol-2.3.1-36-g289643c

by Andre Heinecke cvs at cvs.gnupg.org
Thu Nov 8 15:43:50 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  289643c1016d3e145329bedbc6bb91656f9e48f7 (commit)
       via  f991946b93e763d8cfe5ad2c2cf3f07d1b863503 (commit)
       via  db8f468e0462f2a4d600b41f8dd0e6b4135d38fa (commit)
      from  39f9f19fb8749b10bcdc9348f23bf5c61550994f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 289643c1016d3e145329bedbc6bb91656f9e48f7
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 8 15:43:36 2018 +0100

    Minor debug output improvements
    
    --

diff --git a/src/application-events.cpp b/src/application-events.cpp
index 82b1b34..5d8b9a8 100644
--- a/src/application-events.cpp
+++ b/src/application-events.cpp
@@ -98,9 +98,8 @@ EVENT_SINK_INVOKE(ApplicationEvents)
         }
       case Quit:
         {
-          TSTART;
-          log_debug ("%s:%s: Quit event", SRCNAME, __func__);
-          TBREAK;
+          log_debug ("%s:%s: Quit event. Shutting down",
+                     SRCNAME, __func__);
         }
       default:
         log_oom ("%s:%s: Unhandled Event: %lx \n",
diff --git a/src/debug.h b/src/debug.h
index 1d762b9..0de8a26 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -116,7 +116,7 @@ const char *anonstr (const char *data);
 const char *log_srcname (const char *s);
 #define SRCNAME log_srcname (__FILE__)
 
-#define STRANGEPOINT log_debug ("%s:%s:%d:_trace_", \
+#define STRANGEPOINT log_debug ("%s:%s:%d:UNEXPECTED", \
                            SRCNAME, __func__, __LINE__);
 #define TRACEPOINT log_trace ("%s:%s:%d", \
                               SRCNAME, __func__, __LINE__);

commit f991946b93e763d8cfe5ad2c2cf3f07d1b863503
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 8 15:43:21 2018 +0100

    Revert "Add InspectorEvents experiment"
    
    This reverts commit db8f468e0462f2a4d600b41f8dd0e6b4135d38fa.

diff --git a/src/Makefile.am b/src/Makefile.am
index dd8cbdf..369ce6d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,7 +49,6 @@ gpgol_SOURCES = \
     gpgoladdin.cpp gpgoladdin.h \
     gpgol.def \
     gpgol-ids.h \
-    inspector-events.cpp \
     keycache.cpp keycache.h \
     mail.h mail.cpp \
     mailitem-events.cpp \
diff --git a/src/eventsinks.h b/src/eventsinks.h
index dc62122..1508a62 100644
--- a/src/eventsinks.h
+++ b/src/eventsinks.h
@@ -32,6 +32,4 @@ LPDISPATCH install_ExplorersEvents_sink (LPDISPATCH obj);
 void detach_ExplorersEvents_sink (LPDISPATCH obj);
 LPDISPATCH install_FolderEvents_sink (LPDISPATCH obj);
 void detach_FolderEvents_sink (LPDISPATCH obj);
-LPDISPATCH install_InspectorEvents_sink (LPDISPATCH obj);
-void detach_InspectorEvents_sink (LPDISPATCH obj);
 #endif // EVENTSINKS_H
diff --git a/src/inspector-events.cpp b/src/inspector-events.cpp
deleted file mode 100644
index dbf684b..0000000
--- a/src/inspector-events.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/* inspector-events.cpp - Event handling for an inspector.
- * Copyright (C) 2018 Intevation GmBH
- *
- * This file is part of GpgOL.
- *
- * GpgOL is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * GpgOL is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/* The event handler classes defined in this file follow the
-   general pattern that they implment the IDispatch interface
-   through the eventsink macros and handle event invocations
-   in their invoke methods.
-*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "eventsink.h"
-#include "ocidl.h"
-#include "common.h"
-#include "oomhelp.h"
-#include "mail.h"
-
-/* Folder Events */
-BEGIN_EVENT_SINK(InspectorEvents, IDispatch)
-EVENT_SINK_DEFAULT_CTOR(InspectorEvents)
-EVENT_SINK_DEFAULT_DTOR(InspectorEvents)
-typedef enum
-  {
-    Activate = 0xF001,
-    AttachmentSelectionChange = 0xFC79,
-    BeforeMaximize = 0xFA11,
-    BeforeMinimize = 0xFA12,
-    BeforeMove = 0xFA13,
-    BeforeSize = 0xFA14,
-    Close = 0xF008,
-    Deactivate = 0xF006,
-    PageChange = 0xFBF4,
-  } InspectorEvent;
-
-EVENT_SINK_INVOKE(InspectorEvents)
-{
-  USE_INVOKE_ARGS
-  switch(dispid)
-    {
-      case Close:
-        {
-          TSTART;
-          log_oom ("%s:%s Close event in inspector %p",
-                   SRCNAME, __func__, this);
-          /* Get the mail object belonging to us */
-          auto mailitem = MAKE_SHARED (get_oom_object (m_object, "CurrentItem"));
-
-          if (!mailitem)
-            {
-              STRANGEPOINT;
-              TBREAK;
-            }
-
-          char *uid = get_unique_id (mailitem.get (), 0, nullptr);
-          mailitem = nullptr;
-          if (!uid)
-            {
-              log_debug ("%s:%s: Failed to find uid for %p \n",
-                         SRCNAME, __func__, mailitem);
-              TBREAK;
-            }
-          auto mail = Mail::getMailForUUID (uid);
-          xfree (uid);
-
-          if (!mail)
-            {
-              STRANGEPOINT;
-              TBREAK;
-            }
-
-          if (!mail->isCryptoMail())
-            {
-              STRANGEPOINT;
-              TBREAK;
-            }
-
-          if (mail->getCloseTriggered ())
-            {
-              log_debug ("%s:%s: Passing our close for item %p",
-                         SRCNAME, __func__, mail);
-              TBREAK;
-            }
-          mail->setCloseTriggered (true);
-          Mail::closeInspector_o (mail);
-          Mail::close (mail);
-        }
-      default:
-        break;
-#if 1
-        log_oom ("%s:%s: Unhandled Event: %lx \n",
-                       SRCNAME, __func__, dispid);
-#endif
-    }
-  return S_OK;
-}
-END_EVENT_SINK(InspectorEvents, IID_InspectorEvents)
diff --git a/src/mail.cpp b/src/mail.cpp
index e1d8214..eafa3ef 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -108,8 +108,7 @@ Mail::Mail (LPDISPATCH mailitem) :
     m_locate_count(0),
     m_is_about_to_be_moved(false),
     m_locate_in_progress(false),
-    m_is_junk(false),
-    m_inspector_events(nullptr)
+    m_is_junk(false)
 {
   TSTART;
   if (getMailForItem (mailitem))
@@ -221,12 +220,6 @@ Mail::~Mail()
   m_parser = nullptr;
   m_crypter = nullptr;
 
-  if (m_inspector_events)
-    {
-      log_oom ("%s:%s: Detaching inspector event handler",
-               SRCNAME, __func__);
-      detach_InspectorEvents_sink (m_inspector_events);
-    }
   releaseCurrentItem();
   gpgol_unlock (&dtor_lock);
   log_oom ("%s:%s: returning",
@@ -1101,17 +1094,6 @@ Mail::decryptVerify_o ()
       TRETURN 1;
     }
 
-  auto inspector = get_oom_object (m_mailitem, "GetInspector");
-  if (!inspector)
-    {
-      STRANGEPOINT;
-    }
-  else
-    {
-      m_inspector_events = install_InspectorEvents_sink (inspector);
-      gpgol_release (inspector);
-    }
-
   setUUID_o ();
   m_processed = true;
 
diff --git a/src/mail.h b/src/mail.h
index cbbb59a..170770c 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -655,6 +655,5 @@ private:
   std::string m_store_id; /* Store id for categories */
   std::string m_verify_category; /* The category string for the verify result */
   bool m_is_junk; /* Mail is in the junk folder */
-  LPDISPATCH m_inspector_events; /* Inspector event sink */
 };
 #endif // MAIL_H
diff --git a/src/oomhelp.h b/src/oomhelp.h
index 5c8865b..762f578 100644
--- a/src/oomhelp.h
+++ b/src/oomhelp.h
@@ -77,9 +77,6 @@ DEFINE_GUID(IID_ExplorersEvents, 0x00063078, 0x0000, 0x0000,
             0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
 DEFINE_GUID(IID_MailItemEvents, 0x0006302B, 0x0000, 0x0000,
             0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
-DEFINE_GUID(IID_InspectorEvents, 0x0006302A, 0x0000, 0x0000,
-            0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
-
 DEFINE_GUID(IID_MailItem, 0x00063034, 0x0000, 0x0000,
             0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
 DEFINE_GUID(IID_IMAPISecureMessage, 0x253cc320, 0xeab6, 0x11d0,

commit db8f468e0462f2a4d600b41f8dd0e6b4135d38fa
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 8 15:42:25 2018 +0100

    Add InspectorEvents experiment
    
    --
    This commit is just an experiment to check the order
    of events when closing.

diff --git a/src/Makefile.am b/src/Makefile.am
index 369ce6d..dd8cbdf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,6 +49,7 @@ gpgol_SOURCES = \
     gpgoladdin.cpp gpgoladdin.h \
     gpgol.def \
     gpgol-ids.h \
+    inspector-events.cpp \
     keycache.cpp keycache.h \
     mail.h mail.cpp \
     mailitem-events.cpp \
diff --git a/src/eventsinks.h b/src/eventsinks.h
index 1508a62..dc62122 100644
--- a/src/eventsinks.h
+++ b/src/eventsinks.h
@@ -32,4 +32,6 @@ LPDISPATCH install_ExplorersEvents_sink (LPDISPATCH obj);
 void detach_ExplorersEvents_sink (LPDISPATCH obj);
 LPDISPATCH install_FolderEvents_sink (LPDISPATCH obj);
 void detach_FolderEvents_sink (LPDISPATCH obj);
+LPDISPATCH install_InspectorEvents_sink (LPDISPATCH obj);
+void detach_InspectorEvents_sink (LPDISPATCH obj);
 #endif // EVENTSINKS_H
diff --git a/src/inspector-events.cpp b/src/inspector-events.cpp
new file mode 100644
index 0000000..dbf684b
--- /dev/null
+++ b/src/inspector-events.cpp
@@ -0,0 +1,113 @@
+/* inspector-events.cpp - Event handling for an inspector.
+ * Copyright (C) 2018 Intevation GmBH
+ *
+ * This file is part of GpgOL.
+ *
+ * GpgOL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GpgOL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* The event handler classes defined in this file follow the
+   general pattern that they implment the IDispatch interface
+   through the eventsink macros and handle event invocations
+   in their invoke methods.
+*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "eventsink.h"
+#include "ocidl.h"
+#include "common.h"
+#include "oomhelp.h"
+#include "mail.h"
+
+/* Folder Events */
+BEGIN_EVENT_SINK(InspectorEvents, IDispatch)
+EVENT_SINK_DEFAULT_CTOR(InspectorEvents)
+EVENT_SINK_DEFAULT_DTOR(InspectorEvents)
+typedef enum
+  {
+    Activate = 0xF001,
+    AttachmentSelectionChange = 0xFC79,
+    BeforeMaximize = 0xFA11,
+    BeforeMinimize = 0xFA12,
+    BeforeMove = 0xFA13,
+    BeforeSize = 0xFA14,
+    Close = 0xF008,
+    Deactivate = 0xF006,
+    PageChange = 0xFBF4,
+  } InspectorEvent;
+
+EVENT_SINK_INVOKE(InspectorEvents)
+{
+  USE_INVOKE_ARGS
+  switch(dispid)
+    {
+      case Close:
+        {
+          TSTART;
+          log_oom ("%s:%s Close event in inspector %p",
+                   SRCNAME, __func__, this);
+          /* Get the mail object belonging to us */
+          auto mailitem = MAKE_SHARED (get_oom_object (m_object, "CurrentItem"));
+
+          if (!mailitem)
+            {
+              STRANGEPOINT;
+              TBREAK;
+            }
+
+          char *uid = get_unique_id (mailitem.get (), 0, nullptr);
+          mailitem = nullptr;
+          if (!uid)
+            {
+              log_debug ("%s:%s: Failed to find uid for %p \n",
+                         SRCNAME, __func__, mailitem);
+              TBREAK;
+            }
+          auto mail = Mail::getMailForUUID (uid);
+          xfree (uid);
+
+          if (!mail)
+            {
+              STRANGEPOINT;
+              TBREAK;
+            }
+
+          if (!mail->isCryptoMail())
+            {
+              STRANGEPOINT;
+              TBREAK;
+            }
+
+          if (mail->getCloseTriggered ())
+            {
+              log_debug ("%s:%s: Passing our close for item %p",
+                         SRCNAME, __func__, mail);
+              TBREAK;
+            }
+          mail->setCloseTriggered (true);
+          Mail::closeInspector_o (mail);
+          Mail::close (mail);
+        }
+      default:
+        break;
+#if 1
+        log_oom ("%s:%s: Unhandled Event: %lx \n",
+                       SRCNAME, __func__, dispid);
+#endif
+    }
+  return S_OK;
+}
+END_EVENT_SINK(InspectorEvents, IID_InspectorEvents)
diff --git a/src/mail.cpp b/src/mail.cpp
index eafa3ef..e1d8214 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -108,7 +108,8 @@ Mail::Mail (LPDISPATCH mailitem) :
     m_locate_count(0),
     m_is_about_to_be_moved(false),
     m_locate_in_progress(false),
-    m_is_junk(false)
+    m_is_junk(false),
+    m_inspector_events(nullptr)
 {
   TSTART;
   if (getMailForItem (mailitem))
@@ -220,6 +221,12 @@ Mail::~Mail()
   m_parser = nullptr;
   m_crypter = nullptr;
 
+  if (m_inspector_events)
+    {
+      log_oom ("%s:%s: Detaching inspector event handler",
+               SRCNAME, __func__);
+      detach_InspectorEvents_sink (m_inspector_events);
+    }
   releaseCurrentItem();
   gpgol_unlock (&dtor_lock);
   log_oom ("%s:%s: returning",
@@ -1094,6 +1101,17 @@ Mail::decryptVerify_o ()
       TRETURN 1;
     }
 
+  auto inspector = get_oom_object (m_mailitem, "GetInspector");
+  if (!inspector)
+    {
+      STRANGEPOINT;
+    }
+  else
+    {
+      m_inspector_events = install_InspectorEvents_sink (inspector);
+      gpgol_release (inspector);
+    }
+
   setUUID_o ();
   m_processed = true;
 
diff --git a/src/mail.h b/src/mail.h
index 170770c..cbbb59a 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -655,5 +655,6 @@ private:
   std::string m_store_id; /* Store id for categories */
   std::string m_verify_category; /* The category string for the verify result */
   bool m_is_junk; /* Mail is in the junk folder */
+  LPDISPATCH m_inspector_events; /* Inspector event sink */
 };
 #endif // MAIL_H
diff --git a/src/oomhelp.h b/src/oomhelp.h
index 762f578..5c8865b 100644
--- a/src/oomhelp.h
+++ b/src/oomhelp.h
@@ -77,6 +77,9 @@ DEFINE_GUID(IID_ExplorersEvents, 0x00063078, 0x0000, 0x0000,
             0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
 DEFINE_GUID(IID_MailItemEvents, 0x0006302B, 0x0000, 0x0000,
             0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
+DEFINE_GUID(IID_InspectorEvents, 0x0006302A, 0x0000, 0x0000,
+            0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
+
 DEFINE_GUID(IID_MailItem, 0x00063034, 0x0000, 0x0000,
             0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
 DEFINE_GUID(IID_IMAPISecureMessage, 0x253cc320, 0xeab6, 0x11d0,

-----------------------------------------------------------------------

Summary of changes:
 src/application-events.cpp | 5 ++---
 src/debug.h                | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list