Skip to content
Permalink
Browse files

[win] Cleanup notifications on exit

  • Loading branch information
nyalldawson committed Aug 31, 2018
1 parent 8f1fb1e commit b55ab2e6d405f4b827df4cabe325c937ce897179
Showing with 17 additions and 0 deletions.
  1. +2 −0 src/app/qgisapp.cpp
  2. +3 −0 src/native/qgsnative.cpp
  3. +6 −0 src/native/qgsnative.h
  4. +5 −0 src/native/win/qgswinnative.cpp
  5. +1 −0 src/native/win/qgswinnative.h
@@ -1532,6 +1532,8 @@ QgisApp::~QgisApp()
delete canvas;
}

QgsGui::instance()->nativePlatformInterface()->cleanup();

// This function *MUST* be the last one called, as it destroys in
// particular GDAL. As above objects can hold GDAL/OGR objects, it is not
// safe destroying them afterwards
@@ -21,6 +21,9 @@
#include <QUrl>
#include <QFileInfo>

void QgsNative::cleanup()
{}

QgsNative::Capabilities QgsNative::capabilities() const
{
return nullptr;
@@ -46,6 +46,12 @@ class NATIVE_EXPORT QgsNative

virtual ~QgsNative() = default;

/**
* Called on QGIS exit, allowing the native interface to gracefully
* cleanup and exit.
*/
virtual void cleanup();

/**
* Returns the native interface's capabilities.
*/
@@ -58,6 +58,11 @@ void QgsWinNative::initializeMainWindow( QWindow *window,
}
}

void QgsWinNative::cleanup()
{
WinToastLib::WinToast::instance()->clear();
}

void QgsWinNative::openFileExplorerAndSelectFile( const QString &path )
{
const QString nativePath = QDir::toNativeSeparators( path );
@@ -35,6 +35,7 @@ class NATIVE_EXPORT QgsWinNative : public QgsNative
const QString &applicationName,
const QString &organizationName,
const QString &version ) override;
void cleanup() override;
void openFileExplorerAndSelectFile( const QString &path ) override;
void showUndefinedApplicationProgress() override;
void setApplicationProgress( double progress ) override;

0 comments on commit b55ab2e

Please sign in to comment.
You can’t perform that action at this time.