]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSelection.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiSelection.cpp
index 29cb8951e7acbc5e22a81ba48e9b2217f6af76f9..23878b32328f49b90117ff6f03b8de9753945cab 100644 (file)
 #include <config.h>
 
 #include "GuiSelection.h"
+
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
+#include "support/lstrings.h"
 
 #include <QApplication>
 #include <QClipboard>
 #include <QString>
 
-#include "support/lstrings.h"
-using lyx::support::internalLineEnding;
-using lyx::support::externalLineEnding;
-
-using std::endl;
 
 namespace lyx {
 namespace frontend {
 
+using support::internalLineEnding;
+using support::externalLineEnding;
+
+
 GuiSelection::GuiSelection()
        : selection_supported_(qApp->clipboard()->supportsSelection())
 {
-       connect(qApp->clipboard(), SIGNAL(dataChanged()),
+       connect(qApp->clipboard(), SIGNAL(selectionChanged()),
                this, SLOT(on_dataChanged()));
        // initialize clipboard status.
        on_dataChanged();
@@ -70,8 +71,7 @@ docstring const GuiSelection::get() const
 {
        QString const str = qApp->clipboard()->text(QClipboard::Selection)
                                .normalized(QString::NormalizationForm_C);
-       LYXERR(Debug::ACTION) << "GuiSelection::get: " << fromqstr(str)
-                             << endl;
+       LYXERR(Debug::ACTION, "GuiSelection::get: " << fromqstr(str));
        if (str.isNull())
                return docstring();
 
@@ -81,7 +81,7 @@ docstring const GuiSelection::get() const
 
 void GuiSelection::put(docstring const & str)
 {
-       LYXERR(Debug::ACTION) << "GuiSelection::put: " << to_utf8(str) << endl;
+       LYXERR(Debug::ACTION, "GuiSelection::put: " << to_utf8(str));
 
        qApp->clipboard()->setText(toqstr(externalLineEnding(str)),
                                   QClipboard::Selection);
@@ -100,6 +100,8 @@ bool GuiSelection::empty() const
        if (!selection_supported_)
                return true;
 
+       LYXERR(Debug::ACTION, "GuiSelection::empty: " << text_selection_empty_);
+
        return text_selection_empty_;
 }