X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fapplication.cpp;h=c16c9c4b7c757e3a4312316bb69edb668ef2615e;hp=224cc60007dce1a3464368bedad4f77cc36dfbe0;hb=ff046cb6c42a2382ee281e83955b7ae44030b42e;hpb=dac1bb975265d33e7aeb0e3fc0342260613af9d1 diff --git a/pv/application.cpp b/pv/application.cpp index 224cc600..c16c9c4b 100644 --- a/pv/application.cpp +++ b/pv/application.cpp @@ -14,20 +14,28 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ -#include "application.h" +#include "application.hpp" #include "config.h" -#include +#include + +#include + +#ifdef ENABLE_STACKTRACE +#include +#endif + +using std::exception; Application::Application(int &argc, char* argv[]) : QApplication(argc, argv) { setApplicationVersion(PV_VERSION_STRING); setApplicationName("PulseView"); + setOrganizationName("sigrok"); setOrganizationDomain("sigrok.org"); } @@ -35,9 +43,14 @@ bool Application::notify(QObject *receiver, QEvent *event) { try { return QApplication::notify(receiver, event); - } catch (std::exception& e) { - std::cerr << "Caught exception: " << e.what() << std::endl; + } catch (exception& e) { + qDebug().nospace() << "Caught exception of type " << \ + typeid(e).name() << " (" << e.what() << ")"; +#ifdef ENABLE_STACKTRACE + throw e; +#else exit(1); +#endif return false; } }