on xenial help sign in
Export indicator symbols using Q_DECL_EXPORT
9da9b67Nick Dedekind
plugins/Unity/Indicators/CMakeLists.txt+1−5
@@ -25,6 +25,7 @@ set(IndicatorsQML_SOURCES
25 indicatorsmodel.cpp
25 indicatorsmodel.cpp
26 plugin.cpp
26 plugin.cpp
27)
27)
28+add_definitions(-DUNITYINDICATORS_LIBRARY)
28
29
29set(IndicatorsQML_RESOURCES
30set(IndicatorsQML_RESOURCES
30 resources/indicators.qrc
31 resources/indicators.qrc
@@ -38,11 +39,6 @@ add_library(IndicatorsQml SHARED
38 ${IndicatorsQML_RESOURCES_RCC}
39 ${IndicatorsQML_RESOURCES_RCC}
39 ${IndicatorsQML_SOURCES}
40 ${IndicatorsQML_SOURCES}
40)
41)
41−# Because this is an internal support library, we want
42−# to expose all symbols in it. Consider changing this
43−# either to a static library or just using the
44−# files directly in targets.
45−set_target_properties(IndicatorsQml PROPERTIES COMPILE_FLAGS -fvisibility=default)
46
42
47target_link_libraries(IndicatorsQml
43target_link_libraries(IndicatorsQml
48 ${QMENUMODEL_LDFLAGS}
44 ${QMENUMODEL_LDFLAGS}
plugins/Unity/Indicators/flatmenuproxymodel.h+3−1
@@ -20,12 +20,14 @@
20#ifndef FLATMENUPROXYMODEL_H
20#ifndef FLATMENUPROXYMODEL_H
21#define FLATMENUPROXYMODEL_H
21#define FLATMENUPROXYMODEL_H
22
22
23+#include "unityindicatorsglobal.h"
24+
23#include <QAbstractProxyModel>
25#include <QAbstractProxyModel>
24#include <qdbusmenumodel.h>
26#include <qdbusmenumodel.h>
25
27
26class SectionInfo;
28class SectionInfo;
27
29
28−class FlatMenuProxyModel : public QAbstractProxyModel
30+class UNITYINDICATORS_EXPORT FlatMenuProxyModel : public QAbstractProxyModel
29{
31{
30 Q_OBJECT
32 Q_OBJECT
31 Q_PROPERTY(int count READ count NOTIFY countChanged)
33 Q_PROPERTY(int count READ count NOTIFY countChanged)
plugins/Unity/Indicators/indicator.h+3−1
@@ -21,10 +21,12 @@
21#ifndef INDICATOR_H
21#ifndef INDICATOR_H
22#define INDICATOR_H
22#define INDICATOR_H
23
23
24+#include "unityindicatorsglobal.h"
25+
24#include <QObject>
26#include <QObject>
25#include <QSettings>
27#include <QSettings>
26
28
27−class Indicator : public QObject
29+class UNITYINDICATORS_EXPORT Indicator : public QObject
28{
30{
29 Q_OBJECT
31 Q_OBJECT
30 Q_PROPERTY(QString identifier READ identifier NOTIFY identifierChanged)
32 Q_PROPERTY(QString identifier READ identifier NOTIFY identifierChanged)
plugins/Unity/Indicators/indicators.h+7−5
@@ -19,9 +19,11 @@
19#ifndef INDICATORS_H
19#ifndef INDICATORS_H
20#define INDICATORS_H
20#define INDICATORS_H
21
21
22+#include "unityindicatorsglobal.h"
23+
22#include <QObject>
24#include <QObject>
23
25
24−class ActionState : public QObject
26+class UNITYINDICATORS_EXPORT ActionState : public QObject
25{
27{
26 Q_OBJECT
28 Q_OBJECT
27public:
29public:
@@ -36,7 +38,7 @@ public:
36 ActionState(QObject*parent=0):QObject(parent) {}
38 ActionState(QObject*parent=0):QObject(parent) {}
37};
39};
38
40
39−class NetworkActionState : public QObject
41+class UNITYINDICATORS_EXPORT NetworkActionState : public QObject
40{
42{
41 Q_OBJECT
43 Q_OBJECT
42public:
44public:
@@ -49,7 +51,7 @@ public:
49 NetworkActionState(QObject*parent=0):QObject(parent) {}
51 NetworkActionState(QObject*parent=0):QObject(parent) {}
50};
52};
51
53
52−class NetworkConnection : public QObject
54+class UNITYINDICATORS_EXPORT NetworkConnection : public QObject
53{
55{
54 Q_OBJECT
56 Q_OBJECT
55public:
57public:
@@ -64,7 +66,7 @@ public:
64 NetworkConnection(QObject*parent=0):QObject(parent) {}
66 NetworkConnection(QObject*parent=0):QObject(parent) {}
65};
67};
66
68
67−class IndicatorsModelRole : public QObject
69+class UNITYINDICATORS_EXPORT IndicatorsModelRole : public QObject
68{
70{
69 Q_OBJECT
71 Q_OBJECT
70public:
72public:
@@ -83,7 +85,7 @@ public:
83 IndicatorsModelRole(QObject*parent=0):QObject(parent) {}
85 IndicatorsModelRole(QObject*parent=0):QObject(parent) {}
84};
86};
85
87
86−class FlatMenuProxyModelRole : public QObject
88+class UNITYINDICATORS_EXPORT FlatMenuProxyModelRole : public QObject
87{
89{
88 Q_OBJECT
90 Q_OBJECT
89public:
91public:
plugins/Unity/Indicators/indicatorsmanager.h+4−3
@@ -19,15 +19,16 @@
19#ifndef INDICATORS_MANAGER_H
19#ifndef INDICATORS_MANAGER_H
20#define INDICATORS_MANAGER_H
20#define INDICATORS_MANAGER_H
21
21
22+#include "indicator.h"
23+#include "unityindicatorsglobal.h"
24+
22#include <QObject>
25#include <QObject>
23#include <QFileSystemWatcher>
26#include <QFileSystemWatcher>
24#include <QDir>
27#include <QDir>
25#include <QHash>
28#include <QHash>
26#include <QSharedPointer>
29#include <QSharedPointer>
27
30
28−#include "indicator.h"
29−
30−class IndicatorsManager : public QObject
31+class UNITYINDICATORS_EXPORT IndicatorsManager : public QObject
31{
32{
32 Q_OBJECT
33 Q_OBJECT
33 Q_PROPERTY(bool loaded READ isLoaded NOTIFY loadedChanged)
34 Q_PROPERTY(bool loaded READ isLoaded NOTIFY loadedChanged)
plugins/Unity/Indicators/indicatorsmodel.h+2−1
@@ -22,13 +22,14 @@
22#define INDICATORSMODEL_H
22#define INDICATORSMODEL_H
23
23
24#include "indicator.h"
24#include "indicator.h"
25+#include "unityindicatorsglobal.h"
25
26
26#include <QAbstractListModel>
27#include <QAbstractListModel>
27#include <QQmlEngine>
28#include <QQmlEngine>
28
29
29class IndicatorsManager;
30class IndicatorsManager;
30
31
31−class IndicatorsModel : public QAbstractListModel
32+class UNITYINDICATORS_EXPORT IndicatorsModel : public QAbstractListModel
32{
33{
33 Q_OBJECT
34 Q_OBJECT
34 Q_ENUMS(Roles)
35 Q_ENUMS(Roles)
plugins/Unity/Indicators/unityindicatorsglobal.hnew file+23
@@ -0,0 +1,23 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include <QtCore/QtGlobal>
18+
19+#if defined(UNITYINDICATORS_LIBRARY)
20+# define UNITYINDICATORS_EXPORT Q_DECL_EXPORT
21+#else
22+# define UNITYINDICATORS_EXPORT Q_DECL_IMPORT
23+#endif
tests/mocks/Unity/Indicators/CMakeLists.txt+1−5
@@ -26,11 +26,7 @@ add_library(IndicatorsFakeQml SHARED
26 ${IndicatorsFakeQml_RESOURCES_RCC}
26 ${IndicatorsFakeQml_RESOURCES_RCC}
27 ${IndicatorsFakeQml_SOURCES}
27 ${IndicatorsFakeQml_SOURCES}
28)
28)
29−# Because this is an internal support library, we want
29+add_definitions(-DUNITYINDICATORS_LIBRARY)
30−# to expose all symbols in it. Consider changing this
31−# either to a static library or just using the
32−# files directly in targets.
33−set_target_properties(IndicatorsFakeQml PROPERTIES COMPILE_FLAGS -fvisibility=default)
34
30
35target_link_libraries(IndicatorsFakeQml)
31target_link_libraries(IndicatorsFakeQml)
36
32