Made decode an optional feature disabled by default.
[pulseview.git] / pv / sigsession.cpp
index 3213758ef263894c215cc83055849593700aa099..8cfd86d9a9782fc340c6fdebf9103d8edba96c3c 100644 (file)
@@ -18,7 +18,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#ifdef ENABLE_DECODE
 #include <libsigrokdecode/libsigrokdecode.h>
+#endif
 
 #include "sigsession.h"
 
@@ -202,6 +204,7 @@ boost::shared_ptr<data::Logic> SigSession::get_data()
        return _logic_data;
 }
 
+#ifdef ENABLE_DECODE
 bool SigSession::add_decoder(srd_decoder *const dec)
 {
        map<const srd_probe*, shared_ptr<view::LogicSignal> > probes;
@@ -223,7 +226,8 @@ bool SigSession::add_decoder(srd_decoder *const dec)
                        {
                                shared_ptr<view::LogicSignal> l =
                                        dynamic_pointer_cast<view::LogicSignal>(s);
-                               if (l && QString(probe->name).toLower().contains(
+                               if (l && QString::fromUtf8(probe->name).
+                                       toLower().contains(
                                        l->get_name().toLower()))
                                        probes[probe] = l;
                        }
@@ -272,6 +276,7 @@ void SigSession::remove_decode_signal(view::DecodeTrace *signal)
                        return;
                }
 }
+#endif
 
 void SigSession::set_capture_state(capture_state state)
 {