Skip to content

Commit

Permalink
put message in log instead of message box
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Jan 8, 2019
1 parent 666f959 commit 37eec19
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion python/core/auto_generated/qgsbrowsermodel.sip.in
Expand Up @@ -125,7 +125,9 @@ items, i.e. it does not fetch children.
:param uri: item uri
:param index: the current index of the parent (to search for children)

:return: model index, invalid if item not found *
:return: model index, invalid if item not found

.. versionadded:: 3.6
%End

void connectItem( QgsDataItem *item ) /Deprecated/;
Expand Down
3 changes: 2 additions & 1 deletion src/app/browser/qgsinbuiltdataitemproviders.cpp
Expand Up @@ -23,6 +23,7 @@
#include "qgsnative.h"
#include "qgisapp.h"
#include "qgsmessagebar.h"
#include "qgsmessagelog.h"
#include "qgsnewnamedialog.h"
#include "qgsbrowsermodel.h"
#include "qgsbrowserdockwidget_p.h"
Expand Down Expand Up @@ -484,7 +485,7 @@ void QgsLayerItemGuiProvider::deleteLayers( const QStringList &itemPaths )
QgsLayerItem *item = qobject_cast<QgsLayerItem *>( QgisApp::instance()->browserModel()->dataItem( QgisApp::instance()->browserModel()->findUri( itemPath ) ) );
if ( !item )
{
QMessageBox::information( QgisApp::instance(), tr( "Delete Layer" ), tr( "Item with path %1 not found anymore." ).arg( itemPath ) );
QgsMessageLog::logMessage( tr( "Item with path %1 no longer exists." ).arg( itemPath ) );
return;
}
if ( !item->deleteLayer() )
Expand Down
5 changes: 4 additions & 1 deletion src/core/qgsbrowsermodel.h
Expand Up @@ -141,7 +141,10 @@ class CORE_EXPORT QgsBrowserModel : public QAbstractItemModel
* items, i.e. it does not fetch children.
* \param uri item uri
* \param index the current index of the parent (to search for children)
* \returns model index, invalid if item not found */
* \returns model index, invalid if item not found
*
* \since QGIS 3.6
*/
QModelIndex findUri( const QString &uri, QModelIndex index = QModelIndex() );

/**
Expand Down

0 comments on commit 37eec19

Please sign in to comment.