forked from desktop-app/patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglibmm.patch
158 lines (141 loc) · 5.77 KB
/
glibmm.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index f2f60355..d6bb2652 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -807,8 +807,12 @@ guint Connection::signal_subscribe(
{
SlotSignal* slot_copy = new SlotSignal(slot);
- return g_dbus_connection_signal_subscribe(gobj(), sender.c_str(),
- interface_name.c_str(), member.c_str(), object_path.c_str(), arg0.c_str(),
+ return g_dbus_connection_signal_subscribe(gobj(),
+ (sender.empty() ? nullptr : sender.c_str()),
+ (interface_name.empty() ? nullptr : interface_name.c_str()),
+ (member.empty() ? nullptr : member.c_str()),
+ (object_path.empty() ? nullptr : object_path.c_str()),
+ (arg0.empty() ? nullptr : arg0.c_str()),
static_cast<GDBusSignalFlags>(flags),
&DBusConnection_Signal_giomm_callback, slot_copy,
&DBusConnection_Signal_giomm_callback_destroy);
diff --git a/glib/glibmm/objectbase.cc b/glib/glibmm/objectbase.cc
index 140816a4..c7add7fe 100644
--- a/glib/glibmm/objectbase.cc
+++ b/glib/glibmm/objectbase.cc
@@ -1,6 +1,3 @@
-// -*- c++ -*-
-/* $Id$ */
-
/* Copyright 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
@@ -46,7 +43,7 @@ namespace Glib
// static data members
ObjectBase::extra_object_base_data_type ObjectBase::extra_object_base_data;
-std::auto_ptr<Threads::Mutex> ObjectBase::extra_object_base_data_mutex(new Threads::Mutex());
+Threads::Mutex* ObjectBase::extra_object_base_data_mutex = new Threads::Mutex();
ObjectBase::ObjectBase()
:
diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h
index 9c4c4e8e..2b81680e 100644
--- a/glib/glibmm/objectbase.h
+++ b/glib/glibmm/objectbase.h
@@ -30,7 +30,7 @@
#include <sigc++/trackable.h>
#include <typeinfo>
#include <map> // Needed until the next ABI break.
-#include <memory> // auto_ptr, needed until the next ABI break.
+#include <memory> // Not used by ObjectBase any more, but user code may rely on it being here.
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" { typedef struct _GObject GObject; }
@@ -208,10 +208,10 @@ typedef std::map<const ObjectBase*, ExtraObjectBaseData> extra_object_base_data_
static extra_object_base_data_type extra_object_base_data;
// ObjectBase instances may be used in different threads.
// Accesses to extra_object_base_data must be thread-safe.
-// auto_ptr, because we don't want to include glibmm/threads.h in objectbase.h.
+// Threads::Mutex*, because we don't want to include glibmm/threads.h in objectbase.h.
// threads.h must be the first included file that includes glib.h. That could cause
// problems in files that directly or indirectly include objectbase.h.
-static std::auto_ptr<Threads::Mutex> extra_object_base_data_mutex;
+static Threads::Mutex* extra_object_base_data_mutex;
public: // is_derived_() must be public, so that overridden vfuncs and signal handlers can call it via ObjectBase.
diff --git a/glib/src/threads.hg b/glib/src/threads.hg
index 52bb4b41..fc035c0a 100644
--- a/glib/src/threads.hg
+++ b/glib/src/threads.hg
@@ -583,7 +583,7 @@ public:
*/
inline void replace(T* data);
- GPrivate* gobj() { return gobject_; }
+ GPrivate* gobj() { return &gobject_; }
private:
GPrivate gobject_;
diff --git a/glib/src/variant.ccg b/glib/src/variant.ccg
index a7c53524..05eba90e 100644
--- a/glib/src/variant.ccg
+++ b/glib/src/variant.ccg
@@ -149,7 +149,7 @@ void VariantContainerBase::get_child(VariantBase& child, gsize index) const
// VariantContainerBase has no method variant_type()
template<>
VariantContainerBase VariantBase::cast_dynamic<VariantContainerBase>(const VariantBase& v)
-throw(std::bad_cast)
+noexcept(false)
{
if(!v.gobj())
{
@@ -260,7 +260,7 @@ Glib::ustring Variant<Glib::ustring>::get() const
// See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
template<>
Variant<Glib::ustring> VariantBase::cast_dynamic< Variant<Glib::ustring> >(const VariantBase& v)
-throw(std::bad_cast)
+noexcept(false)
{
if(!v.gobj())
{
@@ -309,7 +309,7 @@ Variant<std::string>::create(const std::string& data)
// See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
template<>
Variant<std::string> VariantBase::cast_dynamic< Variant<std::string> >(const VariantBase& v)
-throw(std::bad_cast)
+noexcept(false)
{
if(!v.gobj())
{
diff --git a/glib/src/variant.hg b/glib/src/variant.hg
index 0cb1a827..bda46856 100644
--- a/glib/src/variant.hg
+++ b/glib/src/variant.hg
@@ -208,7 +208,7 @@ public:
* @throws std::bad_cast if the Variant was not of the expected type.
*/
template<class V_CastTo>
- static V_CastTo cast_dynamic(const VariantBase& v) throw(std::bad_cast);
+ static V_CastTo cast_dynamic(const VariantBase& v) noexcept(false);
_IGNORE(g_variant_dict_new)
@@ -236,7 +236,7 @@ private:
template<class V_CastTo>
V_CastTo VariantBase::cast_dynamic(const VariantBase& v)
-throw(std::bad_cast)
+noexcept(false)
{
if(!(v.gobj()))
{
@@ -391,7 +391,7 @@ public:
template<>
VariantContainerBase VariantBase::cast_dynamic<VariantContainerBase>(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
/** Template class used for the specialization of the Variant<> classes.
* @newin{2,28}
@@ -554,7 +554,7 @@ public:
template<>
Variant<Glib::ustring> VariantBase::cast_dynamic< Variant<Glib::ustring> >(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
/** Specialization of Variant containing a std::string, for variants of type
* bytestring, object path, or signature.
@@ -603,7 +603,7 @@ public:
template<>
Variant<std::string> VariantBase::cast_dynamic< Variant<std::string> >(const VariantBase& v)
-throw(std::bad_cast);
+noexcept(false);
/** Specialization of Variant containing a dictionary entry. See also
* Variant< std::map<K, V> >.