chore(storybook): remove unused utils
This commit is contained in:
parent
db2be47ee1
commit
339cc8826e
|
@ -2,26 +2,6 @@ pragma Singleton
|
||||||
import QtQml 2.14
|
import QtQml 2.14
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
function singleShotConnection(prop, handler) {
|
|
||||||
const internalHandler = (...args) => {
|
|
||||||
handler(...args)
|
|
||||||
prop.disconnect(internalHandler)
|
|
||||||
}
|
|
||||||
prop.connect(internalHandler)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getUniqueValuesFromModel(model, prop) {
|
|
||||||
if (!model)
|
|
||||||
return []
|
|
||||||
|
|
||||||
const values = []
|
|
||||||
for (let i = 0; i < model.count; i++)
|
|
||||||
values.push(model.get(i)[prop])
|
|
||||||
|
|
||||||
const onlyUnique = (value, index, self) => self.indexOf(value) === index
|
|
||||||
return values.filter(onlyUnique)
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatQmlCode(code) {
|
function formatQmlCode(code) {
|
||||||
code = code.replace(/^\n+/, "")
|
code = code.replace(/^\n+/, "")
|
||||||
code = code.replace(/\s+$/, "")
|
code = code.replace(/\s+$/, "")
|
||||||
|
|
Loading…
Reference in New Issue