Skip to content

Commit 95ab3d0

Browse files
committedFeb 28, 2018
doxymentation and better wording
1 parent b957e17 commit 95ab3d0

File tree

9 files changed

+27
-25
lines changed

9 files changed

+27
-25
lines changed
 

‎python/core/qgsproject.sip.in

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,12 +911,18 @@ Emitted when a layer from a projects was read.
911911
%End
912912

913913
void loadingLayer( const QString &layerName );
914+
%Docstring
915+
Emitted when a layer is loaded
916+
%End
914917

915-
void loadingLayerMessages( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
918+
void loadingLayerMessageReceived( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
916919
%Docstring
917920
Emitted when loading layers has produced some messages
918-
@param layerName the layer name
919-
@param messages a list of pairs of Qgis.MessageLevel and messages
921+
922+
:param layerName: the layer name
923+
:param messages: a list of pairs of Qgis.MessageLevel and messages
924+
925+
.. versionadded:: 3.2
920926
%End
921927

922928
void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );

‎python/core/qgsreadwritecontext.sip.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The class is used as a container of context for various read/write operations on
2424

2525
struct ReadWriteMessage
2626
{
27-
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, QStringList categories = QStringList() );
27+
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, const QStringList &categories = QStringList() );
2828
%Docstring
2929
Construct a container for QgsReadWriteContext error or warning messages
3030
%End
@@ -65,7 +65,7 @@ Sets up path resolver for conversion between relative and absolute paths
6565

6666
void pushMessage( const QString &message, Qgis::MessageLevel level );
6767
%Docstring
68-
append a message to the context
68+
Append a message to the context
6969

7070
.. versionadded:: 3.2
7171
%End
@@ -86,7 +86,7 @@ Pop the last category
8686

8787
QList<QgsReadWriteContext::ReadWriteMessage> takeMessages();
8888
%Docstring
89-
return the stored messages and remove them
89+
Return the stored messages and remove them
9090

9191
.. versionadded:: 3.2
9292
%End

‎python/gui/qgsmessagebar.sip.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ convenience method for pushing a message with title to the bar
8383
convenience method for pushing a message to the bar with a detail text which be shown when pressing a "more" button
8484
%End
8585

86-
87-
8886
QgsMessageBarItem *currentItem();
8987

9088
signals:

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3230,7 +3230,7 @@ void QgisApp::setupConnections()
32303230
this, &QgisApp::showProgress );
32313231
connect( QgsProject::instance(), &QgsProject::loadingLayer,
32323232
this, &QgisApp::showStatusMessage );
3233-
connect( QgsProject::instance(), &QgsProject::loadingLayerMessages,
3233+
connect( QgsProject::instance(), &QgsProject::loadingLayerMessageReceived,
32343234
this, &QgisApp::loadingLayerMessages );
32353235
connect( QgsProject::instance(), &QgsProject::readProject,
32363236
this, &QgisApp::readProject );

‎src/core/qgseditformconfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void QgsEditFormConfig::setSuppress( QgsEditFormConfig::FeatureFormSuppress s )
260260

261261
void QgsEditFormConfig::readXml( const QDomNode &node, QgsReadWriteContext &context )
262262
{
263-
context.enterCategory( QString( "Edit form config" ) );
263+
context.enterCategory( QObject::tr( "Edit form config" ) );
264264
d.detach();
265265

266266
QDomNode editFormNode = node.namedItem( QStringLiteral( "editform" ) );

‎src/core/qgsproject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken
719719
const auto messages = context.takeMessages();
720720
if ( messages.count() )
721721
{
722-
emit loadingLayerMessages( tr( "Loading layer %1" ).arg( name ), messages );
722+
emit loadingLayerMessageReceived( tr( "Loading layer %1" ).arg( name ), messages );
723723
}
724724
}
725725
emit layerLoaded( i + 1, nl.count() );

‎src/core/qgsproject.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -888,14 +888,16 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
888888
*/
889889
void layerLoaded( int i, int n );
890890

891+
//! Emitted when a layer is loaded
891892
void loadingLayer( const QString &layerName );
892893

893894
/**
894-
* @brief Emitted when loading layers has produced some messages
895-
* @param layerName the layer name
896-
* @param messages a list of pairs of Qgis::MessageLevel and messages
895+
* \brief Emitted when loading layers has produced some messages
896+
* \param layerName the layer name
897+
* \param messages a list of pairs of Qgis::MessageLevel and messages
898+
* \since 3.2
897899
*/
898-
void loadingLayerMessages( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
900+
void loadingLayerMessageReceived( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
899901

900902
//! Emitted when the list of layer which are excluded from map identification changes
901903
void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );

‎src/core/qgsreadwritecontext.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CORE_EXPORT QgsReadWriteContext
3838
struct ReadWriteMessage
3939
{
4040
//! Construct a container for QgsReadWriteContext error or warning messages
41-
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, QStringList categories = QStringList() )
41+
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, const QStringList &categories = QStringList() )
4242
: mMessage( message )
4343
, mLevel( level )
4444
, mCategories( categories )
@@ -54,9 +54,9 @@ class CORE_EXPORT QgsReadWriteContext
5454
QStringList categories() const {return mCategories;}
5555

5656
private:
57-
QString mMessage = QString();
58-
Qgis::MessageLevel mLevel = Qgis::Warning;
59-
QStringList mCategories = QStringList();
57+
QString mMessage;
58+
Qgis::MessageLevel mLevel;
59+
QStringList mCategories;
6060
};
6161

6262
/**
@@ -73,7 +73,7 @@ class CORE_EXPORT QgsReadWriteContext
7373
void setPathResolver( const QgsPathResolver &resolver );
7474

7575
/**
76-
* append a message to the context
76+
* Append a message to the context
7777
* \since QGIS 3.2
7878
*/
7979
void pushMessage( const QString &message, Qgis::MessageLevel level );
@@ -91,7 +91,7 @@ class CORE_EXPORT QgsReadWriteContext
9191
void leaveCategory();
9292

9393
/**
94-
* return the stored messages and remove them
94+
* Return the stored messages and remove them
9595
* \since QGIS 3.2
9696
*/
9797
QList<QgsReadWriteContext::ReadWriteMessage> takeMessages();

‎src/gui/qgsmessagebar.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ class GUI_EXPORT QgsMessageBar: public QFrame
9292
//! convenience method for pushing a message to the bar with a detail text which be shown when pressing a "more" button
9393
void pushMessage( const QString &title, const QString &text, const QString &showMore, Qgis::MessageLevel level = Qgis::Info, int duration = 5 );
9494

95-
// //! make out a widget containing a message to be displayed on the bar with a detail text which be shown when pressing a "more" button
96-
// QgsMessageBarItem( const QString &title, const QString &text, const QString &showMore, Qgis::MessageLevel level = Qgis::Info, int duration = 0, QWidget *parent SIP_TRANSFERTHIS = nullptr );
97-
98-
9995
QgsMessageBarItem *currentItem() { return mCurrentItem; }
10096

10197
signals:

0 commit comments

Comments
 (0)
Please sign in to comment.