# HG changeset patch # User Torsten # Date 1516436947 -3600 # Node ID be37df6e1fb4fd1e7e2b31f977702928ec8b065b # Parent ce2eb28e0a6d8deeca8a2c82350c352a2237b7d9 always enable paste action in windows (bug #52361) * main-window.cc (clipboard_has_changed): no more clipboard-mode parameter; (construct_edit_menu): using dataChanged signal from the clipboard instead of changed signal; always enable paste action in windows since the signals indicating a change of the clipboard are not working * main-window.h: slot clipboard_has_changed wihtout parameter diff -r ce2eb28e0a6d -r be37df6e1fb4 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Fri Jan 19 19:59:28 2018 -0800 +++ b/libgui/src/main-window.cc Sat Jan 20 09:29:07 2018 +0100 @@ -1666,20 +1666,17 @@ } void -main_window::clipboard_has_changed (QClipboard::Mode cp_mode) +main_window::clipboard_has_changed (void) { - if (cp_mode == QClipboard::Clipboard) + if (m_clipboard->text ().isEmpty ()) { - if (m_clipboard->text ().isEmpty ()) - { - m_paste_action->setEnabled (false); - m_clear_clipboard_action->setEnabled (false); - } - else - { - m_paste_action->setEnabled (true); - m_clear_clipboard_action->setEnabled (true); - } + m_paste_action->setEnabled (false); + m_clear_clipboard_action->setEnabled (false); + } + else + { + m_paste_action->setEnabled (true); + m_clear_clipboard_action->setEnabled (true); } } @@ -2265,9 +2262,16 @@ connect (m_clear_workspace_action, SIGNAL (triggered (void)), this, SLOT (handle_clear_workspace_request (void))); - connect (m_clipboard, SIGNAL (changed (QClipboard::Mode)), - this, SLOT (clipboard_has_changed (QClipboard::Mode))); - clipboard_has_changed (QClipboard::Clipboard); + connect (m_clipboard, SIGNAL (dataChanged (void)), + this, SLOT (clipboard_has_changed (void))); + clipboard_has_changed (); +#if defined (Q_OS_WIN32) + // Always enable paste action (unreliable clipboard signals in windows) + // FIXME: This has to be removed, when the clipboards signals in windows + // are working again + m_paste_action->setEnabled (true); + m_clear_clipboard_action->setEnabled (true); +#endif connect (m_preferences_action, SIGNAL (triggered (void)), this, SLOT (process_settings_dialog_request (void))); diff -r ce2eb28e0a6d -r be37df6e1fb4 libgui/src/main-window.h --- a/libgui/src/main-window.h Fri Jan 19 19:59:28 2018 -0800 +++ b/libgui/src/main-window.h Sat Jan 20 09:29:07 2018 +0100 @@ -260,7 +260,7 @@ //! Handling the clipboard. //!@{ - void clipboard_has_changed (QClipboard::Mode); + void clipboard_has_changed (void); void clear_clipboard (); //!@}