Skip to content

Commit

Permalink
Fix for ticket #226 (saved projects with postgres layers in a map com…
Browse files Browse the repository at this point in the history
…position won't reload).

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5730 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Aug 24, 2006
1 parent 66ef358 commit 8de53bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/qgsmaplayer.cpp
Expand Up @@ -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");
Expand Down

0 comments on commit 8de53bd

Please sign in to comment.