on xenial help sign in
Use nullptr instead of NULL.
commitac10b98caf105c2fdd86bc6ffb1dc7467ff27e9d authorJussi Pakkanen <jussi.pakkanen@canonical.com> dateTue 26 Aug 2014, 11:14 (12 years ago) parent1d2b779
27 files changed+94−94
include/paths.h.in+1−1 plugins/AccountsService/AccountsServiceDBusAdaptor.cpp+1−1 plugins/HudClient/hudclient.cpp+12−12 plugins/HudClient/volumepeakdetector.cpp+9−9 plugins/Powerd/Powerd.cpp+1−1 plugins/Unity/Indicators/menucontentactivator.cpp+2−2 plugins/Unity/Indicators/menucontentactivator.h+1−1 plugins/Unity/Indicators/modelprinter.cpp+3−3 plugins/Unity/Indicators/rootactionstate.cpp+4−4 plugins/Unity/Indicators/unitymenumodelcache.h+1−1 plugins/Unity/Indicators/unitymenumodelstack.cpp+4−4 plugins/Unity/Indicators/unitymenumodelstack.h+1−1 plugins/Utils/qlimitproxymodelqml.cpp+6−6 plugins/Utils/qsortfilterproxymodelqml.cpp+7−7 plugins/Utils/timeformatter.cpp+8−8 tests/mocks/GSettings.1.0/fake_gsettings.h+2−2 tests/mocks/HudClient/fake_libhud_client.cpp+9−9 tests/mocks/LightDM/demo/GreeterPrivate.cpp+5−5 tests/mocks/QMenuModel/unitymenumodel.cpp+4−4 tests/mocks/QMenuModel/unitymenumodel.h+2−2 tests/mocks/QtMultimedia/audio.cpp+1−1 tests/mocks/Unity/Application/ApplicationDBusAdaptor.cpp+1−1 tests/mocks/Unity/Application/ApplicationInfo.h+2−2 tests/mocks/Unity/Application/ApplicationManager.h+1−1 tests/plugins/Unity/Indicators/rootactionstatetest.cpp+4−4 tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp+1−1 tests/uqmlscene/main.cpp+1−1
include/paths.h.in+1−1
@@ -91,7 +91,7 @@ inline QString mockPluginsDir() {
9191inline QStringList shellDataDirs() {
9292 QStringList dirs = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
9393 if (!isRunningInstalled()) {
94− if (getenv("UNITY_TEST_ENV")==NULL) {
94+ if (getenv("UNITY_TEST_ENV")==nullptr) {
9595 dirs.prepend("@CMAKE_BINARY_DIR@/share");
9696 }
9797 }
plugins/AccountsService/AccountsServiceDBusAdaptor.cpp+1−1
@@ -24,7 +24,7 @@
2424
2525AccountsServiceDBusAdaptor::AccountsServiceDBusAdaptor(QObject* parent)
2626 : QObject(parent),
27− m_accountsManager(NULL),
27+ m_accountsManager(nullptr),
2828 m_users()
2929{
3030 QDBusConnection connection = QDBusConnection::SM_BUSNAME();
plugins/HudClient/hudclient.cpp+12−12
@@ -82,7 +82,7 @@ HudClient::HudClient()
8282 m_results = new DeeListModel();
8383 m_clientQuery = hud_client_query_new("");
8484 m_toolBarModel = new HudToolBarModel(m_clientQuery);
85− m_currentActionParam = NULL;
85+ m_currentActionParam = nullptr;
8686 m_results->setModel(hud_client_query_get_results_model(m_clientQuery));
8787
8888 g_signal_connect(G_OBJECT(m_clientQuery), "voice-query-loading", G_CALLBACK(loadingCB), this);
@@ -151,13 +151,13 @@ void HudClient::executeParametrizedAction(const QVariant &values)
151151 updateParametrizedAction(values);
152152 hud_client_param_send_commit(m_currentActionParam);
153153 g_object_unref(m_currentActionParam);
154− m_currentActionParam = NULL;
154+ m_currentActionParam = nullptr;
155155 Q_EMIT commandExecuted();
156156}
157157
158158void HudClient::updateParametrizedAction(const QVariant &values)
159159{
160− if (m_currentActionParam != NULL) {
160+ if (m_currentActionParam != nullptr) {
161161 const QVariantMap map = values.value<QVariantMap>();
162162 GActionGroup *ag = hud_client_param_get_actions(m_currentActionParam);
163163
@@ -179,10 +179,10 @@ void HudClient::updateParametrizedAction(const QVariant &values)
179179
180180void HudClient::cancelParametrizedAction()
181181{
182− if (m_currentActionParam != NULL) {
182+ if (m_currentActionParam != nullptr) {
183183 hud_client_param_send_cancel(m_currentActionParam);
184184 g_object_unref(m_currentActionParam);
185− m_currentActionParam = NULL;
185+ m_currentActionParam = nullptr;
186186 }
187187}
188188
@@ -212,9 +212,9 @@ void HudClient::executeCommand(int index)
212212 GVariant *is_parametrized = dee_model_get_value(model, iter, 7);
213213 if (g_variant_get_boolean(is_parametrized)) {
214214 m_currentActionParam = hud_client_query_execute_param_command(m_clientQuery, command_key, /* timestamp */ 0);
215− if (m_currentActionParam != NULL) {
215+ if (m_currentActionParam != nullptr) {
216216 GMenuModel *menuModel = hud_client_param_get_model (m_currentActionParam);
217− if (menuModel == NULL) {
217+ if (menuModel == nullptr) {
218218 g_signal_connect(m_currentActionParam, HUD_CLIENT_PARAM_SIGNAL_MODEL_READY, G_CALLBACK(modelReadyCB), this);
219219 } else {
220220 modelReady(false);
@@ -244,9 +244,9 @@ void HudClient::modelReady(bool needDisconnect)
244244}
245245
246246static void addAttribute(QVariantMap &properties, GMenuModel *menuModel, int item, const char *attribute) {
247− GVariant *v = g_menu_model_get_item_attribute_value(menuModel, item, attribute, NULL);
247+ GVariant *v = g_menu_model_get_item_attribute_value(menuModel, item, attribute, nullptr);
248248
249− if (v == NULL)
249+ if (v == nullptr)
250250 return;
251251
252252 properties.insert(attribute, DeeListModel::VariantForData(v));
@@ -264,10 +264,10 @@ void HudClient::modelReallyReady(bool needDisconnect)
264264 for (int i = 0; i < g_menu_model_get_n_items(menuModel); i++) {
265265 GVariant *v = g_menu_model_get_item_attribute_value(menuModel, i, "parameter-type", G_VARIANT_TYPE_STRING);
266266
267− if (v == NULL)
267+ if (v == nullptr)
268268 continue;
269269
270− const QString type = QString::fromUtf8(g_variant_get_string(v, NULL));
270+ const QString type = QString::fromUtf8(g_variant_get_string(v, nullptr));
271271 if (type == "slider") {
272272 const char *sliderAttributes[] = { "label", "min", "max", "step", "value", "live", "action" };
273273 QVariantMap properties;
@@ -283,7 +283,7 @@ void HudClient::modelReallyReady(bool needDisconnect)
283283 DeeModel *model = hud_client_query_get_results_model(m_clientQuery);
284284 DeeModelIter *iter = dee_model_get_iter_at_row(model, m_currentActionIndex);
285285 GVariant *actionTextVariant = dee_model_get_value(model, iter, 1);
286− const QString actionText = QString::fromUtf8(g_variant_get_string(actionTextVariant, NULL));
286+ const QString actionText = QString::fromUtf8(g_variant_get_string(actionTextVariant, nullptr));
287287 g_variant_unref(actionTextVariant);
288288 Q_EMIT showParametrizedAction(actionText, QVariant::fromValue(items));
289289}
plugins/HudClient/volumepeakdetector.cpp+9−9
@@ -45,15 +45,15 @@ PulseAudioVolumePeakDetector::PulseAudioVolumePeakDetector()
4545 : m_accumulatedValue(0)
4646 , m_nAccumulatedValues(0)
4747 , m_accumulatedValuesLimit(1)
48− , m_context(NULL)
49− , m_mainloop_api(NULL)
50− , m_stream(NULL)
48+ , m_context(nullptr)
49+ , m_mainloop_api(nullptr)
50+ , m_stream(nullptr)
5151{
5252}
5353
5454void PulseAudioVolumePeakDetector::start()
5555{
56− pa_mainloop *mainloop = NULL;
56+ pa_mainloop *mainloop = nullptr;
5757
5858 /* Set up a new main loop */
5959 mainloop = pa_mainloop_new();
@@ -63,7 +63,7 @@ void PulseAudioVolumePeakDetector::start()
6363 m_mainloop_api = pa_mainloop_get_api(mainloop);
6464
6565 /* Create a new connection context */
66− m_context = pa_context_new(m_mainloop_api, NULL);
66+ m_context = pa_context_new(m_mainloop_api, nullptr);
6767 if (!m_context) {
6868 goto quit;
6969 }
@@ -71,12 +71,12 @@ void PulseAudioVolumePeakDetector::start()
7171 pa_context_set_state_callback(m_context, context_state_callback, this);
7272
7373 /* Connect the context */
74− if (pa_context_connect(m_context, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0) {
74+ if (pa_context_connect(m_context, nullptr, PA_CONTEXT_NOFLAGS, nullptr) < 0) {
7575 goto quit;
7676 }
7777
7878 /* Run the main loop */
79− if (pa_mainloop_run(mainloop, NULL) < 0) {
79+ if (pa_mainloop_run(mainloop, nullptr) < 0) {
8080 goto quit;
8181 }
8282
@@ -130,7 +130,7 @@ void PulseAudioVolumePeakDetector::startStream()
130130 pa_channel_map_init_extend(&channel_map, sample_spec.channels, PA_CHANNEL_MAP_DEFAULT);
131131 pa_proplist_sets(proplist, PA_PROP_MEDIA_NAME, "HUD Peak Detector");
132132
133− m_stream = pa_stream_new_with_proplist(m_context, NULL, &sample_spec, &channel_map, proplist);
133+ m_stream = pa_stream_new_with_proplist(m_context, nullptr, &sample_spec, &channel_map, proplist);
134134 if (!m_stream) {
135135 pa_proplist_free(proplist);
136136 quit();
@@ -144,7 +144,7 @@ void PulseAudioVolumePeakDetector::startStream()
144144 buffer_attr.maxlength = (uint32_t) -1;
145145 buffer_attr.fragsize = sizeof(float);
146146
147− if (pa_stream_connect_record(m_stream, NULL, &buffer_attr, (pa_stream_flags_t)(PA_STREAM_PEAK_DETECT | PA_STREAM_ADJUST_LATENCY)) < 0) {
147+ if (pa_stream_connect_record(m_stream, nullptr, &buffer_attr, (pa_stream_flags_t)(PA_STREAM_PEAK_DETECT | PA_STREAM_ADJUST_LATENCY)) < 0) {
148148 quit();
149149 }
150150}
plugins/Powerd/Powerd.cpp+1−1
@@ -39,7 +39,7 @@ void dimTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *un
3939
4040Powerd::Powerd(QObject* parent)
4141 : QObject(parent),
42− unityScreen(NULL)
42+ unityScreen(nullptr)
4343{
4444 unityScreen = new QDBusInterface("com.canonical.Unity.Screen",
4545 "/com/canonical/Unity/Screen",
plugins/Unity/Indicators/menucontentactivator.cpp+2−2
@@ -45,7 +45,7 @@ public:
4545 m_baseIndex(0),
4646 m_delta(0),
4747 m_count(0),
48− m_timer(NULL),
48+ m_timer(nullptr),
4949 q(parent)
5050 {}
5151
@@ -55,7 +55,7 @@ public:
5555 m_content.clear();
5656 }
5757
58− int findNextInactiveDelta(bool* finished = NULL);
58+ int findNextInactiveDelta(bool* finished = nullptr);
5959
6060 static int content_count(QQmlListProperty<MenuContentState> *prop);
6161 static MenuContentState* content_at(QQmlListProperty<MenuContentState> *prop, int index);
plugins/Unity/Indicators/menucontentactivator.h+1−1
@@ -71,7 +71,7 @@ class UNITYINDICATORS_EXPORT MenuContentActivator : public QObject
7171 Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged)
7272 Q_PROPERTY(QQmlListProperty<MenuContentState> content READ content NOTIFY contentChanged DESIGNABLE false)
7373public:
74− MenuContentActivator(QObject* parent = NULL);
74+ MenuContentActivator(QObject* parent = nullptr);
7575 ~MenuContentActivator();
7676
7777 Q_INVOKABLE void restart();
plugins/Unity/Indicators/modelprinter.cpp+3−3
@@ -27,13 +27,13 @@
2727
2828ModelPrinter::ModelPrinter(QObject *parent)
2929 : QObject(parent)
30− , m_model(NULL)
30+ , m_model(nullptr)
3131{
3232}
3333
3434void ModelPrinter::setSourceModel(UnityMenuModel * sourceModel)
3535{
36− if (m_model != NULL) {
36+ if (m_model != nullptr) {
3737 disconnect(m_model);
3838 }
3939 if (m_model != sourceModel) {
@@ -41,7 +41,7 @@ void ModelPrinter::setSourceModel(UnityMenuModel * sourceModel)
4141 Q_EMIT modelChanged();
4242 Q_EMIT textChanged();
4343 }
44− if (m_model != NULL) {
44+ if (m_model != nullptr) {
4545 connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), SIGNAL(textChanged()));
4646 connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), SIGNAL(textChanged()));
4747 connect(m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)), SIGNAL(textChanged()));
plugins/Unity/Indicators/rootactionstate.cpp+4−4
@@ -31,7 +31,7 @@ extern "C" {
3131
3232RootActionState::RootActionState(QObject *parent)
3333 : ActionStateParser(parent),
34− m_menu(NULL)
34+ m_menu(nullptr)
3535{
3636}
3737
@@ -95,7 +95,7 @@ void RootActionState::onModelDataChanged(const QModelIndex& topLeft, const QMode
9595void RootActionState::reset()
9696{
9797 m_cachedState.clear();
98− m_menu = NULL;
98+ m_menu = nullptr;
9999
100100 Q_EMIT menuChanged();
101101 Q_EMIT updated();
@@ -171,7 +171,7 @@ static QString iconUri(GIcon *icon)
171171 const gchar* const* iconNames = g_themed_icon_get_names (G_THEMED_ICON (icon));
172172
173173 QStringList iconNameList;
174− for (uint index = 0; iconNames[index] != NULL; index++) {
174+ for (uint index = 0; iconNames[index] != nullptr; index++) {
175175 iconNameList << iconNames[index];
176176 }
177177
@@ -282,7 +282,7 @@ QVariant RootActionState::toQVariant(GVariant* state) const
282282 qmap["accessible-desc"] = accessible_name ? QString::fromUtf8(accessible_name) : "";
283283 qmap["visible"] = visible;
284284
285− gicon = g_icon_new_for_string (icon, NULL);
285+ gicon = g_icon_new_for_string (icon, nullptr);
286286 if (gicon) {
287287 qmap["icons"] = QStringList() << iconUri(gicon);
288288 g_object_unref (gicon);
plugins/Unity/Indicators/unitymenumodelcache.h+1−1
@@ -31,7 +31,7 @@ class UNITYINDICATORS_EXPORT UnityMenuModelCache : public QObject
3131{
3232 Q_OBJECT
3333public:
34− UnityMenuModelCache(QObject*parent=NULL);
34+ UnityMenuModelCache(QObject*parent=nullptr);
3535 ~UnityMenuModelCache();
3636
3737 Q_INVOKABLE UnityMenuModel* model(const QByteArray& bus,
plugins/Unity/Indicators/unitymenumodelstack.cpp+4−4
@@ -90,7 +90,7 @@ UnityMenuModelStack::~UnityMenuModelStack()
9090
9191UnityMenuModel* UnityMenuModelStack::head() const
9292{
93− return !m_menuModels.isEmpty() ? m_menuModels.first()->model() : NULL;
93+ return !m_menuModels.isEmpty() ? m_menuModels.first()->model() : nullptr;
9494}
9595
9696void UnityMenuModelStack::setHead(UnityMenuModel* model)
@@ -106,7 +106,7 @@ void UnityMenuModelStack::setHead(UnityMenuModel* model)
106106
107107UnityMenuModel* UnityMenuModelStack::tail() const
108108{
109− return !m_menuModels.isEmpty() ? m_menuModels.last()->model() : NULL;
109+ return !m_menuModels.isEmpty() ? m_menuModels.last()->model() : nullptr;
110110}
111111
112112int UnityMenuModelStack::count() const
@@ -127,7 +127,7 @@ void UnityMenuModelStack::push(UnityMenuModel* model, int index)
127127UnityMenuModel* UnityMenuModelStack::pop()
128128{
129129 if (m_menuModels.isEmpty()) {
130− return NULL;
130+ return nullptr;
131131 }
132132 UnityMenuModelEntry* entry = m_menuModels.takeLast();
133133 UnityMenuModel* model = entry->model();
@@ -135,7 +135,7 @@ UnityMenuModel* UnityMenuModelStack::pop()
135135
136136 Q_EMIT tailChanged(tail());
137137 if (m_menuModels.isEmpty()) {
138− Q_EMIT headChanged(NULL);
138+ Q_EMIT headChanged(nullptr);
139139 }
140140 Q_EMIT countChanged(m_menuModels.count());
141141
plugins/Unity/Indicators/unitymenumodelstack.h+1−1
@@ -40,7 +40,7 @@ class UNITYINDICATORS_EXPORT UnityMenuModelStack : public QObject
4040 Q_PROPERTY(UnityMenuModel* tail READ tail NOTIFY tailChanged)
4141 Q_PROPERTY(int count READ count NOTIFY countChanged)
4242public:
43− UnityMenuModelStack(QObject*parent=NULL);
43+ UnityMenuModelStack(QObject*parent=nullptr);
4444 ~UnityMenuModelStack();
4545
4646 UnityMenuModel* head() const;
plugins/Utils/qlimitproxymodelqml.cpp+6−6
@@ -42,18 +42,18 @@ void
4242QLimitProxyModelQML::setModel(QAbstractItemModel *itemModel)
4343{
4444 if (itemModel != sourceModel()) {
45− if (sourceModel() != NULL) {
45+ if (sourceModel() != nullptr) {
4646 sourceModel()->disconnect(this);
4747 }
4848
4949 setSourceModel(itemModel);
5050
51− if (sourceModel() != NULL) {
51+ if (sourceModel() != nullptr) {
5252 // Disconnect the QIdentityProxyModel handling for rows removed/added...
53− disconnect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, NULL);
54− disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, NULL);
55− disconnect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, NULL);
56− disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, NULL);
53+ disconnect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, nullptr);
54+ disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, nullptr);
55+ disconnect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, nullptr);
56+ disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, nullptr);
5757
5858 // ... and use our own
5959 connect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
plugins/Utils/qsortfilterproxymodelqml.cpp+7−7
@@ -34,7 +34,7 @@ QSortFilterProxyModelQML::QSortFilterProxyModelQML(QObject *parent)
3434 */
3535int QSortFilterProxyModelQML::mapRowToSource(int row)
3636{
37− if (sourceModel() == NULL)
37+ if (sourceModel() == nullptr)
3838 return -1;
3939
4040 return QSortFilterProxyModel::mapToSource(index(row, 0)).row();
@@ -48,12 +48,12 @@ QHash<int, QByteArray> QSortFilterProxyModelQML::roleNames() const
4848void
4949QSortFilterProxyModelQML::setModel(QAbstractItemModel *itemModel)
5050{
51− if (itemModel == NULL) {
51+ if (itemModel == nullptr) {
5252 return;
5353 }
5454
5555 if (itemModel != sourceModel()) {
56− if (sourceModel() != NULL) {
56+ if (sourceModel() != nullptr) {
5757 sourceModel()->disconnect(this);
5858 }
5959
@@ -83,7 +83,7 @@ QSortFilterProxyModelQML::get(int row)
8383QVariant
8484QSortFilterProxyModelQML::data(int row, int role)
8585{
86− if (sourceModel() == NULL) {
86+ if (sourceModel() == nullptr) {
8787 return QVariant();
8888 }
8989
@@ -93,7 +93,7 @@ QSortFilterProxyModelQML::data(int row, int role)
9393int
9494QSortFilterProxyModelQML::totalCount() const
9595{
96− if (sourceModel() != NULL) {
96+ if (sourceModel() != nullptr) {
9797 return sourceModel()->rowCount();
9898 } else {
9999 return 0;
@@ -149,7 +149,7 @@ QSortFilterProxyModelQML::findFirst(int role, const QVariant& value) const
149149int
150150QSortFilterProxyModelQML::mapFromSource(int row)
151151{
152− if (sourceModel() != NULL) {
152+ if (sourceModel() != nullptr) {
153153 return QSortFilterProxyModel::mapFromSource(sourceModel()->index(row, 0)).row();
154154 } else {
155155 return -1;
@@ -159,7 +159,7 @@ QSortFilterProxyModelQML::mapFromSource(int row)
159159int
160160QSortFilterProxyModelQML::mapToSource(int row)
161161{
162− if (sourceModel() != NULL) {
162+ if (sourceModel() != nullptr) {
163163 return QSortFilterProxyModel::mapToSource(index(row, 0)).row();
164164 } else {
165165 return -1;
plugins/Utils/timeformatter.cpp+8−8
@@ -57,9 +57,9 @@ timedate1_properties_changed (GDBusConnection *connection,
5757 if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(sa{sv}as)")))
5858 return;
5959
60− g_variant_get (parameters, "(s@a{sv}as)", NULL, &changed, &iter);
60+ g_variant_get (parameters, "(s@a{sv}as)", nullptr, &changed, &iter);
6161
62− if (g_variant_lookup (changed, "Timezone", "s", NULL)) {
62+ if (g_variant_lookup (changed, "Timezone", "s", nullptr)) {
6363 priv->formatter->update();
6464 }
6565 else {
@@ -81,10 +81,10 @@ got_bus(GObject *object, GAsyncResult *result, gpointer user_data)
8181 Q_UNUSED(object);
8282
8383 TimeFormatterPrivate *priv = (TimeFormatterPrivate *)user_data;
84− GError *error = NULL;
84+ GError *error = nullptr;
8585
8686 priv->system_bus = g_bus_get_finish (result, &error);
87− if (priv->system_bus == NULL) {
87+ if (priv->system_bus == nullptr) {
8888 if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
8989 qWarning("TimeFormatter: cannot connect to the system bus: %s", error->message);
9090 g_error_free (error);
@@ -98,14 +98,14 @@ got_bus(GObject *object, GAsyncResult *result, gpointer user_data)
9898 * and keep the process alive.
9999 */
100100 priv->subscription_id = g_dbus_connection_signal_subscribe (priv->system_bus,
101− NULL, /* sender */
101+ nullptr, /* sender */
102102 "org.freedesktop.DBus.Properties",
103103 "PropertiesChanged",
104− NULL,
104+ nullptr,
105105 "org.freedesktop.timedate1",
106106 G_DBUS_SIGNAL_FLAGS_NONE,
107107 timedate1_properties_changed,
108− priv, NULL);
108+ priv, nullptr);
109109}
110110
111111TimeFormatter::TimeFormatter(QObject *parent): QObject(parent)
@@ -114,7 +114,7 @@ TimeFormatter::TimeFormatter(QObject *parent): QObject(parent)
114114 priv->formatter = this;
115115 priv->time = 0;
116116 priv->format = "yyyy-MM-dd hh:mm";
117− priv->system_bus = NULL;
117+ priv->system_bus = nullptr;
118118 priv->subscription_id = 0;
119119 priv->cancellable = g_cancellable_new ();
120120
tests/mocks/GSettings.1.0/fake_gsettings.h+2−2
@@ -27,7 +27,7 @@ class GSettingsSchemaQml: public QObject
2727 Q_PROPERTY(QByteArray id READ id WRITE setId)
2828
2929public:
30− GSettingsSchemaQml(QObject *parent = NULL);
30+ GSettingsSchemaQml(QObject *parent = nullptr);
3131
3232 QByteArray id() const;
3333 void setId(const QByteArray &id);
@@ -48,7 +48,7 @@ class GSettingsQml: public QObject
4848 Q_PROPERTY(QString pictureUri READ pictureUri WRITE setPictureUri NOTIFY pictureUriChanged)
4949
5050public:
51− GSettingsQml(QObject *parent = NULL);
51+ GSettingsQml(QObject *parent = nullptr);
5252 ~GSettingsQml();
5353
5454 GSettingsSchemaQml * schema() const;
tests/mocks/HudClient/fake_libhud_client.cpp+9−9
@@ -48,7 +48,7 @@ static void hud_client_query_class_init(HudClientQueryClass * /*klass*/)
4848 HUD_CLIENT_TYPE_QUERY,
4949 G_SIGNAL_RUN_LAST,
5050 0, /* offset */
51− NULL, NULL, /* Accumulator */
51+ nullptr, nullptr, /* Accumulator */
5252 g_cclosure_marshal_VOID__VOID,
5353 G_TYPE_NONE, 0, G_TYPE_NONE);
5454}
@@ -56,7 +56,7 @@ static void hud_client_query_class_init(HudClientQueryClass * /*klass*/)
5656HudClientQuery *hud_client_query_new(const gchar *query)
5757{
5858 HudClientStub::m_lastSetQuery = QString::fromUtf8(query);
59− HudClientStub::m_query = HUD_CLIENT_QUERY(g_object_new(HUD_CLIENT_TYPE_QUERY, NULL));
59+ HudClientStub::m_query = HUD_CLIENT_QUERY(g_object_new(HUD_CLIENT_TYPE_QUERY, nullptr));
6060 return HudClientStub::m_query;
6161}
6262
@@ -70,13 +70,13 @@ DeeModel *hud_client_query_get_results_model(HudClientQuery *cquery)
7070 GVariant * columns[G_N_ELEMENTS(results_model_schema) + 1];
7171 columns[0] = g_variant_new_variant(g_variant_new_uint64(0));
7272 columns[1] = g_variant_new_string("Help");
73− columns[2] = g_variant_new_array(G_VARIANT_TYPE("(ii)"), NULL, 0);
73+ columns[2] = g_variant_new_array(G_VARIANT_TYPE("(ii)"), nullptr, 0);
7474 columns[3] = g_variant_new_string("Get Help");
75− columns[4] = g_variant_new_array(G_VARIANT_TYPE("(ii)"), NULL, 0);
75+ columns[4] = g_variant_new_array(G_VARIANT_TYPE("(ii)"), nullptr, 0);
7676 columns[5] = g_variant_new_string("");
7777 columns[6] = g_variant_new_uint32(3);
7878 columns[7] = g_variant_new_boolean(false);
79− columns[8] = NULL;
79+ columns[8] = nullptr;
8080 dee_model_append_row(resultsModel, columns);
8181
8282 columns[0] = g_variant_new_variant(g_variant_new_uint64(1));
@@ -153,13 +153,13 @@ HudClientParam *hud_client_query_execute_param_command(HudClientQuery *cquery, G
153153 HudClientStub::m_lastExecutedParametrizedCommandRow = i;
154154 g_variant_unref(it_command);
155155 // No need to create a real HudClientParam since it's always passed down to us
156− return (HudClientParam *)g_object_new(G_TYPE_OBJECT, NULL);
156+ return (HudClientParam *)g_object_new(G_TYPE_OBJECT, nullptr);
157157 }
158158 g_variant_unref(it_command);
159159 }
160160 }
161161 HudClientStub::m_lastExecutedParametrizedCommandRow = -1;
162− return NULL;
162+ return nullptr;
163163}
164164
165165void hud_client_query_voice_query(HudClientQuery *cquery)
@@ -183,7 +183,7 @@ GMenuModel *hud_client_param_get_model(HudClientParam *param)
183183
184184 if (!parametrizedActionModel) {
185185 GMenu *menu = g_menu_new();
186− GMenuItem *item = g_menu_item_new("Item1Label", NULL);
186+ GMenuItem *item = g_menu_item_new("Item1Label", nullptr);
187187 g_menu_item_set_attribute_value(item, "parameter-type", g_variant_new_string("slider"));
188188 g_menu_item_set_attribute_value(item, "min", g_variant_new_double(10));
189189 g_menu_item_set_attribute_value(item, "max", g_variant_new_double(80));
@@ -220,7 +220,7 @@ GActionGroup *hud_client_param_get_actions(HudClientParam *param)
220220 GSimpleAction *action = g_simple_action_new("costAction", G_VARIANT_TYPE_DOUBLE);
221221 g_simple_action_group_insert(actionGroup, G_ACTION(action));
222222
223− g_signal_connect (action, "activate", G_CALLBACK (on_signal_activated), NULL);
223+ g_signal_connect (action, "activate", G_CALLBACK (on_signal_activated), nullptr);
224224
225225
226226 parametrizedActionGroup = G_ACTION_GROUP(actionGroup);
tests/mocks/LightDM/demo/GreeterPrivate.cpp+5−5
@@ -46,7 +46,7 @@ public:
4646 : QObject(parent),
4747 greeter(parent),
4848 greeterPrivate(greeterPrivate),
49− pamHandle(NULL)
49+ pamHandle(nullptr)
5050 {
5151 qRegisterMetaType<QLightDM::GreeterImpl::ResponseFuture>("QLightDM::GreeterImpl::ResponseFuture");
5252
@@ -206,14 +206,14 @@ Q_SIGNALS:
206206private Q_SLOTS:
207207 void finishPam()
208208 {
209− if (pamHandle == NULL) {
209+ if (pamHandle == nullptr) {
210210 return;
211211 }
212212
213213 int pamStatus = futureWatcher.result();
214214
215215 pam_end(pamHandle, pamStatus);
216− pamHandle = NULL;
216+ pamHandle = nullptr;
217217
218218 greeterPrivate->authenticated = (pamStatus == PAM_SUCCESS);
219219 Q_EMIT greeter->authenticationComplete();
@@ -243,9 +243,9 @@ private:
243243 void cancelPam()
244244 {
245245 // Unfortunately we can't simply cancel our QFuture because QtConcurrent::run doesn't support cancel
246− if (pamHandle != NULL) {
246+ if (pamHandle != nullptr) {
247247 pam_handle *handle = pamHandle;
248− pamHandle = NULL; // to disable normal finishPam() handling
248+ pamHandle = nullptr; // to disable normal finishPam() handling
249249 while (respond(QString())); // clear our local queue of QFutures
250250 pam_end(handle, PAM_CONV_ERR);
251251 }
tests/mocks/QMenuModel/unitymenumodel.cpp+4−4
@@ -118,7 +118,7 @@ void UnityMenuModel::setMenuObjectPath(const QByteArray &path)
118118
119119ActionStateParser* UnityMenuModel::actionStateParser() const
120120{
121− return NULL;
121+ return nullptr;
122122}
123123
124124void UnityMenuModel::setActionStateParser(ActionStateParser*)
@@ -190,11 +190,11 @@ QHash<int, QByteArray> UnityMenuModel::roleNames() const
190190QObject * UnityMenuModel::submenu(int position, QQmlComponent*)
191191{
192192 if (position < 0 || m_modelData.count() < position) {
193− return NULL;
193+ return nullptr;
194194 }
195195
196196 while (submenus.count() <= position) {
197− submenus.append(NULL);
197+ submenus.append(nullptr);
198198 }
199199
200200 QVariant submenuData = subMenuData(position);
@@ -209,7 +209,7 @@ QObject * UnityMenuModel::submenu(int position, QQmlComponent*)
209209 return model;
210210 }
211211
212− return NULL;
212+ return nullptr;
213213}
214214
215215bool UnityMenuModel::loadExtendedAttributes(int, const QVariantMap &)
tests/mocks/QMenuModel/unitymenumodel.h+2−2
@@ -35,7 +35,7 @@ class Q_DECL_EXPORT UnityMenuModel : public QAbstractListModel
3535 Q_PROPERTY(QString nameOwner READ nameOwner NOTIFY nameOwnerChanged)
3636
3737public:
38− UnityMenuModel(QObject *parent = NULL);
38+ UnityMenuModel(QObject *parent = nullptr);
3939 virtual ~UnityMenuModel();
4040
4141 Q_INVOKABLE void insertRow(int row, const QVariant& data);
@@ -66,7 +66,7 @@ public:
6666 QModelIndex parent(const QModelIndex &index) const;
6767 QHash<int, QByteArray> roleNames() const;
6868
69− Q_INVOKABLE QObject * submenu(int position, QQmlComponent* actionStateParser = NULL);
69+ Q_INVOKABLE QObject * submenu(int position, QQmlComponent* actionStateParser = nullptr);
7070 Q_INVOKABLE bool loadExtendedAttributes(int position, const QVariantMap &schema);
7171 Q_INVOKABLE QVariant get(int row, const QByteArray &role);
7272
tests/mocks/QtMultimedia/audio.cpp+1−1
@@ -22,7 +22,7 @@ Audio::Audio(QObject* parent):
2222 QObject(parent),
2323 m_playbackState(StoppedState)
2424{
25− qsrand(time(NULL));
25+ qsrand(time(nullptr));
2626 m_timer.setInterval(1000);
2727 connect(&m_timer, SIGNAL(timeout()), SLOT(timerEvent()));
2828}
tests/mocks/Unity/Application/ApplicationDBusAdaptor.cpp+1−1
@@ -33,7 +33,7 @@ MirSurfaceItem* topSurface(MirSurfaceItem* surface)
3333 if (!surface)
3434 return nullptr;
3535
36− MirSurfaceItem* child = NULL;
36+ MirSurfaceItem* child = nullptr;
3737 Q_FOREACH (MirSurfaceItem *childSurface, surface->childSurfaceList()) {
3838 child = topSurface(childSurface);
3939 if (child) {
tests/mocks/Unity/Application/ApplicationInfo.h+2−2
@@ -41,8 +41,8 @@ class ApplicationInfo : public ApplicationInfoInterface {
4141 Q_PROPERTY(bool manualSurfaceCreation READ manualSurfaceCreation WRITE setManualSurfaceCreation NOTIFY manualSurfaceCreationChanged)
4242
4343public:
44− ApplicationInfo(QObject *parent = NULL);
45− ApplicationInfo(const QString &appId, QObject *parent = NULL);
44+ ApplicationInfo(QObject *parent = nullptr);
45+ ApplicationInfo(const QString &appId, QObject *parent = nullptr);
4646 ~ApplicationInfo();
4747
4848 void setIconId(const QString &iconId);
tests/mocks/Unity/Application/ApplicationManager.h+1−1
@@ -46,7 +46,7 @@ class ApplicationManager : public ApplicationManagerInterface {
4646 Q_PROPERTY(bool fake READ fake CONSTANT)
4747
4848 public:
49− ApplicationManager(QObject *parent = NULL);
49+ ApplicationManager(QObject *parent = nullptr);
5050 virtual ~ApplicationManager();
5151
5252 static ApplicationManager *singleton();
tests/plugins/Unity/Indicators/rootactionstatetest.cpp+4−4
@@ -50,7 +50,7 @@ private Q_SLOTS:
5050
5151 QCOMPARE(rootState->menu(), menuModel);
5252 delete menuModel;
53− QVERIFY(rootState->menu() == NULL);
53+ QVERIFY(rootState->menu() == nullptr);
5454 delete rootState;
5555 }
5656
@@ -60,8 +60,8 @@ private Q_SLOTS:
6060 g_variant_builder_init(&builderIcons, G_VARIANT_TYPE("av"));
6161 for (int i = 0; i < 3; i ++) {
6262
63− GIcon* icon = NULL;
64− icon = g_icon_new_for_string (QString("testIcon%1").arg(i).toUtf8().constData(), NULL);
63+ GIcon* icon = nullptr;
64+ icon = g_icon_new_for_string (QString("testIcon%1").arg(i).toUtf8().constData(), nullptr);
6565
6666 g_variant_builder_add(&builderIcons,
6767 "v",
@@ -73,7 +73,7 @@ private Q_SLOTS:
7373 g_variant_builder_init(&builderParams, G_VARIANT_TYPE_ARRAY);
7474 GVariant* icons = g_variant_builder_end (&builderIcons);
7575 g_variant_ref_sink (icons);
76− g_variant_builder_add (&builderParams, "{sv}", g_strdup ("icons"), icons, NULL);
76+ g_variant_builder_add (&builderParams, "{sv}", g_strdup ("icons"), icons, nullptr);
7777
7878 GVariant* params = g_variant_builder_end (&builderParams);
7979
tests/plugins/Unity/Indicators/unitymenumodelstacktest.cpp+1−1
@@ -42,7 +42,7 @@ private Q_SLOTS:
4242 void cleanup()
4343 {
4444 delete m_model;
45− m_model = NULL;
45+ m_model = nullptr;
4646 }
4747
4848 void testHeadOnSetHead()
tests/uqmlscene/main.cpp+1−1
@@ -495,7 +495,7 @@ int main(int argc, char ** argv)
495495 if (!window) {
496496 QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel);
497497 if (contentItem) {
498− qxView = new QQuickView(&engine, NULL);
498+ qxView = new QQuickView(&engine, nullptr);
499499 window = qxView;
500500 // Set window default properties; the qml can still override them
501501 QString oname = contentItem->objectName();