• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mcallegari / qlcplus / 6683238402

29 Oct 2023 12:10PM UTC coverage: 28.07%. Remained the same
6683238402

push

github

mcallegari
engine: fix build

15385 of 54809 relevant lines covered (28.07%)

20267.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.45
/engine/src/qlcclipboard.cpp
1
/*
2
  Q Light Controller Plus
3
  qlcclipboard.cpp
4

5
  Copyright (c) Massimo Callegari
6

7
  Licensed under the Apache License, Version 2.0 (the "License");
8
  you may not use this file except in compliance with the License.
9
  You may obtain a copy of the License at
10

11
      http://www.apache.org/licenses/LICENSE-2.0.txt
12

13
  Unless required by applicable law or agreed to in writing, software
14
  distributed under the License is distributed on an "AS IS" BASIS,
15
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
  See the License for the specific language governing permissions and
17
  limitations under the License.
18
*/
19

20
#include "qlcclipboard.h"
21
#include "doc.h"
22

23
QLCClipboard::QLCClipboard(Doc *doc)
174✔
24
    : m_doc(doc)
25
    , m_copyFunction(NULL)
174✔
26
{
27

28
}
174✔
29

30
void QLCClipboard::resetContents()
447✔
31
{
32
    m_copySteps.clear();
447✔
33
    m_copySceneValues.clear();
447✔
34
    if (m_copyFunction != NULL && m_doc->function(m_copyFunction->id()) == NULL)
447✔
35
        delete m_copyFunction;
×
36
    m_copyFunction = NULL;
447✔
37
}
447✔
38

39
void QLCClipboard::copyContent(quint32 sourceID, QList<ChaserStep> steps)
×
40
{
41
    Q_UNUSED(sourceID)
42

43
    m_copySteps = steps;
×
44
}
×
45

46
void QLCClipboard::copyContent(quint32 sourceID, QList<SceneValue> values)
×
47
{
48
    Q_UNUSED(sourceID)
49

50
    m_copySceneValues = values;
×
51
}
×
52

53
void QLCClipboard::copyContent(quint32 sourceID, Function *function)
×
54
{
55
    Q_UNUSED(sourceID)
56

57
    if (function == NULL)
×
58
        return;
×
59

60
    if (m_copyFunction != NULL && m_doc->function(m_copyFunction->id()) == NULL)
×
61
        delete m_copyFunction;
×
62
    m_copyFunction = NULL;
×
63

64
    /* Attempt to create a copy of the function to Doc */
65
    Function* copy = function->createCopy(m_doc, false);
×
66
    if (copy != NULL)
×
67
    {
68
        copy->setName(tr("Copy of %1").arg(function->name()));
×
69
        m_copyFunction = copy;
×
70
    }
71
}
72

73
bool QLCClipboard::hasChaserSteps()
×
74
{
75
    if (m_copySteps.count() > 0)
×
76
        return true;
×
77

78
    return false;
×
79
}
80

81
bool QLCClipboard::hasSceneValues()
×
82
{
83
    if (m_copySceneValues.count() > 0)
×
84
        return true;
×
85

86
    return false;
×
87
}
88

89
bool QLCClipboard::hasFunction()
×
90
{
91
    if (m_copyFunction != NULL)
×
92
        return true;
×
93

94
    return false;
×
95
}
96

97
QList<ChaserStep> QLCClipboard::getChaserSteps()
×
98
{
99
    return m_copySteps;
×
100
}
101

102
QList<SceneValue> QLCClipboard::getSceneValues()
×
103
{
104
    return m_copySceneValues;
×
105
}
106

107
Function *QLCClipboard::getFunction()
×
108
{
109
    return m_copyFunction;
×
110
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc