From f8d839519f95f179f37e0848c9c78e0137d6e25a Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Thu, 23 Nov 2017 15:43:17 +1000 Subject: [PATCH] Fix indentation --- src/app/qgscrashhandler.h | 1 + src/app/qgsdxfexportdialog.cpp | 4 +- src/app/qgsdxfexportdialog.h | 0 src/crashhandler/CMakeLists.txt | 64 +++++----- src/crashhandler/qgscrashdialog.h | 110 ++++++++-------- src/crashhandler/qgscrashreport.h | 202 +++++++++++++++--------------- 6 files changed, 191 insertions(+), 190 deletions(-) mode change 100755 => 100644 src/app/qgsdxfexportdialog.h diff --git a/src/app/qgscrashhandler.h b/src/app/qgscrashhandler.h index f3c16fef525..c9ebfc4fc44 100644 --- a/src/app/qgscrashhandler.h +++ b/src/app/qgscrashhandler.h @@ -31,6 +31,7 @@ class APP_EXPORT QgsCrashHandler { public: + /** * This class doesn't need to be created by anyone as is only used to handle * crashes in the application. diff --git a/src/app/qgsdxfexportdialog.cpp b/src/app/qgsdxfexportdialog.cpp index 83bb294bd90..c3197ca9cd8 100644 --- a/src/app/qgsdxfexportdialog.cpp +++ b/src/app/qgsdxfexportdialog.cpp @@ -609,12 +609,12 @@ bool QgsDxfExportDialog::layerTitleAsName() const bool QgsDxfExportDialog::force2d() const { - return mForce2d->isChecked(); + return mForce2d->isChecked(); } bool QgsDxfExportDialog::useMText() const { - return mMTextCheckBox->isChecked(); + return mMTextCheckBox->isChecked(); } void QgsDxfExportDialog::saveSettings() diff --git a/src/app/qgsdxfexportdialog.h b/src/app/qgsdxfexportdialog.h old mode 100755 new mode 100644 diff --git a/src/crashhandler/CMakeLists.txt b/src/crashhandler/CMakeLists.txt index 22891b7f837..a0578e0af17 100644 --- a/src/crashhandler/CMakeLists.txt +++ b/src/crashhandler/CMakeLists.txt @@ -1,32 +1,32 @@ -INCLUDE_DIRECTORIES(SYSTEM - ${CMAKE_CURRENT_BINARY_DIR} -) - -QT5_WRAP_UI(CRASH_UIS_H qgscrashdialog.ui) -QT5_WRAP_CPP(CRASH_HDR_MOC qgscrashdialog.h) - -SET(IMAGE_RCCS ../../images/images.qrc) -QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS}) - -# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in DbgHelp.h -SET_SOURCE_FILES_PROPERTIES(qgsstacktrace.cpp PROPERTIES COMPILE_FLAGS -wd4091) - -ADD_EXECUTABLE(qgiscrashhandler WIN32 - main.cpp - ${CRASH_UIS_H} - ${CRASH_HDR_MOC} - ${IMAGE_RCC_SRCS} - qgscrashdialog.cpp - qgsstacktrace.cpp - qgscrashreport.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../app/qgis_win32.rc - ) - -TARGET_LINK_LIBRARIES(qgiscrashhandler - ${QT_QTCORE_LIBRARY} - ${QT_QTGUI_LIBRARY} - DbgHelp -) - -INSTALL(CODE "MESSAGE(\"Installing crashhandler ...\")") -INSTALL(TARGETS qgiscrashhandler RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}) +INCLUDE_DIRECTORIES(SYSTEM + ${CMAKE_CURRENT_BINARY_DIR} +) + +QT5_WRAP_UI(CRASH_UIS_H qgscrashdialog.ui) +QT5_WRAP_CPP(CRASH_HDR_MOC qgscrashdialog.h) + +SET(IMAGE_RCCS ../../images/images.qrc) +QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS}) + +# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in DbgHelp.h +SET_SOURCE_FILES_PROPERTIES(qgsstacktrace.cpp PROPERTIES COMPILE_FLAGS -wd4091) + +ADD_EXECUTABLE(qgiscrashhandler WIN32 + main.cpp + ${CRASH_UIS_H} + ${CRASH_HDR_MOC} + ${IMAGE_RCC_SRCS} + qgscrashdialog.cpp + qgsstacktrace.cpp + qgscrashreport.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../app/qgis_win32.rc + ) + +TARGET_LINK_LIBRARIES(qgiscrashhandler + ${QT_QTCORE_LIBRARY} + ${QT_QTGUI_LIBRARY} + DbgHelp +) + +INSTALL(CODE "MESSAGE(\"Installing crashhandler ...\")") +INSTALL(TARGETS qgiscrashhandler RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}) diff --git a/src/crashhandler/qgscrashdialog.h b/src/crashhandler/qgscrashdialog.h index 447523a2aed..ee0d2daa0d0 100644 --- a/src/crashhandler/qgscrashdialog.h +++ b/src/crashhandler/qgscrashdialog.h @@ -1,55 +1,55 @@ -/*************************************************************************** - qgscrashdialog.h - QgsCrashDialog - - --------------------- - begin : 11.4.2017 - copyright : (C) 2017 by Nathan Woodrow - email : woodrow.nathan@gmail.com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#ifndef QGSCRASHDIALOG_H -#define QGSCRASHDIALOG_H - -#include -#include -#include -#include - -#include "ui_qgscrashdialog.h" - -/** - * A dialog to show a nicer crash dialog to the user. - */ -class QgsCrashDialog : public QDialog, private Ui::QgsCrashDialog -{ - Q_OBJECT - public: - - /** - * A dialog to show a nicer crash dialog to the user. - */ - QgsCrashDialog( QWidget *parent = nullptr ); - - void setBugReport( const QString &reportData ); - void setReloadArgs( const QString &reloadArgs ); - - static QString htmlToMarkdown( const QString &html ); - - private slots: - void showReportWidget(); - void createBugReport(); - void reloadQGIS(); - - private: - QString mReportData; - QString mReloadArgs; -}; - -#endif // QGSCRASHDIALOG_H +/*************************************************************************** + qgscrashdialog.h - QgsCrashDialog + + --------------------- + begin : 11.4.2017 + copyright : (C) 2017 by Nathan Woodrow + email : woodrow.nathan@gmail.com + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef QGSCRASHDIALOG_H +#define QGSCRASHDIALOG_H + +#include +#include +#include +#include + +#include "ui_qgscrashdialog.h" + +/** + * A dialog to show a nicer crash dialog to the user. + */ +class QgsCrashDialog : public QDialog, private Ui::QgsCrashDialog +{ + Q_OBJECT + public: + + /** + * A dialog to show a nicer crash dialog to the user. + */ + QgsCrashDialog( QWidget *parent = nullptr ); + + void setBugReport( const QString &reportData ); + void setReloadArgs( const QString &reloadArgs ); + + static QString htmlToMarkdown( const QString &html ); + + private slots: + void showReportWidget(); + void createBugReport(); + void reloadQGIS(); + + private: + QString mReportData; + QString mReloadArgs; +}; + +#endif // QGSCRASHDIALOG_H diff --git a/src/crashhandler/qgscrashreport.h b/src/crashhandler/qgscrashreport.h index d89855dd13c..78568495fa2 100644 --- a/src/crashhandler/qgscrashreport.h +++ b/src/crashhandler/qgscrashreport.h @@ -1,101 +1,101 @@ -/*************************************************************************** - qgscrashreport.h - QgsCrashReport - - --------------------- - begin : 16.4.2017 - copyright : (C) 2017 by Nathan Woodrow - email : woodrow.nathan@gmail.com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -#ifndef QGSCRASHREPORT_H -#define QGSCRASHREPORT_H - -#include "qgsstacktrace.h" - -#include -#include - - -/** - * Include information to generate user friendly crash report for QGIS. - */ -class QgsCrashReport -{ - public: - - /** - * Include information to generate user friendly crash report for QGIS. - */ - QgsCrashReport(); - - public: - enum Flag - { - Stack = 1 << 0, - Plugins = 1 << 1, - ProjectDetails = 1 << 2, - SystemInfo = 1 << 3, - QgisInfo = 1 << 4, - All = Stack | Plugins | ProjectDetails | SystemInfo | QgisInfo - }; - Q_DECLARE_FLAGS( Flags, Flag ) - - /** - * Sets the stack trace for the crash report. - * \param value A string list for each line in the stack trace. - */ - void setStackTrace( QgsStackTrace *value ) { mStackTrace = value; } - - /** - * Returns the stack trace for this report. - * \return A string list for each line in the stack trace. - */ - QgsStackTrace *StackTrace() const { return mStackTrace; } - - /** - * Set the flags to mark which features are included in this crash report. - * \param flags The flag for each feature. - */ - void setFlags( QgsCrashReport::Flags flags ); - - /** - * Returns the include flags that have been set for this report. - * \return The flags marking what details are included in this report. - */ - Flags flags() const { return mFlags; } - - const QString toMarkdown(); - - /** - * Generate a string version of the report. - * \return A formatted string including all the information from the report. - */ - const QString toHtml() const; - - /** - * Generates a crash ID for the crash report. - * \return - */ - const QString crashID() const; - - void exportToCrashFolder(); - - QString crashReportFolder(); - - void setVersionInfo( const QStringList &versionInfo ) { mVersionInfo = versionInfo; } - - private: - Flags mFlags; - QgsStackTrace *mStackTrace; - QStringList mVersionInfo; -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS( QgsCrashReport::Flags ) - -#endif // QGSCRASHREPORT_H +/*************************************************************************** + qgscrashreport.h - QgsCrashReport + + --------------------- + begin : 16.4.2017 + copyright : (C) 2017 by Nathan Woodrow + email : woodrow.nathan@gmail.com + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef QGSCRASHREPORT_H +#define QGSCRASHREPORT_H + +#include "qgsstacktrace.h" + +#include +#include + + +/** + * Include information to generate user friendly crash report for QGIS. + */ +class QgsCrashReport +{ + public: + + /** + * Include information to generate user friendly crash report for QGIS. + */ + QgsCrashReport(); + + public: + enum Flag + { + Stack = 1 << 0, + Plugins = 1 << 1, + ProjectDetails = 1 << 2, + SystemInfo = 1 << 3, + QgisInfo = 1 << 4, + All = Stack | Plugins | ProjectDetails | SystemInfo | QgisInfo + }; + Q_DECLARE_FLAGS( Flags, Flag ) + + /** + * Sets the stack trace for the crash report. + * \param value A string list for each line in the stack trace. + */ + void setStackTrace( QgsStackTrace *value ) { mStackTrace = value; } + + /** + * Returns the stack trace for this report. + * \return A string list for each line in the stack trace. + */ + QgsStackTrace *StackTrace() const { return mStackTrace; } + + /** + * Set the flags to mark which features are included in this crash report. + * \param flags The flag for each feature. + */ + void setFlags( QgsCrashReport::Flags flags ); + + /** + * Returns the include flags that have been set for this report. + * \return The flags marking what details are included in this report. + */ + Flags flags() const { return mFlags; } + + const QString toMarkdown(); + + /** + * Generate a string version of the report. + * \return A formatted string including all the information from the report. + */ + const QString toHtml() const; + + /** + * Generates a crash ID for the crash report. + * \return + */ + const QString crashID() const; + + void exportToCrashFolder(); + + QString crashReportFolder(); + + void setVersionInfo( const QStringList &versionInfo ) { mVersionInfo = versionInfo; } + + private: + Flags mFlags; + QgsStackTrace *mStackTrace; + QStringList mVersionInfo; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS( QgsCrashReport::Flags ) + +#endif // QGSCRASHREPORT_H