Fix the build - catch exceptions by reference Fix the following build errors seen with gcc 8.1.1: error: catching polymorphic type ‘class std::out_of_range’ by value error: catching polymorphic type ‘class boost::archive::archive_exception’ by value Signed-off-by: Brian Starkey <stark3y@gmail.com>
fix catching polymorphic types by value Compiling with GCC 8 produces a new warning about catching polymorphic types by value. Proper way is to use references instead. /home/sharkcz/projects/pulseview/main.cpp: In function ‘int main(int, char**)’: /home/sharkcz/projects/pulseview/main.cpp:229:22: error: catching polymorphic type ‘class std::exception’ by value [-Werror=catch-value=] } catch (exception e) { ^ cc1plus: all warnings being treated as errors
Remove unused "using" declarations. This patch was generated using clang-tidy: clang-tidy -checks="-*,misc-unused-using-decls" -fix (with manual add-on fixes such as dropping unused headers as well, and commenting some false-positive cases)
Don't use std:: in the code directly (where possible). Use "using std::foo" to make the actual code itself a lot more readable. There are some exceptions where we usually cannot do this, e.g. std::thread often conflicts with "thread" from Qt or Boost.
license: remove FSF postal address from boiler plate license text Remove the FSF postal address as it might change (it did in the past). Reference the gnu.org website instead which is more stable.
InputFile: Use new reset() function to allow re-reading file Commit 519d0ccbe67d005a9c442795ce3b8255e78ca46d tried to solve the problem of being unable to re-read an opened file by clicking the "run" button. However, the solution is insufficient. PV expects the session device to be updated after the open() call. If it is not, the device settings popup will show the settings of the previously used device. This patch fixes this and also makes use of the new reset() method to allow re-reading of the file contents. The method is necessary because otherwise we have to destroy the input module and create a new instance. This however also means setting a new session device, which is highly undesirable. So reset() it is.
InputFile: Don't try to create device twice The InputFile currently only keeps track of the need for a device instance local to run(). This means that when calling run() a second time (e.g. by clicking the "Run" button after loading a file), the function will try to create the device instance and add it to the session. This fails as the first created instance is still assigned to the session and thus the session will reject adding another device. Furthermore, simply clearing the session devices isn't enough for proper operation. The issue is that once a file's content has been sent to an input module, the module is not going to accept another file. It needs to be reset to its initial state. To do this, we create the input module instance every time we want to read the file.