-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[style manager] new default symbols shipped with QGIS & add a set of pre-defined tags #3793
Conversation
7d543bc
to
27c13fb
Compare
* @see createMemoryDB() | ||
*/ | ||
bool createDB( const QString& filename ); | ||
/** Creates a temporary memory database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some spacing between a method and the subsequent comment?
* \return returns the success state of the database creation | ||
* @see createMemoryDB() | ||
*/ | ||
bool createDB( const QString& filename ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should be createDb
, acronyms have been updated to this style for 3.0
@@ -1526,6 +1555,11 @@ bool QgsStyle::importXml( const QString& filename ) | |||
QDomElement symbolsElement = docEl.firstChildElement( QStringLiteral( "symbols" ) ); | |||
QDomElement e = symbolsElement.firstChildElement(); | |||
|
|||
// gain speed by re-grouping the INSERT statements in a transaction | |||
char* query; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that not need to be cleaned up after usage? (some kind of free
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-kuhn , yeah, it's free'ed in the runEmptyQuery() function.
27c13fb
to
c38817c
Compare
@m-kuhn , @nyalldawson , above comments addressed. That's ready to merge unless other issues are raised. |
Thanks. I think now it should go to the api change doc ;) |
@m-kuhn , what part? The shipping of and .xml instead of .db as our mean to deliver default symbols? |
(removed) |
@@ -208,8 +208,29 @@ class QgsStyle : QObject | |||
//! Changes ramp's name | |||
bool renameColorRamp( const QString& oldName, const QString& newName ); | |||
|
|||
//! Creates a temporary memory database | |||
bool createMemoryDB(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change of this method name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-kuhn , that's not an API break, that is a new function, wasn't there prior to what will become 3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, ok, forget about it then
Instead of copyign a pre-existing .db shipped with QGIS, create a new .db and import an .xml file containing our default symbols. On the UX front, the main benefit is being able to ship with pre-defined tags and favorite flags for the default symbols. On the developer side, it means we get rid of the requirement to maintain both an .xml and a binary .db in the source tree. We also say aurevoir to the symbol_xml2db.py script and the need to update the (obsolete) script every time we add a new feature to QgsStyle.
Gains are significant, importing 100 symbols would take 2.86s, but takes only 0.18s when using transaction.
c38817c
to
e226529
Compare
This PR refreshed the default symbols shipped with QGIS to better reflect the cartographic powerhouse that the project has become. The new symbols are:
In addition to updating the symbols, this PR also improves the default style database creation by moving away from copying a pre-existing .db in favor of creating a .db when needed and importing symbols declared in an .xml file.