@@ -35,6 +35,7 @@ email : tim@linfiniti.com
3535#include < Q3SimpleRichText>
3636#include < QPainter>
3737#include < QMenu>
38+ #include < QDate>
3839
3940// non qt includes
4041#include < iostream>
@@ -103,10 +104,15 @@ void QgsCopyrightLabelPlugin::projectRead()
103104 std::cout << " +++++++++ Copyright plugin - project read slot called...." << std::endl;
104105#endif // default text to start with - try to fetch it from qgsproject
105106
107+ QDate now;
108+ QString defString;
106109
107- mQFont .setFamily (QgsProject::instance ()->readEntry (" CopyrightLabel" ," /FontName" ," Arial" ));
108- mQFont .setPointSize (QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /FontSize" ,14 ));
109- mLabelQString = QgsProject::instance ()->readEntry (" CopyrightLabel" ," /Label" ," © QGIS 2006" );
110+ now = QDate::currentDate ();
111+ defString = " © QGIS " + now.toString (" yyyy" );
112+
113+ mQFont .setFamily (QgsProject::instance ()->readEntry (" CopyrightLabel" ," /FontName" ," Sans Serif" ));
114+ mQFont .setPointSize (QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /FontSize" ,9 ));
115+ mLabelQString = QgsProject::instance ()->readEntry (" CopyrightLabel" ," /Label" , defString);
110116 mPlacementIndex = QgsProject::instance ()->readNumEntry (" CopyrightLabel" ," /Placement" ,3 );
111117 mEnable = QgsProject::instance ()->readBoolEntry (" CopyrightLabel" ," /Enabled" ,true );
112118 // todo - read & store state of font color
0 commit comments