Skip to content
Permalink
Browse files
Fix for ticket #226 (saved projects with postgres layers in a map com…
…position won't reload).

git-svn-id: http://svn.osgeo.org/qgis/trunk@5730 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Aug 24, 2006
1 parent 744f78f commit f880882db475cc56a1c877fc8ac5716fcc4204e5
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/gui/qgsmaplayer.cpp
@@ -73,7 +73,13 @@ QgsMapLayer::QgsMapLayer(int type,
// Generate the unique ID of this layer
QDateTime dt = QDateTime::currentDateTime();
ID = lyrname + dt.toString("yyyyMMddhhmmsszzz");
ID.replace(" ", "_");
// Tidy the ID up to avoid characters that may cause problems
// elsewhere (e.g in some parts of XML). Replaces every non-word
// character (word characters are the alphabet, numbers and
// underscore) with an underscore.
// Note that the first backslashe in the regular expression is
// there for the compiler, so the pattern is actually \W
ID.replace(QRegExp("[\\W]"), "_");

QString myThemePath = QgsApplication::themePath();
mInOverviewPixmap.load(myThemePath + "/mActionInOverview.png");

0 comments on commit f880882

Please sign in to comment.