Skip to content


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: c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Aug 24, 2006
1 parent 744f78f commit f880882
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/qgsmaplayer.cpp
Original file line number Diff line number Diff line change
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 f880882

Please sign in to comment.