Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Workflow buttons: Fix runtime warnings

Freya Lupen40f4a8848a99
diff --git a/plugins/python/workflow_buttons/buttons_settings_dialog.py b/plugins/python/workflow_buttons/buttons_settings_dialog.py
index 72b4f36db5..966372c6cb 100644
--- a/plugins/python/workflow_buttons/buttons_settings_dialog.py
+++ b/plugins/python/workflow_buttons/buttons_settings_dialog.py
@@ -346,8 +346,12 @@ class ButtonsSettingsDialog(QDialog):
# extra " " to workaround possible cut of last letter...
def populateToolList(self):
- toolNumber = -1
- for tool in LISTOFTOOLS:
+ toolNumber = 0
+ # Workaround to avoid passing an empty string to i18n(), which triggers a warning.
+ self.toolSelector.insertItem(toolNumber,
+ INSTANCE.icon(LISTOFTOOLS[toolNumber]["toolIcon"]),
+ LISTOFTOOLS[toolNumber]["toolString"])
+ for tool in LISTOFTOOLS[1:]:
toolNumber += 1
self.toolSelector.insertItem(toolNumber,
INSTANCE.icon(LISTOFTOOLS[toolNumber]["toolIcon"]),
diff --git a/plugins/python/workflow_buttons/workflow_buttons.py b/plugins/python/workflow_buttons/workflow_buttons.py
index 0383f5120e..e5a2caa8a9 100644
--- a/plugins/python/workflow_buttons/workflow_buttons.py
+++ b/plugins/python/workflow_buttons/workflow_buttons.py
@@ -49,7 +49,7 @@ class WorkflowButtons(DockWidget):
self.bottomBar = QToolBar(self)
self.bottomBar.setIconSize(QSize(22,22))
- self.bottomBar.setStyleSheet("QToolBar{spacing:0px; margins:0px;}")
+ self.bottomBar.setStyleSheet("QToolBar{spacing:0px; margin:0px;}")
barSpacer = QWidget(self.bottomBar)
barSpacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.bottomBar.addWidget(barSpacer)