Tom Feist [Sun, 9 Nov 2014 22:54:53 +0000 (22:54 +0000)]
Change Glib::Variant<uint64_t> to Glib::Variant<guint64>.
This is needed on OSX/x86_64 where one is a typedef to unsigned long and the
other to unsigned long long. Both are the same size, but they are still
considered different types for the purposes of template instantiation, so the
specialisations which are defined for Glib::Variant<guint64> are not found if
Glib::Variant<uint64_t> is used.
Soeren Apel [Fri, 7 Nov 2014 16:11:30 +0000 (17:11 +0100)]
Fix bug #285 by handling device display names through DeviceManager
Currently, DeviceManager::device_description() is used to determine
how a device should appear in the device selector combobox. This is
problematic because bug #285 requests that a device should show
the extra information only when multiple such devices are present.
Without having access to all devices attached to a particular driver,
this cannot be solved.
This patch makes it possible by creating each device's display name
in the DeviceManager class and storing it there. This way, they
can be constructed while having access to all devices and
transparently queried by anyone who needs them.
Uwe Hermann [Sat, 8 Nov 2014 14:31:30 +0000 (15:31 +0100)]
CMakeLists.txt: Fix CMAKE_MODULE_PATH related issue.
Append to CMAKE_MODULE_PATH instead of overwriting it, in case it is
non-empty initially (which can happen e.g. if -DCMAKE_TOOLCHAIN_FILE is
used and the specified toolchain file sets CMAKE_MODULE_PATH).
Also, append to CMAKE_MODULE_PATH _after_ running "project(pulseview)",
since the latter would apparently reset CMAKE_MODULE_PATH again.
This should fix a MinGW-w64 build issue we're currently seeing:
CMake Error at CMakeLists.txt:105 (include):
include could not find load file:
Angus Gratton [Tue, 7 Oct 2014 22:35:23 +0000 (09:35 +1100)]
Fix double-free issue in File::create
Triggered when opening a file from the command line.
During startup Sigsession::set_default_device calls Device::use which
loads a global _sr_session, then as part of file loading the
File::create method is called which treats _sr_session as a temp
variable (loaded then immediately released), finally a Device::release
releases the (differently allocated) global _sr_session again causing
the double free.
Given File::create is only using the sigrok session temporarily within
its function scope, this change gives it its own temporary session
instance.
Add serial_num/connection_id handling and save/restore last device
This patch performs several correlated changes:
- Make use of sdi->serial_num and sdi->connection_id in
format_device_title()
- Add a Device::get_device_info() method that returns a map
with all device identification information that's available
- Add a DeviceManager::find_device_from_info() method which
returns the best match to a given set of device infos
- Add save/restore code to the MainWindow class that makes
use of the aforementioned maps to identify the currently
selected device.
Since the application metadata is set in application.c,
we should use it instead of providing it manually every
time we create a QSettings object.
As I understand it, subclassing QApplication in application.c
is only a workaround for bad Qt behavior. In the event
that it is removed, the application metadata should be moved
so that persistent storage still works.
Usage of std::thread requires linking with appropriate system thread library.
This fixes the following link error (on debian sid, gcc 4.9):
Linking CXX executable pulseview
/usr/bin/ld: CMakeFiles/pulseview.dir/pv/sigsession.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/pulseview.dir/build.make:2844: recipe for target 'pulseview' failed
Fix bug #326 by saving the main window state when closing and
restoring it on startup. The default window size is 1000x720 so
that the window can still be seen entirely when on a 1024x768 screen.
This wouldn't be the case with a default size of 1024x768.