on xenial help sign in
Export indicator symbols using Q_DECL_EXPORT
commit9da9b679a76131f022ec1ace5a320d845647d5dd authorNick Dedekind <nicholas.dedekind@gmail.com> dateWed 17 Jul 2013, 09:57 (13 years ago) parentb620e36
8 files changed+44−21
plugins/Unity/Indicators/CMakeLists.txt+1−5 plugins/Unity/Indicators/flatmenuproxymodel.h+3−1 plugins/Unity/Indicators/indicator.h+3−1 plugins/Unity/Indicators/indicators.h+7−5 plugins/Unity/Indicators/indicatorsmanager.h+4−3 plugins/Unity/Indicators/indicatorsmodel.h+2−1 plugins/Unity/Indicators/unityindicatorsglobal.h+23 tests/mocks/Unity/Indicators/CMakeLists.txt+1−5
plugins/Unity/Indicators/CMakeLists.txt+1−5
@@ -25,6 +25,7 @@ set(IndicatorsQML_SOURCES
2525 indicatorsmodel.cpp
2626 plugin.cpp
2727)
28+add_definitions(-DUNITYINDICATORS_LIBRARY)
2829
2930set(IndicatorsQML_RESOURCES
3031 resources/indicators.qrc
@@ -38,11 +39,6 @@ add_library(IndicatorsQml SHARED
3839 ${IndicatorsQML_RESOURCES_RCC}
3940 ${IndicatorsQML_SOURCES}
4041)
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)
4642
4743target_link_libraries(IndicatorsQml
4844 ${QMENUMODEL_LDFLAGS}
plugins/Unity/Indicators/flatmenuproxymodel.h+3−1
@@ -20,12 +20,14 @@
2020#ifndef FLATMENUPROXYMODEL_H
2121#define FLATMENUPROXYMODEL_H
2222
23+#include "unityindicatorsglobal.h"
24+
2325#include <QAbstractProxyModel>
2426#include <qdbusmenumodel.h>
2527
2628class SectionInfo;
2729
28−class FlatMenuProxyModel : public QAbstractProxyModel
30+class UNITYINDICATORS_EXPORT FlatMenuProxyModel : public QAbstractProxyModel
2931{
3032 Q_OBJECT
3133 Q_PROPERTY(int count READ count NOTIFY countChanged)
plugins/Unity/Indicators/indicator.h+3−1
@@ -21,10 +21,12 @@
2121#ifndef INDICATOR_H
2222#define INDICATOR_H
2323
24+#include "unityindicatorsglobal.h"
25+
2426#include <QObject>
2527#include <QSettings>
2628
27−class Indicator : public QObject
29+class UNITYINDICATORS_EXPORT Indicator : public QObject
2830{
2931 Q_OBJECT
3032 Q_PROPERTY(QString identifier READ identifier NOTIFY identifierChanged)
plugins/Unity/Indicators/indicators.h+7−5
@@ -19,9 +19,11 @@
1919#ifndef INDICATORS_H
2020#define INDICATORS_H
2121
22+#include "unityindicatorsglobal.h"
23+
2224#include <QObject>
2325
24−class ActionState : public QObject
26+class UNITYINDICATORS_EXPORT ActionState : public QObject
2527{
2628 Q_OBJECT
2729public:
@@ -36,7 +38,7 @@ public:
3638 ActionState(QObject*parent=0):QObject(parent) {}
3739};
3840
39−class NetworkActionState : public QObject
41+class UNITYINDICATORS_EXPORT NetworkActionState : public QObject
4042{
4143 Q_OBJECT
4244public:
@@ -49,7 +51,7 @@ public:
4951 NetworkActionState(QObject*parent=0):QObject(parent) {}
5052};
5153
52−class NetworkConnection : public QObject
54+class UNITYINDICATORS_EXPORT NetworkConnection : public QObject
5355{
5456 Q_OBJECT
5557public:
@@ -64,7 +66,7 @@ public:
6466 NetworkConnection(QObject*parent=0):QObject(parent) {}
6567};
6668
67−class IndicatorsModelRole : public QObject
69+class UNITYINDICATORS_EXPORT IndicatorsModelRole : public QObject
6870{
6971 Q_OBJECT
7072public:
@@ -83,7 +85,7 @@ public:
8385 IndicatorsModelRole(QObject*parent=0):QObject(parent) {}
8486};
8587
86−class FlatMenuProxyModelRole : public QObject
88+class UNITYINDICATORS_EXPORT FlatMenuProxyModelRole : public QObject
8789{
8890 Q_OBJECT
8991public:
plugins/Unity/Indicators/indicatorsmanager.h+4−3
@@ -19,15 +19,16 @@
1919#ifndef INDICATORS_MANAGER_H
2020#define INDICATORS_MANAGER_H
2121
22+#include "indicator.h"
23+#include "unityindicatorsglobal.h"
24+
2225#include <QObject>
2326#include <QFileSystemWatcher>
2427#include <QDir>
2528#include <QHash>
2629#include <QSharedPointer>
2730
28−#include "indicator.h"
29−
30−class IndicatorsManager : public QObject
31+class UNITYINDICATORS_EXPORT IndicatorsManager : public QObject
3132{
3233 Q_OBJECT
3334 Q_PROPERTY(bool loaded READ isLoaded NOTIFY loadedChanged)
plugins/Unity/Indicators/indicatorsmodel.h+2−1
@@ -22,13 +22,14 @@
2222#define INDICATORSMODEL_H
2323
2424#include "indicator.h"
25+#include "unityindicatorsglobal.h"
2526
2627#include <QAbstractListModel>
2728#include <QQmlEngine>
2829
2930class IndicatorsManager;
3031
31−class IndicatorsModel : public QAbstractListModel
32+class UNITYINDICATORS_EXPORT IndicatorsModel : public QAbstractListModel
3233{
3334 Q_OBJECT
3435 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
2626 ${IndicatorsFakeQml_RESOURCES_RCC}
2727 ${IndicatorsFakeQml_SOURCES}
2828)
29−# Because this is an internal support library, we want
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)
29+add_definitions(-DUNITYINDICATORS_LIBRARY)
3430
3531target_link_libraries(IndicatorsFakeQml)
3632