Line | Source Code | Coverage |
---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | - |
4 | ** Contact: http://www.qt-project.org/legal | - |
5 | ** | - |
6 | ** This file is part of the QtGui module of the Qt Toolkit. | - |
7 | ** | - |
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
9 | ** Commercial License Usage | - |
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
11 | ** accordance with the commercial license agreement provided with the | - |
12 | ** Software or, alternatively, in accordance with the terms contained in | - |
13 | ** a written agreement between you and Digia. For licensing terms and | - |
14 | ** conditions see http://qt.digia.com/licensing. For further information | - |
15 | ** use the contact form at http://qt.digia.com/contact-us. | - |
16 | ** | - |
17 | ** GNU Lesser General Public License Usage | - |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
19 | ** General Public License version 2.1 as published by the Free Software | - |
20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | - |
21 | ** packaging of this file. Please review the following information to | - |
22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | - |
23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - |
24 | ** | - |
25 | ** In addition, as a special exception, Digia gives you certain additional | - |
26 | ** rights. These rights are described in the Digia Qt LGPL Exception | - |
27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - |
28 | ** | - |
29 | ** GNU General Public License Usage | - |
30 | ** Alternatively, this file may be used under the terms of the GNU | - |
31 | ** General Public License version 3.0 as published by the Free Software | - |
32 | ** Foundation and appearing in the file LICENSE.GPL included in the | - |
33 | ** packaging of this file. Please review the following information to | - |
34 | ** ensure the GNU General Public License version 3.0 requirements will be | - |
35 | ** met: http://www.gnu.org/copyleft/gpl.html. | - |
36 | ** | - |
37 | ** | - |
38 | ** $QT_END_LICENSE$ | - |
39 | ** | - |
40 | ****************************************************************************/ | - |
41 | #include "qplatformclipboard.h" | - |
42 | | - |
43 | #ifndef QT_NO_CLIPBOARD | - |
44 | | - |
45 | #include <QtGui/private/qguiapplication_p.h> | - |
46 | #include <QtCore/qmimedata.h> | - |
47 | | - |
48 | QT_BEGIN_NAMESPACE | - |
49 | | - |
50 | class QClipboardData | - |
51 | { | - |
52 | public: | - |
53 | QClipboardData(); | - |
54 | ~QClipboardData(); | - |
55 | | - |
56 | void setSource(QMimeData* s) | - |
57 | { | - |
58 | if (s == src) never evaluated: s == src | 0 |
59 | return; | 0 |
60 | delete src; never executed (the execution status of this line is deduced): delete src; | - |
61 | src = s; never executed (the execution status of this line is deduced): src = s; | - |
62 | } | 0 |
63 | QMimeData* source() | - |
64 | { return src; } never executed: return src; | 0 |
65 | | - |
66 | private: | - |
67 | QMimeData* src; | - |
68 | }; | - |
69 | | - |
70 | QClipboardData::QClipboardData() | - |
71 | { | - |
72 | src = 0; never executed (the execution status of this line is deduced): src = 0; | - |
73 | } | 0 |
74 | | - |
75 | QClipboardData::~QClipboardData() | - |
76 | { | - |
77 | delete src; never executed (the execution status of this line is deduced): delete src; | - |
78 | } | 0 |
79 | | - |
80 | Q_GLOBAL_STATIC(QClipboardData,q_clipboardData); never executed: delete x; never executed: return thisGlobalStatic.pointer.load(); never evaluated: !thisGlobalStatic.pointer.testAndSetOrdered(0, x) never evaluated: !thisGlobalStatic.pointer.load() never evaluated: !thisGlobalStatic.destroyed | 0 |
81 | | - |
82 | /*! | - |
83 | \class QPlatformClipboard | - |
84 | \since 5.0 | - |
85 | \internal | - |
86 | \preliminary | - |
87 | \ingroup qpa | - |
88 | | - |
89 | \brief The QPlatformClipboard class provides an abstraction for the system clipboard. | - |
90 | */ | - |
91 | | - |
92 | QPlatformClipboard::~QPlatformClipboard() | - |
93 | { | - |
94 | | - |
95 | } | - |
96 | | - |
97 | QMimeData *QPlatformClipboard::mimeData(QClipboard::Mode mode) | - |
98 | { | - |
99 | //we know its clipboard | - |
100 | Q_UNUSED(mode); never executed (the execution status of this line is deduced): (void)mode;; | - |
101 | return q_clipboardData()->source(); never executed: return q_clipboardData()->source(); | 0 |
102 | } | - |
103 | | - |
104 | void QPlatformClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) | - |
105 | { | - |
106 | //we know its clipboard | - |
107 | Q_UNUSED(mode); never executed (the execution status of this line is deduced): (void)mode;; | - |
108 | q_clipboardData()->setSource(data); never executed (the execution status of this line is deduced): q_clipboardData()->setSource(data); | - |
109 | | - |
110 | emitChanged(mode); never executed (the execution status of this line is deduced): emitChanged(mode); | - |
111 | } | 0 |
112 | | - |
113 | bool QPlatformClipboard::supportsMode(QClipboard::Mode mode) const | - |
114 | { | - |
115 | return mode == QClipboard::Clipboard; never executed: return mode == QClipboard::Clipboard; | 0 |
116 | } | - |
117 | | - |
118 | bool QPlatformClipboard::ownsMode(QClipboard::Mode mode) const | - |
119 | { | - |
120 | Q_UNUSED(mode); never executed (the execution status of this line is deduced): (void)mode;; | - |
121 | return false; never executed: return false; | 0 |
122 | } | - |
123 | | - |
124 | void QPlatformClipboard::emitChanged(QClipboard::Mode mode) | - |
125 | { | - |
126 | QGuiApplication::clipboard()->emitChanged(mode); executed (the execution status of this line is deduced): QGuiApplication::clipboard()->emitChanged(mode); | - |
127 | } executed: } Execution Count:45 | 45 |
128 | | - |
129 | QT_END_NAMESPACE | - |
130 | | - |
131 | #endif //QT_NO_CLIPBOARD | - |
132 | | - |
| | |