Imported Upstream version 2.41.1 upstream/2.41.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 06:46:51 +0000 (23:46 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 06:46:51 +0000 (23:46 -0700)
16 files changed:
NEWS
configure.ac
gio/src/application.hg
gio/src/desktopappinfo.hg
gio/src/settings.ccg
gio/src/settings.hg
gio/src/simpleactiongroup.hg
gio/src/tlsconnection.hg
gio/src/volumemonitor.hg
glib/glibmm/filelist.am
glib/src/filelist.am
glib/src/keyfile.hg
glib/src/valuearray.hg
tests/glibmm_interface_implementation/main.cc
tests/glibmm_valuearray/main.cc
tools/pm/DocsParser.pm

diff --git a/NEWS b/NEWS
index 6f3e65c..ddc72a0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,35 @@
-2.41:
+2.41.1 (unstable):
+
+Gio:
+* Application: Deprecate set_action_group().
+  (Kjell Ahlstedt)
+* DesktopAppInfo: Deprecate set_desktop_env().
+  (Kjell Ahlstedt)
+* Settings:  Deprecate list_schemas(), range_check() and
+  property_schema().
+  (Kjell Ahlstedt)
+* TlsConnection: Deprecate [set|get]_use_system_certdb()
+  and property_use_system_certdb().
+  (Kjell Ahlstedt)
+* VolumeMonitor: Deprecate adopt_orphan_mount().
+  (Kjell Ahlstedt)
+
+Glib:
+* Keyfile: Deprecate one of the load_from_dirs() methods.
+  (Kjell Ahlstedt)
+* ValueArray: Deprecated.
+  (Kjell Ahlstedt)
+
+tests:
+* Test custom properties and an interface with properties.
+  (José Alburquerque) Bug #697229
+
+Documentation:
+*  Add a blank line after @deprecated and @newin to help doxygen.
+  (Kjell Ahlstedt)
+
+
+2.41.0 (unstable):
   
 Gio:
 * Application:
index 76f440b..e2f48ae 100644 (file)
@@ -15,7 +15,7 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([glibmm], [2.41.0],
+AC_INIT([glibmm], [2.41.1],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
         [glibmm], [http://www.gtkmm.org/])
 AC_PREREQ([2.59])
index 9640c10..48613dc 100644 (file)
@@ -17,6 +17,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+_CONFIGINCLUDE(giommconfig.h)
+
 #m4 _PUSH(SECTION_CC_PRE_INCLUDES)
 #undef G_DISABLE_DEPRECATED
 #define GLIB_DISABLE_DEPRECATION_WARNINGS 1
@@ -70,10 +72,11 @@ _WRAP_ENUM(ApplicationFlags, GApplicationFlags, NO_GTYPE)
  * changed using hold() and release(). If it drops to zero, the application
  * exits.
  *
- * Application also implements the ActionGroup interface and lets you easily
- * export actions by adding them with set_action_group(). When
- * invoking an action by calling Gio::ActionGroup::activate_action() on the
- * application, it is always invoked in the primary instance.
+ * Application also implements the ActionGroup and ActionMap
+ * interfaces and lets you easily export actions by adding them with
+ * Gio::ActionMap::add_action(). When invoking an action by calling
+ * Gio::ActionGroup::activate_action() on the application, it is always
+ * invoked in the primary instance.
  *
  * There is a number of different entry points into an Application:
  *
@@ -159,7 +162,8 @@ public:
   _WRAP_METHOD(ApplicationFlags get_flags() const, g_application_get_flags)
   _WRAP_METHOD(void set_flags(ApplicationFlags flags), g_application_set_flags)
 
-  _WRAP_METHOD(void set_action_group(const Glib::RefPtr<ActionGroup>& action_group), g_application_set_action_group)
+  _WRAP_METHOD(void set_action_group(const Glib::RefPtr<ActionGroup>& action_group), g_application_set_action_group,
+    deprecated "Use the Gio::ActionMap interface instead.")
 
   //Note: We would like to add a group, not just some entries,
   //so we can do pre and post parsing. See https://bugzilla.gnome.org/show_bug.cgi?id=727602
index 3392b0c..916830e 100644 (file)
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+_CONFIGINCLUDE(giommconfig.h)
+
 #include <glibmm/object.h>
 #include <giomm/appinfo.h>
 
 _DEFS(giomm,gio)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef G_DISABLE_DEPRECATED
+#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Glib
 {
 
@@ -55,7 +62,8 @@ public:
 
   _WRAP_METHOD(std::string get_filename() const, g_desktop_app_info_get_filename)
   _WRAP_METHOD(bool is_hidden() const, g_desktop_app_info_get_is_hidden)
-  _WRAP_METHOD(static void set_desktop_env(const std::string& desktop_env), g_desktop_app_info_set_desktop_env)
+  _WRAP_METHOD(static void set_desktop_env(const std::string& desktop_env), g_desktop_app_info_set_desktop_env,
+    deprecated "Do not use this API. Since 2.42 the value of the `XDG_CURRENT_DESKTOP` environment variable will be used.")
 
 #m4 _CONVERSION(`const char* const*', `std::vector<Glib::ustring>', `Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
   _WRAP_METHOD(std::vector<Glib::ustring> get_keywords() const, g_desktop_app_info_get_keywords)
index ca92f15..d800aa9 100644 (file)
@@ -63,9 +63,11 @@ void Settings::bind_writable(const Glib::ustring& key,
     bind_writable(key, property_proxy.get_object(), property_proxy.get_name(), inverted);
 }
 
+_DEPRECATE_IFDEF_START
 std::vector<Glib::ustring> Settings::list_schemas()
 {
   return Glib::ArrayHandler<Glib::ustring>::array_to_vector(g_settings_list_schemas(), Glib::OWNERSHIP_NONE);
 }
+_DEPRECATE_IFDEF_END
 
 }
index 4e45cee..75407d5 100644 (file)
@@ -15,6 +15,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+_CONFIGINCLUDE(giommconfig.h)
+
 #include <glibmm/arrayhandle.h>
 #include <glibmm/object.h>
 #include <glibmm/variant.h>
 _DEFS(giomm,gio)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef G_DISABLE_DEPRECATED
+#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Gio
 {
 
@@ -164,19 +171,23 @@ public:
 
   _WRAP_METHOD(void reset(const Glib::ustring& key), g_settings_reset)
 
+_DEPRECATE_IFDEF_START
 //We must hand-code this because gmmproc is confused by the static keyword with the vector.
 //#m4 _CONVERSION(`const gchar*const*',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
   _WRAP_METHOD_DOCS_ONLY(g_settings_list_schemas)
   static std::vector<Glib::ustring> list_schemas();
   _IGNORE(g_settings_list_schemas)
+_DEPRECATE_IFDEF_END
 
 #m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
   _WRAP_METHOD(std::vector<Glib::ustring> list_children() const, g_settings_list_children)
   _WRAP_METHOD(std::vector<Glib::ustring> list_keys() const, g_settings_list_keys)
 
-  //TODO: Choose an appropriate Variant template type: GVariant* g_settings_get_range(const gchar* key)
+  _IGNORE(g_settings_get_range, g_settings_list_relocatable_schemas) // deprecated
 
-  _WRAP_METHOD(bool range_check(const Glib::ustring& key, const Glib::VariantBase& value) const, g_settings_range_check)
+  _WRAP_METHOD(bool range_check(const Glib::ustring& key, const Glib::VariantBase& value) const, g_settings_range_check,
+    deprecated "Use g_settings_schema_key_range_check() instead.")
+  //TODO: Wrap GSettingsSchema
 
 #m4 _CONVERSION(`Glib::ObjectBase*',`gpointer',(gpointer)$3->gobj())
   _WRAP_METHOD(void bind(const Glib::ustring& key, Glib::ObjectBase* object, const Glib::ustring& property, SettingsBindFlags flags=SETTINGS_BIND_DEFAULT), g_settings_bind)
@@ -193,7 +204,7 @@ public:
   _WRAP_PROPERTY("delay-apply", bool)
   _WRAP_PROPERTY("has-unapplied", bool)
   _WRAP_PROPERTY("path", std::string)
-  _WRAP_PROPERTY("schema", Glib::ustring)
+  _WRAP_PROPERTY("schema", Glib::ustring, deprecated "Use the 'schema-id' property instead. In a future version, this property may instead refer to a SettingsSchema.")
   _WRAP_PROPERTY("schema-id", Glib::ustring)
 
   //TODO: _WRAP_PROPERTY("settings-schema", Glib::RefPtr<SettingsSchema>)
index 9055877..138e4fe 100644 (file)
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+_CONFIGINCLUDE(giommconfig.h)
+
 #include <giomm/actionmap.h>
 #include <giomm/actiongroup.h>
 
 _DEFS(giomm,gio)
 _PINCLUDE(glibmm/private/object_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef G_DISABLE_DEPRECATED
+#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Gio
 {
 
@@ -53,9 +60,7 @@ public:
   _WRAP_METHOD(void insert(const Glib::RefPtr<Action>& action), g_simple_action_group_insert, deprecated "Use ActionMap::add_action() instead")
   _WRAP_METHOD(void remove(const Glib::ustring& action_name), g_simple_action_group_remove, deprecated "Use ActionMap::remove_action() instead")
 
-  //We ignore g_simple_action_group_add_entries() because it does nothing but call g_action_map_add_action_entries(),
-  //which is already in the base class.
-  _IGNORE(g_simple_action_group_add_entries)
+  _IGNORE(g_simple_action_group_add_entries) // deprecated
 };
 
 } // namespace Gio
index 69ff724..bc753d3 100644 (file)
@@ -15,6 +15,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+_CONFIGINCLUDE(giommconfig.h)
+
 #include <giomm/iostream.h>
 #include <giomm/tlscertificate.h>
 #include <giomm/asyncresult.h>
 _DEFS(giomm,gio)
 _PINCLUDE(giomm/private/iostream_p.h)
 
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef G_DISABLE_DEPRECATED
+#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
 namespace Gio
 {
 
@@ -62,8 +69,10 @@ public:
   _WRAP_METHOD(void set_rehandshake_mode(TlsRehandshakeMode mode), g_tls_connection_set_rehandshake_mode)
   _WRAP_METHOD(TlsRehandshakeMode get_rehandshake_mode() const, g_tls_connection_get_rehandshake_mode)
 
-  _WRAP_METHOD(void set_use_system_certdb(bool use_system_certdb = true), g_tls_connection_set_use_system_certdb)
-  _WRAP_METHOD(bool get_use_system_certdb() const, g_tls_connection_get_use_system_certdb)
+  _WRAP_METHOD(void set_use_system_certdb(bool use_system_certdb = true), g_tls_connection_set_use_system_certdb,
+    deprecated "Use set_database() instead.")
+  _WRAP_METHOD(bool get_use_system_certdb() const, g_tls_connection_get_use_system_certdb,
+    deprecated "Use get_database() instead.")
 
   _WRAP_METHOD(Glib::RefPtr<TlsDatabase> get_database(), g_tls_connection_get_database)
   _WRAP_METHOD(Glib::RefPtr<const TlsDatabase> get_database() const, g_tls_connection_get_database, constversion)
@@ -90,7 +99,7 @@ public:
   _WRAP_PROPERTY("peer-certificate-errors", TlsCertificateFlags)
   _WRAP_PROPERTY("rehandshake-mode", TlsRehandshakeMode)
   _WRAP_PROPERTY("require-close-notify", bool)
-  _WRAP_PROPERTY("use-system-certdb", bool)
+  _WRAP_PROPERTY("use-system-certdb", bool, deprecated "Use property_database() instead.")
 
 #m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
   _WRAP_SIGNAL(bool accept_certificate(const Glib::RefPtr<const TlsCertificate>& peer_cert, TlsCertificateFlags errors), "accept_certificate")
index 6e7cc1a..5a5fcf9 100644 (file)
@@ -17,6 +17,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+_CONFIGINCLUDE(giommconfig.h)
+
 #m4 _PUSH(SECTION_CC_PRE_INCLUDES)
 #undef G_DISABLE_DEPRECATED
 #define GLIB_DISABLE_DEPRECATION_WARNINGS 1
@@ -60,11 +62,8 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid), g_volume_monitor_get_volume_for_uuid, refreturn)
   _WRAP_METHOD(Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid), g_volume_monitor_get_mount_for_uuid, refreturn)
 
-_DEPRECATE_IFDEF_START
-
-  _WRAP_METHOD(static Glib::RefPtr<Volume> adopt_orphan_mount(const Glib::RefPtr<Mount>& mount), g_volume_monitor_adopt_orphan_mount)
-
-_DEPRECATE_IFDEF_END
+  _WRAP_METHOD(static Glib::RefPtr<Volume> adopt_orphan_mount(const Glib::RefPtr<Mount>& mount), g_volume_monitor_adopt_orphan_mount,
+    deprecated "Instead of using this function, create shadow mounts with the URI of the mount you intend to adopt.")
 
 #m4 _CONVERSION(`GVolume*',`const Glib::RefPtr<Volume>&',`Glib::wrap($3, true)')
   _WRAP_SIGNAL(void volume_added(const Glib::RefPtr<Volume>& volume), volume_added)
index dcc3294..97170ce 100644 (file)
@@ -1,7 +1,7 @@
 ## This file is part of glibmm.
 
-glibmm_files_built_cc = $(glibmm_files_hg:.hg=.cc) $(glibmm_files_cc_m4:.m4=) wrap_init.cc
-glibmm_files_built_h  = $(glibmm_files_hg:.hg=.h) $(glibmm_files_h_m4:.m4=)
+glibmm_files_built_cc = $(glibmm_files_used_hg:.hg=.cc) $(glibmm_files_cc_m4:.m4=) wrap_init.cc
+glibmm_files_built_h  = $(glibmm_files_used_hg:.hg=.h) $(glibmm_files_h_m4:.m4=)
 glibmm_files_built_ph = $(patsubst %.hg,private/%_p.h,$(glibmm_files_hg))
 
 glibmm_files_extra_cc =                        \
index 8db8500..d240146 100644 (file)
@@ -14,8 +14,7 @@ glibmm_files_defs =           \
        glib_docs.xml           \
        glib_docs_override.xml
 
-# Note that all of thread.hg is deprecated 
-glibmm_files_hg =              \
+glibmm_files_any_hg =          \
        balancedtree.hg         \
        bytes.hg                \
        bytearray.hg            \
@@ -35,17 +34,27 @@ glibmm_files_hg =           \
        regex.hg                \
        shell.hg                \
        spawn.hg                \
-       thread.hg               \
        threads.hg              \
        timezone.hg             \
        unicode.hg              \
        uriutils.hg             \
-       valuearray.hg           \
        variant.hg              \
        variantdict.hg          \
        variantiter.hg          \
        varianttype.hg
 
+glibmm_files_deprecated_hg = \
+       thread.hg               \
+       valuearray.hg
+
+if DISABLE_DEPRECATED_API
+glibmm_files_used_hg = $(glibmm_files_any_hg)
+else
+glibmm_files_used_hg = $(glibmm_files_any_hg) $(glibmm_files_deprecated_hg)
+endif
+
+glibmm_files_hg = $(glibmm_files_any_hg) $(glibmm_files_deprecated_hg)
+
 glibmm_files_ccg = $(glibmm_files_hg:.hg=.ccg)
 
 glibmm_files_cc_m4 = value_basictypes.cc.m4 variant_basictypes.cc.m4
index b1560e9..5f7c199 100644 (file)
@@ -136,11 +136,8 @@ public:
 #m4 _CONVERSION(`const Glib::ArrayHandle<std::string>&', `const gchar**', `const_cast<const gchar**>($3.data())')
 #m4 _CONVERSION(`Glib::ArrayHandle<std::string>&', `gchar**', `const_cast<gchar**>($3.data())')
 
-_DEPRECATE_IFDEF_START
-
-  _WRAP_METHOD(bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, Glib::ArrayHandle<std::string>& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE), g_key_file_load_from_dirs, errthrow)
-
-_DEPRECATE_IFDEF_END
+  _WRAP_METHOD(bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, Glib::ArrayHandle<std::string>& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE),
+    g_key_file_load_from_dirs, errthrow, deprecated "Use the load_from_dirs() method that takes a std::string& full_path.")
 
   _WRAP_METHOD_DOCS_ONLY(g_key_file_load_from_dirs)
   bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, std::string& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE);
