Skip to content
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

Qrave layers #63

Merged
merged 8 commits into from
Oct 29, 2021
Merged

Qrave layers #63

merged 8 commits into from
Oct 29, 2021

Conversation

MattReimer
Copy link
Member

Hey @KellyMWhitehead I just created this to create a reference point and see what has changed. Nothing will be merged without talking to you first

@@ -81,6 +81,32 @@ def __init__(self,

self.exists = self.layer_type == QRaveMapLayer.LayerTypes.WEBTILE or os.path.isfile(self.layer_uri)

def _getlayerposition(item):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work without the "self" argument being first?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see, this is supposed to be a static method

remember to add @staticmethod on the line before

if child_data.data.layer_type in [QRaveMapLayer.LayerTypes.LINE, QRaveMapLayer.LayerTypes.POINT, QRaveMapLayer.LayerTypes.POLYGON, QRaveMapLayer.LayerTypes.RASTER]:
absolute_position += 1
else:
if child_data.type == 'PROJECT_FOLDER':
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of a string better to use the enumeraction class helper thing

QRaveTreeTypes.PROJECT_FOLDER

root = QgsProject.instance().layerTreeRoot()
for group in [child for child in root.children() if child.nodeType() == 0]:
if group.name() == project_name:
root.removeChildNode(group)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this remove custom layers I've dragged into the group as well?

@MattReimer MattReimer merged commit ad8573f into dev Oct 29, 2021
@MattReimer MattReimer deleted the qrave_layers branch October 29, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants