Skip to content

Commit

Permalink
[log] Notify profile source registration and unregistration in QgsMes…
Browse files Browse the repository at this point in the history
…sageLog
  • Loading branch information
gacarrillor committed May 2, 2024
1 parent 4227938 commit 650e970
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion swiss_locator/swiss_locator_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os
from PyQt5.QtCore import QCoreApplication, QLocale, QSettings, QTranslator
from PyQt5.QtWidgets import QWidget
from qgis.core import Qgis, QgsApplication, NULL
from qgis.core import Qgis, QgsApplication, QgsMessageLog, NULL
from qgis.gui import QgisInterface, QgsMessageBarItem

from swiss_locator.core.filters.swiss_locator_filter_feature import (
Expand Down Expand Up @@ -72,6 +72,11 @@ def initGui(self):

if Qgis.QGIS_VERSION_INT >= 33700:
QgsApplication.profileSourceRegistry().registerProfileSource(self.profile_source)
QgsMessageLog.logMessage(
"Swiss profile source has been registered!",
"Swiss locator",
Qgis.Info
)

def unload(self):
for locator_filter in self.locator_filters:
Expand All @@ -80,6 +85,11 @@ def unload(self):

if Qgis.QGIS_VERSION_INT >= 33700:
QgsApplication.profileSourceRegistry().unregisterProfileSource(self.profile_source)
QgsMessageLog.logMessage(
"Swiss profile source has been unregistered!",
"Swiss locator",
Qgis.Info
)

def show_message(
self, title: str, msg: str, level: Qgis.MessageLevel, widget: QWidget = None
Expand Down

0 comments on commit 650e970

Please sign in to comment.