From 4f0981e7bbbb8d9d00490856daa3d35e170845d7 Mon Sep 17 00:00:00 2001 From: Yuriy Skalko Date: Mon, 14 Dec 2020 20:46:39 +0200 Subject: [PATCH] Merge namespace signals2 into namespace lyx --- src/LaTeX.h | 2 +- src/graphics/GraphicsCacheItem.cpp | 4 ++-- src/graphics/GraphicsCacheItem.h | 4 ++-- src/graphics/GraphicsConverter.cpp | 4 ++-- src/graphics/GraphicsConverter.h | 4 ++-- src/graphics/GraphicsLoader.cpp | 6 +++--- src/graphics/GraphicsLoader.h | 4 ++-- src/graphics/PreviewLoader.cpp | 4 ++-- src/graphics/PreviewLoader.h | 4 ++-- src/insets/RenderPreview.cpp | 2 +- src/insets/RenderPreview.h | 6 +++--- src/support/FileMonitor.cpp | 2 +- src/support/FileMonitor.h | 4 ++-- src/support/ForkedCalls.h | 2 +- src/support/Timeout.h | 2 +- src/support/signals.h | 4 +++- 16 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/LaTeX.h b/src/LaTeX.h index 994fbe07ff..569114d369 100644 --- a/src/LaTeX.h +++ b/src/LaTeX.h @@ -163,7 +163,7 @@ public: }; /// This signal emits an informative message - signals2::signal message; + signal message; /** diff --git a/src/graphics/GraphicsCacheItem.cpp b/src/graphics/GraphicsCacheItem.cpp index c72ac38659..918dc02857 100644 --- a/src/graphics/GraphicsCacheItem.cpp +++ b/src/graphics/GraphicsCacheItem.cpp @@ -119,7 +119,7 @@ public: ImageStatus status_; /// This signal is emitted when the image loading status changes. - signals2::signal statusChanged; + signal statusChanged; /// unique_ptr converter_; @@ -195,7 +195,7 @@ ImageStatus CacheItem::status() const } -signals2::connection CacheItem::connect(slot_type const & slot) const +connection CacheItem::connect(slot_type const & slot) const { return pimpl_->statusChanged.connect(slot); } diff --git a/src/graphics/GraphicsCacheItem.h b/src/graphics/GraphicsCacheItem.h index ba5efe6b2a..a018b3931d 100644 --- a/src/graphics/GraphicsCacheItem.h +++ b/src/graphics/GraphicsCacheItem.h @@ -81,9 +81,9 @@ public: /** Connect and you'll be informed when the loading status of the image * changes. */ - typedef signals2::signal::slot_type slot_type; + typedef signal::slot_type slot_type; /// - signals2::connection connect(slot_type const &) const; + connection connect(slot_type const &) const; private: /// noncopyable diff --git a/src/graphics/GraphicsConverter.cpp b/src/graphics/GraphicsConverter.cpp index 66e198ace4..c97e76663d 100644 --- a/src/graphics/GraphicsConverter.cpp +++ b/src/graphics/GraphicsConverter.cpp @@ -55,7 +55,7 @@ public: /** At the end of the conversion process inform the outside world * by emitting a signal. */ - typedef signals2::signal sig; + typedef signal sig; /// sig finishedConversion; @@ -96,7 +96,7 @@ void Converter::startConversion() const } -signals2::connection Converter::connect(slot_type const & slot) const +connection Converter::connect(slot_type const & slot) const { return pimpl_->finishedConversion.connect(slot); } diff --git a/src/graphics/GraphicsConverter.h b/src/graphics/GraphicsConverter.h index 7eb3689ad1..582c3f08d4 100644 --- a/src/graphics/GraphicsConverter.h +++ b/src/graphics/GraphicsConverter.h @@ -48,10 +48,10 @@ public: * If the conversion is successful, then the listener is passed \c true. * The connection is closed when this is destroyed. */ - typedef signals2::signal sig_type; + typedef signal sig_type; typedef sig_type::slot_type slot_type; /// - signals2::connection connect(slot_type const &) const; + connection connect(slot_type const &) const; /** If the conversion is successful, this returns the name of the * resulting file. diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp index 2316a4ac69..b375c0ec38 100644 --- a/src/graphics/GraphicsLoader.cpp +++ b/src/graphics/GraphicsLoader.cpp @@ -192,9 +192,9 @@ public: /// We modify a local copy of the image once it is loaded. ImagePtr image_; /// This signal is emitted when the image loading status changes. - signals2::signal signal_; + signal signal_; /// The connection of the signal statusChanged - signals2::scoped_connection connection_; + scoped_connection connection_; double displayPixelRatio() const { @@ -364,7 +364,7 @@ void Loader::setDisplayPixelRatio(double scale) } -signals2::connection Loader::connect(slot const & slot) const +connection Loader::connect(slot const & slot) const { return pimpl_->signal_.connect(slot); } diff --git a/src/graphics/GraphicsLoader.h b/src/graphics/GraphicsLoader.h index 0a299cba1a..1fa51d3ee8 100644 --- a/src/graphics/GraphicsLoader.h +++ b/src/graphics/GraphicsLoader.h @@ -90,10 +90,10 @@ public: /** Connect and you'll be informed when the loading status of the image * changes. */ - typedef signals2::signal sig; + typedef signal sig; typedef sig::slot_type slot; /// - signals2::connection connect(slot const &) const; + connection connect(slot const &) const; /** The loaded image with Pixmap set. * If the Pixmap is not yet set (see status() for why...), returns 0. diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index e1177a8d87..7cb83fb5b7 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -180,7 +180,7 @@ public: void refreshPreviews(); /// Emit this signal when an image is ready for display. - signals2::signal imageReady; + signal imageReady; Buffer const & buffer() const { return buffer_; } @@ -282,7 +282,7 @@ void PreviewLoader::refreshPreviews() } -signals2::connection PreviewLoader::connect(slot const & slot) const +connection PreviewLoader::connect(slot const & slot) const { return pimpl_->imageReady.connect(slot); } diff --git a/src/graphics/PreviewLoader.h b/src/graphics/PreviewLoader.h index 5d0bf8e234..272c4d361b 100644 --- a/src/graphics/PreviewLoader.h +++ b/src/graphics/PreviewLoader.h @@ -76,10 +76,10 @@ public: * has been created and is ready for loading through * lyx::graphics::PreviewImage::image(). */ - typedef signals2::signal sig; + typedef signal sig; typedef sig::slot_type slot; /// - signals2::connection connect(slot const &) const; + connection connect(slot const &) const; /** When PreviewImage has finished loading the image file into memory, * it tells the PreviewLoader to tell the outside world diff --git a/src/insets/RenderPreview.cpp b/src/insets/RenderPreview.cpp index 2ed69bb61f..5dff4108d1 100644 --- a/src/insets/RenderPreview.cpp +++ b/src/insets/RenderPreview.cpp @@ -288,7 +288,7 @@ void RenderMonitoredPreview::draw(PainterInfo & pi, int x, int y, bool const) co } -signals2::connection RenderMonitoredPreview::connect(slot const & slot) +connection RenderMonitoredPreview::connect(slot const & slot) { return changed_.connect(slot); } diff --git a/src/insets/RenderPreview.h b/src/insets/RenderPreview.h index 97725d862d..24eda3a691 100644 --- a/src/insets/RenderPreview.h +++ b/src/insets/RenderPreview.h @@ -101,7 +101,7 @@ private: /** Store the connection to the preview loader so that we connect * only once. */ - signals2::scoped_connection ploader_connection_; + scoped_connection ploader_connection_; /// Inform the core that the inset has changed. Inset const * parent_; @@ -122,9 +122,9 @@ public: /// Connect and you'll be informed when the file changes. /// Do not forget to track objects used by the slot. - typedef signals2::signal sig; + typedef signal sig; typedef sig::slot_type slot; - signals2::connection connect(slot const & slot); + connection connect(slot const & slot); /// equivalent to dynamic_cast RenderMonitoredPreview * asMonitoredPreview() override { return this; } diff --git a/src/support/FileMonitor.cpp b/src/support/FileMonitor.cpp index a3b17ad012..50f1125908 100644 --- a/src/support/FileMonitor.cpp +++ b/src/support/FileMonitor.cpp @@ -188,7 +188,7 @@ void FileMonitor::connectToFileMonitorGuard() } -signals2::connection FileMonitor::connect(slot const & slot) +connection FileMonitor::connect(slot const & slot) { return fileChanged_.connect(slot); } diff --git a/src/support/FileMonitor.h b/src/support/FileMonitor.h index 622637efa4..1e43979de4 100644 --- a/src/support/FileMonitor.h +++ b/src/support/FileMonitor.h @@ -130,10 +130,10 @@ class FileMonitor : public QObject public: FileMonitor(std::shared_ptr monitor); - typedef signals2::signal sig; + typedef signal sig; typedef sig::slot_type slot; /// Connect and you'll be informed when the file has changed. - signals2::connection connect(slot const &); + connection connect(slot const &); /// absolute path being tracked std::string const & filename() { return monitor_->filename(); } /// Make sure the good file is being monitored, after e.g. a move or a diff --git a/src/support/ForkedCalls.h b/src/support/ForkedCalls.h index 681b88965d..ea16ced7d7 100644 --- a/src/support/ForkedCalls.h +++ b/src/support/ForkedCalls.h @@ -53,7 +53,7 @@ public: * we can return easily to C++ methods, rather than just globally * accessible functions. */ - typedef signals2::signal sig; + typedef signal sig; typedef sig::slot_type slot; /** The signal is connected in the calling routine to the desired diff --git a/src/support/Timeout.h b/src/support/Timeout.h index cf15a58c9d..98e171140e 100644 --- a/src/support/Timeout.h +++ b/src/support/Timeout.h @@ -40,7 +40,7 @@ public: /// restart the timer void restart(); /// signal emitted on timer expiry - signals2::signal timeout; + signal timeout; /// emit the signal void emit(); /// set the timer type diff --git a/src/support/signals.h b/src/support/signals.h index ceca3709c6..4b55663d55 100644 --- a/src/support/signals.h +++ b/src/support/signals.h @@ -18,7 +18,9 @@ namespace lyx { -namespace signals2 = ::nod; +using nod::signal; +using nod::connection; +using nod::scoped_connection; namespace support { -- 2.39.2