]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewLoader.cpp
Use << for raising 2 to power instead of ^
[lyx.git] / src / graphics / PreviewLoader.cpp
index 49b8b73b0ace5184766c38d89387ddcc82ee79f1..586ba48abcf89038c68d603714a71e60a86e56e9 100644 (file)
@@ -160,8 +160,7 @@ typedef map<pid_t, InProgress>  InProgressProcesses;
 
 typedef InProgressProcesses::value_type InProgressProcess;
 
-} // namespace anon
-
+} // namespace
 
 
 namespace lyx {
@@ -240,7 +239,7 @@ private:
        /// We don't own this
        static lyx::Converter const * pconverter_;
 
-       signals2::scoped_connection connection_;
+       Trackable trackable_;
 };
 
 
@@ -379,7 +378,7 @@ void InProgress::stop() const
        }
 }
 
-} // namespace anon
+} // namespace
 
 
 namespace lyx {
@@ -507,7 +506,7 @@ private:
        string const snippet_;
 };
 
-} // namespace anon
+} // namespace
 
 PreviewLoader::Status
 PreviewLoader::Impl::status(string const & latex_snippet) const
@@ -569,7 +568,7 @@ private:
        string const & snippet_;
 };
 
-} // namespace anon
+} // namespace
 
 
 void PreviewLoader::Impl::remove(string const & latex_snippet)
@@ -728,7 +727,7 @@ void PreviewLoader::Impl::startLoading(bool wait)
        if (wait) {
                ForkedCall call(buffer_.filePath(), buffer_.layoutPos());
                int ret = call.startScript(ForkedProcess::Wait, command);
-               static atomic_int fake((2^20) + 1);
+               static atomic_int fake((1 << 20) + 1);
                int pid = fake++;
                inprogress.pid = pid;
                inprogress.command = command;
@@ -739,10 +738,9 @@ void PreviewLoader::Impl::startLoading(bool wait)
 
        // Initiate the conversion from LaTeX to bitmap images files.
        ForkedCall::sigPtr convert_ptr = make_shared<ForkedCall::sig>();
-       // This is a scoped connection
-       connection_ = convert_ptr->connect([this](pid_t pid, int retval){
-                       finishedGenerating(pid, retval);
-               });
+       convert_ptr->connect(ForkedProcess::slot([this](pid_t pid, int retval){
+                               finishedGenerating(pid, retval);
+                       }).track_foreign(trackable_.p()));
 
        ForkedCall call(buffer_.filePath());
        int ret = call.startScript(command, convert_ptr);