summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2016-04-08 17:38:40 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2016-04-08 17:38:40 +0000
commitd0aef5c0c23b426582534f6a13a90833ac719373 (patch)
tree660706430f615580ed381f884dce85f4b102e1b8 /src
parentBug #1552765 fixed Break Apart dont handle well stroke with in documents diff... (diff)
downloadinkscape-d0aef5c0c23b426582534f6a13a90833ac719373.tar.gz
inkscape-d0aef5c0c23b426582534f6a13a90833ac719373.zip
Remove inkscape-specific glib clone function (and get rid of deprecated Glib ScopedPtr use)
Fixed bugs: - https://launchpad.net/bugs/1567485 (bzr r14766)
Diffstat (limited to 'src')
-rw-r--r--src/ui/clipboard.cpp39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index f0dc33740..4099bd631 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -146,8 +146,6 @@ private:
void _setClipboardColor(guint32);
void _userWarn(SPDesktop *, char const *);
- void _inkscape_wait_for_targets(std::list<Glib::ustring> &);
-
// private properites
SPDocument *_clipboardSPDoc; ///< Document that stores the clipboard until someone requests it
Inkscape::XML::Node *_defs; ///< Reference to the clipboard document's defs node
@@ -1302,9 +1300,7 @@ Geom::Scale ClipboardManagerImpl::_getScale(SPDesktop *desktop, Geom::Point cons
*/
Glib::ustring ClipboardManagerImpl::_getBestTarget()
{
- // GTKmm's wait_for_targets() is broken, see the comment in _inkscape_wait_for_targets()
- std::list<Glib::ustring> targets; // = _clipboard->wait_for_targets();
- _inkscape_wait_for_targets(targets);
+ std::list<Glib::ustring> targets = _clipboard->wait_for_targets();
// clipboard target debugging snippet
/*
@@ -1456,39 +1452,6 @@ void ClipboardManagerImpl::_userWarn(SPDesktop *desktop, char const *msg)
desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, msg);
}
-
-// GTKMM's clipboard::wait_for_targets is buggy and might return bogus, see
-//
-// https://bugs.launchpad.net/inkscape/+bug/296778
-// http://mail.gnome.org/archives/gtk-devel-list/2009-June/msg00062.html
-//
-// for details. Until this has been fixed upstream we will use our own implementation
-// of this method, as copied from /gtkmm-2.16.0/gtk/gtkmm/clipboard.cc.
-void ClipboardManagerImpl::_inkscape_wait_for_targets(std::list<Glib::ustring> &listTargets)
-{
- //Get a newly-allocated array of atoms:
- GdkAtom* targets = NULL;
- gint n_targets = 0;
- gboolean test = gtk_clipboard_wait_for_targets( gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), &targets, &n_targets );
- if (!test || (targets == NULL)) {
- return;
- }
-
- //Add the targets to the C++ container:
- for (int i = 0; i < n_targets; i++)
- {
- //Convert the atom to a string:
- gchar* const atom_name = gdk_atom_name(targets[i]);
-
- Glib::ustring target;
- if (atom_name) {
- target = Glib::ScopedPtr<char>(atom_name).get(); //This frees the gchar*.
- }
-
- listTargets.push_back(target);
- }
-}
-
/* #######################################
ClipboardManager class
####################################### */