index fa3231a..518123f 100644 (file)
@@ -15,6 +15,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+_CONFIGINCLUDE(glibmmconfig.h)
+
 _DEFS(glibmm,glib)
 
 #include <glib-object.h>
@@ -26,6 +28,8 @@ _DEFS(glibmm,glib)
 #define GLIB_DISABLE_DEPRECATION_WARNINGS 1
 #m4 _POP()
 
+_IS_DEPRECATED // This whole file is deprecated.
+
 namespace Glib
 {
 
@@ -35,6 +39,9 @@ namespace Glib
  * elements.
  *
  * @newin{2,22}
+ *
+ * @deprecated Use std::vector<Glib::ValueBase*> or std::vector< Glib::Value<> >
+ *             instead of Glib::ValueArray.
  */
 class ValueArray
 {
index dfbb716..bc8253b 100644 (file)
@@ -2,30 +2,34 @@
 #include <giomm.h> //There are no Interfaces in glibmm, but there are in giomm.
 #include <iostream>
 
-//TODO: I also tried Glib::Action, but that needs us to implement interface properties. murrayc
-class CustomConverter :
-  public Glib::Object,
-  public Gio::Converter
+class CustomAction :
+  public Gio::Action,
+  public Glib::Object
 {
 public:
-  CustomConverter();
+  CustomAction();
+
+  // A custom property.
+  Glib::Property<Glib::ustring> property;
 
 protected:
   //Implement a vfunc:
-  virtual void reset_vfunc();
+  virtual Glib::ustring get_name_vfunc() const;
 };
 
-CustomConverter::CustomConverter()
-: Glib::ObjectBase( typeid(CustomConverter) ),
-  Glib::Object()
+CustomAction::CustomAction()
+: Glib::ObjectBase( typeid(CustomAction) ),
+  Glib::Object(),
+  property(*this, "custom_property", "Initial value.")
 {
 }
 
-static bool reset_called = false;
+static bool get_name_called = false;
 
-void CustomConverter::reset_vfunc()
+Glib::ustring CustomAction::get_name_vfunc() const
 {
-  reset_called = true;
+  get_name_called = true;
+  return "custom-name";
 }
 
 
@@ -33,9 +37,28 @@ int main(int, char**)
 {
   Glib::init();
 
-  CustomConverter converter;
-  converter.reset();
-  g_assert(reset_called);
+  CustomAction action;
+  Glib::ustring name = action.get_name();
+  std::cout << "The name is '" << name << "'." << std::endl;
+  std::cout << "The name property of the implemented interface is '"
+            << action.property_name().get_value() << "'." << std::endl;
+  std::cout << "The custom string property is '"
+            << action.property.get_value() << "'." << std::endl;
+
+  action.property = "A new value.";
+  std::cout << "The custom string property (after changing it) is '"
+            << action.property.get_value() << "'." << std::endl;
+
+  gchar* prop_value = 0;
+  g_object_set(action.gobj(), "custom_property", "Another value", NULL);
+  g_object_get(action.gobj(), "custom_property", &prop_value, NULL);
+  std::cout << "The custom property after g_object_get/set() is '"
+            << prop_value << "'." << std::endl;
+  std::cout << "The custom property through the Glib::Property<> is '"
+            << action.property.get_value() << "'." << std::endl;
+  std::cout << "The name property of the implemented interface is '"
+            << action.property_name().get_value() << "'." << std::endl;
+  g_assert(get_name_called);
 
   return EXIT_SUCCESS;
 }
index b3e3184..2139d43 100644 (file)
@@ -1,6 +1,21 @@
+// Glib::ValueArray is deprecated, but let's keep the test.
+// The recommended replacement is std::vector<> which requires no test here.
+#undef GLIBMM_DISABLE_DEPRECATED
+
 #include <glibmm.h>
 #include <iostream>
 
+#ifdef GLIBMM_DISABLE_DEPRECATED
+int main(int, char**)
+{
+  // If glibmm is configured with --disable-deprecated-api, GLIBMM_DISABLE_DEPRECATED
+  // is defined in glibmm.h (actually in glibmmconfig.h). The undef at the start of
+  // this file has no effect.
+  return 77; // Tell automake's test harness to skip this test.
+}
+
+#else
+
 //Use this line if you want debug output:
 //std::ostream& ostr = std::cout;
 
@@ -84,3 +99,4 @@ int main(int, char**)
 
   return EXIT_SUCCESS;
 }
+#endif //GLIBMM_DISABLE_DEPRECATED
index 854502d..c771fc3 100644 (file)
@@ -335,11 +335,14 @@ sub lookup_documentation($$;$)
   }
 
   DocsParser::convert_docs_to_cpp($objFunction, \$text);
+  # A blank line, marking the end of a paragraph, is needed after @newin.
+  # Most @newins are at the end of a function description.
+  $text .= "\n";
 
   #Add note about deprecation if we have specified that in our _WRAP_METHOD() call:
   if($deprecation_docs ne "")
   {
-    $text .= "\n\@deprecated $deprecation_docs";
+    $text .= "\n\@deprecated $deprecation_docs\n";
   }
 
   DocsParser::append_parameter_docs($objFunction, \$text, $objCppfunc);