on xenial help sign in
Move connect() to new syntax
479eddcAlbert Astals Cid
plugins/Dash/abstractdashview.cpp+5−5
@@ -28,8 +28,8 @@ AbstractDashView::AbstractDashView()
28 , m_delegateValidated(false)
28 , m_delegateValidated(false)
29 , m_implicitHeightDirty(false)
29 , m_implicitHeightDirty(false)
30{
30{
31− connect(this, SIGNAL(widthChanged()), this, SLOT(relayout()));
31+ connect(this, &AbstractDashView::widthChanged, this, &AbstractDashView::relayout);
32− connect(this, SIGNAL(heightChanged()), this, SLOT(onHeightChanged()));
32+ connect(this, &AbstractDashView::heightChanged, this, &AbstractDashView::onHeightChanged);
33}
33}
34
34
35QAbstractItemModel *AbstractDashView::model() const
35QAbstractItemModel *AbstractDashView::model() const
@@ -43,10 +43,10 @@ void AbstractDashView::setModel(QAbstractItemModel *model)
43 if (!m_delegateModel) {
43 if (!m_delegateModel) {
44 createDelegateModel();
44 createDelegateModel();
45 } else {
45 } else {
46− disconnect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
46+ disconnect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &AbstractDashView::onModelUpdated);
47 }
47 }
48 m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
48 m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
49− connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
49+ connect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &AbstractDashView::onModelUpdated);
50
50
51 cleanupExistingItems();
51 cleanupExistingItems();
52
52
@@ -167,7 +167,7 @@ void AbstractDashView::setDisplayMarginEnd(qreal end)
167void AbstractDashView::createDelegateModel()
167void AbstractDashView::createDelegateModel()
168{
168{
169 m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
169 m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
170− connect(m_delegateModel, SIGNAL(createdItem(int,QObject*)), this, SLOT(itemCreated(int,QObject*)));
170+ connect(m_delegateModel, &QQmlDelegateModel::createdItem, this, &AbstractDashView::itemCreated);
171 if (isComponentComplete())
171 if (isComponentComplete())
172 m_delegateModel->componentComplete();
172 m_delegateModel->componentComplete();
173}
173}
plugins/Dash/listviewwithpageheader.cpp+8−8
@@ -168,10 +168,10 @@ ListViewWithPageHeader::ListViewWithPageHeader()
168 m_contentYAnimation->setDuration(200);
168 m_contentYAnimation->setDuration(200);
169 m_contentYAnimation->setTargetObject(this);
169 m_contentYAnimation->setTargetObject(this);
170
170
171− connect(this, SIGNAL(contentWidthChanged()), this, SLOT(onContentWidthChanged()));
171+ connect(this, &ListViewWithPageHeader::contentWidthChanged, this, &ListViewWithPageHeader::onContentWidthChanged);
172− connect(this, SIGNAL(contentHeightChanged()), this, SLOT(onContentHeightChanged()));
172+ connect(this, &ListViewWithPageHeader::contentHeightChanged, this, &ListViewWithPageHeader::onContentHeightChanged);
173− connect(this, SIGNAL(heightChanged()), this, SLOT(onHeightChanged()));
173+ connect(this, &ListViewWithPageHeader::heightChanged, this, &ListViewWithPageHeader::onHeightChanged);
174− connect(m_contentYAnimation, SIGNAL(runningChanged(bool)), this, SLOT(contentYAnimationRunningChanged(bool)));
174+ connect(m_contentYAnimation, &QQuickNumberAnimation::runningChanged, this, &ListViewWithPageHeader::contentYAnimationRunningChanged);
175
175
176 setFlickableDirection(VerticalFlick);
176 setFlickableDirection(VerticalFlick);
177}
177}
@@ -191,10 +191,10 @@ void ListViewWithPageHeader::setModel(QAbstractItemModel *model)
191 if (!m_delegateModel) {
191 if (!m_delegateModel) {
192 createDelegateModel();
192 createDelegateModel();
193 } else {
193 } else {
194− disconnect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
194+ disconnect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &ListViewWithPageHeader::onModelUpdated);
195 }
195 }
196 m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
196 m_delegateModel->setModel(QVariant::fromValue<QAbstractItemModel *>(model));
197− connect(m_delegateModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)), this, SLOT(onModelUpdated(QQmlChangeSet,bool)));
197+ connect(m_delegateModel, &QQmlDelegateModel::modelUpdated, this, &ListViewWithPageHeader::onModelUpdated);
198 Q_EMIT modelChanged();
198 Q_EMIT modelChanged();
199 polish();
199 polish();
200 // TODO?
200 // TODO?
@@ -283,7 +283,7 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
283 m_topSectionItem = getSectionItem(QString());
283 m_topSectionItem = getSectionItem(QString());
284 m_topSectionItem->setZ(3);
284 m_topSectionItem->setZ(3);
285 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
285 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
286− connect(m_topSectionItem, SIGNAL(heightChanged()), SIGNAL(stickyHeaderHeightChanged()));
286+ connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
287
287
288 // TODO create sections for existing items
288 // TODO create sections for existing items
289
289
@@ -605,7 +605,7 @@ void ListViewWithPageHeader::adjustHeader(qreal diff)
605void ListViewWithPageHeader::createDelegateModel()
605void ListViewWithPageHeader::createDelegateModel()
606{
606{
607 m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
607 m_delegateModel = new QQmlDelegateModel(qmlContext(this), this);
608− connect(m_delegateModel, SIGNAL(createdItem(int,QObject*)), this, SLOT(itemCreated(int,QObject*)));
608+ connect(m_delegateModel, &QQmlDelegateModel::createdItem, this, &ListViewWithPageHeader::itemCreated);
609 if (isComponentComplete())
609 if (isComponentComplete())
610 m_delegateModel->componentComplete();
610 m_delegateModel->componentComplete();
611 updateWatchedRoles();
611 updateWatchedRoles();
plugins/LightDM/DBusGreeter.cpp+1−1
@@ -24,7 +24,7 @@ DBusGreeter::DBusGreeter(Greeter *greeter, const QString &path)
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
25 m_greeter(greeter)
25 m_greeter(greeter)
26{
26{
27− connect(m_greeter, SIGNAL(isActiveChanged()), this, SLOT(isActiveChangedHandler()));
27+ connect(m_greeter, &Greeter::isActiveChanged, this, &DBusGreeter::isActiveChangedHandler);
28}
28}
29
29
30bool DBusGreeter::isActive() const
30bool DBusGreeter::isActive() const
plugins/LightDM/DBusGreeterList.cpp+2−2
@@ -24,8 +24,8 @@ DBusGreeterList::DBusGreeterList(Greeter *greeter, const QString &path)
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
24 : UnityDBusObject(path, "com.canonical.UnityGreeter", true, greeter),
25 m_greeter(greeter)
25 m_greeter(greeter)
26{
26{
27− connect(m_greeter, SIGNAL(authenticationUserChanged(const QString &)), this, SLOT(authenticationUserChangedHandler(const QString &)));
27+ connect(m_greeter, &Greeter::authenticationUserChanged, this, &DBusGreeterList::authenticationUserChangedHandler);
28− connect(m_greeter, SIGNAL(promptlessChanged()), this, SLOT(promptlessChangedHandler()));
28+ connect(m_greeter, &Greeter::promptlessChanged, this, &DBusGreeterList::promptlessChangedHandler);
29}
29}
30
30
31QString DBusGreeterList::GetActiveEntry() const
31QString DBusGreeterList::GetActiveEntry() const
plugins/LightDM/Greeter.cpp+6−6
@@ -35,12 +35,12 @@ Greeter::Greeter(QObject* parent)
35{
35{
36 Q_D(Greeter);
36 Q_D(Greeter);
37
37
38− connect(d->m_greeter, SIGNAL(showMessage(QString, QLightDM::Greeter::MessageType)),
38+ connect(d->m_greeter, &QLightDM::Greeter::showMessage,
39− this, SLOT(showMessageFilter(QString, QLightDM::Greeter::MessageType)));
39+ this, &Greeter::showMessageFilter);
40− connect(d->m_greeter, SIGNAL(showPrompt(QString, QLightDM::Greeter::PromptType)),
40+ connect(d->m_greeter, &QLightDM::Greeter::showPrompt,
41− this, SLOT(showPromptFilter(QString, QLightDM::Greeter::PromptType)));
41+ this, &Greeter::showPromptFilter);
42− connect(d->m_greeter, SIGNAL(authenticationComplete()),
42+ connect(d->m_greeter, &QLightDM::Greeter::authenticationComplete,
43− this, SLOT(authenticationCompleteFilter()));
43+ this, &Greeter::authenticationCompleteFilter);
44
44
45 d->m_greeter->connectSync();
45 d->m_greeter->connectSync();
46}
46}
plugins/LightDM/liblightdm/GreeterPrivate.cpp+2−2
@@ -50,8 +50,8 @@ public:
50 {
50 {
51 qRegisterMetaType<QLightDM::GreeterImpl::ResponseFuture>("QLightDM::GreeterImpl::ResponseFuture");
51 qRegisterMetaType<QLightDM::GreeterImpl::ResponseFuture>("QLightDM::GreeterImpl::ResponseFuture");
52
52
53− connect(&futureWatcher, SIGNAL(finished()),
53+ connect(&futureWatcher, &QFutureWatcher<int>::finished,
54− this, SLOT(finishPam()));
54+ this, &GreeterImpl::finishPam);
55 connect(this, SIGNAL(showMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)),
55 connect(this, SIGNAL(showMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)),
56 this, SLOT(handleMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)));
56 this, SLOT(handleMessage(pam_handle *, QString, QLightDM::Greeter::MessageType)));
57 // This next connect is how we pass ResponseFutures between threads
57 // This next connect is how we pass ResponseFutures between threads
plugins/Ubuntu/DownloadDaemonListener/DownloadTracker.cpp+7−7
@@ -71,13 +71,13 @@ void DownloadTracker::startService()
71 if(!m_service.isEmpty() && !m_dbusPath.isEmpty()) {
71 if(!m_service.isEmpty() && !m_dbusPath.isEmpty()) {
72 m_adaptor = new DownloadTrackerAdaptor(m_service, m_dbusPath, QDBusConnection::sessionBus(), this);
72 m_adaptor = new DownloadTrackerAdaptor(m_service, m_dbusPath, QDBusConnection::sessionBus(), this);
73
73
74− connect(m_adaptor, SIGNAL(canceled(bool)), this, SIGNAL(canceled(bool)));
74+ connect(m_adaptor, &DownloadTrackerAdaptor::canceled, this, &DownloadTracker::canceled);
75− connect(m_adaptor, SIGNAL(error(const QString &)), this, SIGNAL(error(const QString &)));
75+ connect(m_adaptor, &DownloadTrackerAdaptor::error, this, &DownloadTracker::error);
76− connect(m_adaptor, SIGNAL(finished(const QString &)), this, SIGNAL(finished(const QString &)));
76+ connect(m_adaptor, &DownloadTrackerAdaptor::finished, this, &DownloadTracker::finished);
77− connect(m_adaptor, SIGNAL(paused(bool)), this, SIGNAL(paused(bool)));
77+ connect(m_adaptor, &DownloadTrackerAdaptor::paused, this, &DownloadTracker::paused);
78− connect(m_adaptor, SIGNAL(progress(qulonglong, qulonglong)), this, SIGNAL(progress(qulonglong, qulonglong)));
78+ connect(m_adaptor, static_cast<void (DownloadTrackerAdaptor::*)(qulonglong, qulonglong)>(&DownloadTrackerAdaptor::progress), this, &DownloadTracker::progress);
79− connect(m_adaptor, SIGNAL(resumed(bool)), this, SIGNAL(resumed(bool)));
79+ connect(m_adaptor, &DownloadTrackerAdaptor::resumed, this, &DownloadTracker::resumed);
80− connect(m_adaptor, SIGNAL(started(bool)), this, SIGNAL(started(bool)));
80+ connect(m_adaptor, &DownloadTrackerAdaptor::started, this, &DownloadTracker::started);
81 }
81 }
82 // FIXME find a better way of determining if the service is ready
82 // FIXME find a better way of determining if the service is ready
83 Q_EMIT serviceReadyChanged(m_adaptor && m_adaptor->isValid());
83 Q_EMIT serviceReadyChanged(m_adaptor && m_adaptor->isValid());
plugins/Unity/Indicators/indicatorsmanager.cpp+3−3
@@ -75,8 +75,8 @@ void IndicatorsManager::load()
75 }
75 }
76 }
76 }
77
77
78− QObject::connect(m_fsWatcher.data(), SIGNAL(directoryChanged(const QString&)), this, SLOT(onDirectoryChanged(const QString&)));
78+ QObject::connect(m_fsWatcher.data(), &QFileSystemWatcher::directoryChanged, this, &IndicatorsManager::onDirectoryChanged);
79− QObject::connect(m_fsWatcher.data(), SIGNAL(fileChanged(const QString&)), this, SLOT(onFileChanged(const QString&)));
79+ QObject::connect(m_fsWatcher.data(), &QFileSystemWatcher::fileChanged, this, &IndicatorsManager::onFileChanged);
80 setLoaded(true);
80 setLoaded(true);
81}
81}
82
82
@@ -282,7 +282,7 @@ Indicator::Ptr IndicatorsManager::indicator(const QString& indicator_name)
282 QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this);
282 QSettings settings(data->m_fileInfo.absoluteFilePath(), QSettings::IniFormat, this);
283 new_indicator->init(data->m_fileInfo.fileName(), settings);
283 new_indicator->init(data->m_fileInfo.fileName(), settings);
284 new_indicator->setProfile(m_profile);
284 new_indicator->setProfile(m_profile);
285− QObject::connect(this, SIGNAL(profileChanged(const QString&)), new_indicator.data(), SLOT(setProfile(const QString&)));
285+ QObject::connect(this, &IndicatorsManager::profileChanged, new_indicator.data(), &Indicator::setProfile);
286 return new_indicator;
286 return new_indicator;
287}
287}
288
288
plugins/Unity/Indicators/indicatorsmodel.cpp+8−8
@@ -54,13 +54,13 @@ IndicatorsModel::IndicatorsModel(QObject *parent)
54 : QAbstractListModel(parent)
54 : QAbstractListModel(parent)
55{
55{
56 m_manager = new IndicatorsManager(this);
56 m_manager = new IndicatorsManager(this);
57− QObject::connect(m_manager, SIGNAL(indicatorLoaded(const QString&)), this, SLOT(onIndicatorLoaded(const QString&)));
57+ QObject::connect(m_manager, &IndicatorsManager::indicatorLoaded, this, &IndicatorsModel::onIndicatorLoaded);
58− QObject::connect(m_manager, SIGNAL(indicatorAboutToBeUnloaded(const QString&)), this, SLOT(onIndicatorAboutToBeUnloaded(const QString&)));
58+ QObject::connect(m_manager, &IndicatorsManager::indicatorAboutToBeUnloaded, this, &IndicatorsModel::onIndicatorAboutToBeUnloaded);
59− QObject::connect(m_manager, SIGNAL(profileChanged(const QString&)), this, SIGNAL(profileChanged()));
59+ QObject::connect(m_manager, &IndicatorsManager::profileChanged, this, &IndicatorsModel::profileChanged);
60
60
61− QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
61+ QObject::connect(this, &IndicatorsModel::rowsInserted, this, &IndicatorsModel::countChanged);
62− QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
62+ QObject::connect(this, &IndicatorsModel::rowsRemoved, this, &IndicatorsModel::countChanged);
63− QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
63+ QObject::connect(this, &IndicatorsModel::modelReset, this, &IndicatorsModel::countChanged);
64}
64}
65
65
66/*! \internal */
66/*! \internal */
@@ -148,8 +148,8 @@ void IndicatorsModel::onIndicatorLoaded(const QString& indicator_name)
148 pos++;
148 pos++;
149 }
149 }
150
150
151− QObject::connect(indicator.data(), SIGNAL(identifierChanged(const QString&)), this, SLOT(onIdentifierChanged()));
151+ QObject::connect(indicator.data(), &Indicator::identifierChanged, this, &IndicatorsModel::onIdentifierChanged);
152− QObject::connect(indicator.data(), SIGNAL(indicatorPropertiesChanged(const QVariant&)), this, SLOT(onIndicatorPropertiesChanged()));
152+ QObject::connect(indicator.data(), &Indicator::indicatorPropertiesChanged, this, &IndicatorsModel::onIndicatorPropertiesChanged);
153
153
154 beginInsertRows(QModelIndex(), pos, pos);
154 beginInsertRows(QModelIndex(), pos, pos);
155
155
plugins/Unity/Indicators/modelactionrootstate.cpp+4−4
@@ -55,11 +55,11 @@ void ModelActionRootState::setMenu(UnityMenuModel* menu)
55 m_menu = menu;
55 m_menu = menu;
56
56
57 if (m_menu) {
57 if (m_menu) {
58− connect(m_menu, SIGNAL(rowsInserted(const QModelIndex&, int, int)), SLOT(onModelRowsAdded(const QModelIndex&, int, int)));
58+ connect(m_menu, &UnityMenuModel::rowsInserted, this, &ModelActionRootState::onModelRowsAdded);
59− connect(m_menu, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), SLOT(onModelRowsRemoved(const QModelIndex&, int, int)));
59+ connect(m_menu, &UnityMenuModel::rowsRemoved, this, &ModelActionRootState::onModelRowsRemoved);
60− connect(m_menu, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)), SLOT(onModelDataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)));
60+ connect(m_menu, &UnityMenuModel::dataChanged, this, &ModelActionRootState::onModelDataChanged);
61
61
62− connect(m_menu, SIGNAL(destroyed()), SLOT(reset()));
62+ connect(m_menu, &UnityMenuModel::destroyed, this, &ModelActionRootState::reset);
63 }
63 }
64 updateActionState();
64 updateActionState();
65 Q_EMIT menuChanged();
65 Q_EMIT menuChanged();
plugins/Unity/Indicators/modelprinter.cpp+6−6
@@ -42,9 +42,9 @@ void ModelPrinter::setSourceModel(UnityMenuModel * sourceModel)
42 Q_EMIT textChanged();
42 Q_EMIT textChanged();
43 }
43 }
44 if (m_model != nullptr) {
44 if (m_model != nullptr) {
45− connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)), SIGNAL(textChanged()));
45+ connect(m_model, &UnityMenuModel::rowsInserted, this, &ModelPrinter::textChanged);
46− connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), SIGNAL(textChanged()));
46+ connect(m_model, &UnityMenuModel::rowsRemoved, this, &ModelPrinter::textChanged);
47− connect(m_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)), SIGNAL(textChanged()));
47+ connect(m_model, &UnityMenuModel::dataChanged, this, &ModelPrinter::textChanged);
48 }
48 }
49}
49}
50
50
@@ -83,9 +83,9 @@ QString ModelPrinter::getModelDataString(UnityMenuModel* sourceModel, int level)
83
83
84 if (!m_children.contains(childMenuModel)) {
84 if (!m_children.contains(childMenuModel)) {
85 m_children << childMenuModel;
85 m_children << childMenuModel;
86− connect(childMenuModel, SIGNAL(rowsInserted(QModelIndex,int,int)), SIGNAL(textChanged()));
86+ connect(childMenuModel, &UnityMenuModel::rowsInserted, this, &ModelPrinter::textChanged);
87− connect(childMenuModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), SIGNAL(textChanged()));
87+ connect(childMenuModel, &UnityMenuModel::rowsRemoved, this, &ModelPrinter::textChanged);
88− connect(childMenuModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)), SIGNAL(textChanged()));
88+ connect(childMenuModel, &UnityMenuModel::dataChanged, this, &ModelPrinter::textChanged);
89 }
89 }
90 stream << getModelDataString(childMenuModel, level+1);
90 stream << getModelDataString(childMenuModel, level+1);
91 }
91 }
plugins/Unity/Indicators/unitymenumodelstack.cpp+4−4
@@ -31,9 +31,9 @@ public:
31 m_index(index)
31 m_index(index)
32 {
32 {
33 if (m_parentModel) {
33 if (m_parentModel) {
34− QObject::connect(m_parentModel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(onRowsInserted(QModelIndex, int, int)));
34+ QObject::connect(m_parentModel, &UnityMenuModel::rowsInserted, this, &UnityMenuModelEntry::onRowsInserted);
35− QObject::connect(m_parentModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(onRowsRemoved(QModelIndex, int, int)));
35+ QObject::connect(m_parentModel, &UnityMenuModel::rowsRemoved, this, &UnityMenuModelEntry::onRowsRemoved);
36− QObject::connect(m_parentModel, SIGNAL(modelReset()), this, SLOT(onModelReset()));
36+ QObject::connect(m_parentModel, &UnityMenuModel::modelReset, this, &UnityMenuModelEntry::onModelReset);
37 }
37 }
38 }
38 }
39
39
@@ -117,7 +117,7 @@ int UnityMenuModelStack::count() const
117void UnityMenuModelStack::push(UnityMenuModel* model, int index)
117void UnityMenuModelStack::push(UnityMenuModel* model, int index)
118{
118{
119 UnityMenuModelEntry* entry = new UnityMenuModelEntry(model, tail(), index);
119 UnityMenuModelEntry* entry = new UnityMenuModelEntry(model, tail(), index);
120− QObject::connect(entry, SIGNAL(remove()), SLOT(onRemove()));
120+ QObject::connect(entry, &UnityMenuModelEntry::remove, this, &UnityMenuModelStack::onRemove);
121
121
122 m_menuModels << entry;
122 m_menuModels << entry;
123 Q_EMIT tailChanged(model);
123 Q_EMIT tailChanged(model);
plugins/Unity/InputInfo/linux/qinputdeviceinfo_linux.cpp+2−2
@@ -52,7 +52,7 @@ QInputDeviceInfoPrivate::QInputDeviceInfoPrivate(QObject *parent) :
52 QObject(parent)
52 QObject(parent)
53 , udev(0)
53 , udev(0)
54{
54{
55− QTimer::singleShot(250,this,SLOT(init()));
55+ QTimer::singleShot(250, this, &QInputDeviceInfoPrivate::init);
56}
56}
57
57
58void QInputDeviceInfoPrivate::init()
58void QInputDeviceInfoPrivate::init()
@@ -78,7 +78,7 @@ void QInputDeviceInfoPrivate::init()
78 notifierFd = udev_monitor_get_fd(udevMonitor);
78 notifierFd = udev_monitor_get_fd(udevMonitor);
79
79
80 notifier = new QSocketNotifier(notifierFd, QSocketNotifier::Read, this);
80 notifier = new QSocketNotifier(notifierFd, QSocketNotifier::Read, this);
81− connect(notifier, SIGNAL(activated(int)), this, SLOT(onUDevChanges()));
81+ connect(notifier, &QSocketNotifier::activated, this, &QInputDeviceInfoPrivate::onUDevChanges);
82
82
83
83
84 udev_enumerate_scan_devices(enumerate);
84 udev_enumerate_scan_devices(enumerate);
plugins/Unity/InputInfo/qdeclarativeinputdeviceinfo.cpp+1−1
@@ -44,7 +44,7 @@ QDeclarativeInputDeviceInfo::QDeclarativeInputDeviceInfo(QObject *parent) :
44 QAbstractListModel(parent),
44 QAbstractListModel(parent),
45 deviceInfo(new QInputDeviceInfo)
45 deviceInfo(new QInputDeviceInfo)
46{
46{
47− connect(deviceInfo,SIGNAL(ready()),this,SLOT(updateDeviceList()));
47+ connect(deviceInfo, &QInputDeviceInfo::ready, this, &QDeclarativeInputDeviceInfo::updateDeviceList);
48 connect(deviceInfo, &QInputDeviceInfo::deviceAdded,this,&QDeclarativeInputDeviceInfo::addedDevice);
48 connect(deviceInfo, &QInputDeviceInfo::deviceAdded,this,&QDeclarativeInputDeviceInfo::addedDevice);
49 connect(deviceInfo, &QInputDeviceInfo::deviceRemoved,this,&QDeclarativeInputDeviceInfo::removedDevice);
49 connect(deviceInfo, &QInputDeviceInfo::deviceRemoved,this,&QDeclarativeInputDeviceInfo::removedDevice);
50}
50}
plugins/Unity/InputInfo/qinputinfo.cpp+1−1
@@ -138,7 +138,7 @@ QInputDeviceInfo::QInputDeviceInfo(QObject *parent) :
138 connect(d_ptr, &QInputDeviceInfoPrivate::newDevice,this,&QInputDeviceInfo::addedDevice);
138 connect(d_ptr, &QInputDeviceInfoPrivate::newDevice,this,&QInputDeviceInfo::addedDevice);
139 connect(d_ptr, &QInputDeviceInfoPrivate::deviceRemoved,this,&QInputDeviceInfo::deviceRemoved);
139 connect(d_ptr, &QInputDeviceInfoPrivate::deviceRemoved,this,&QInputDeviceInfo::deviceRemoved);
140
140
141− connect(d_ptr,SIGNAL(ready()),this,SIGNAL(ready()));
141+ connect(d_ptr, &QInputDeviceInfoPrivate::ready, this, &QInputDeviceInfo::ready);
142}
142}
143
143
144QVector <QInputDevice *> QInputDeviceInfo::deviceList()
144QVector <QInputDevice *> QInputDeviceInfo::deviceList()
plugins/Unity/Launcher/launchermodel.cpp+6−6
@@ -256,9 +256,9 @@ void LauncherModel::setApplicationManager(unity::shell::application::Application
256 // Is there already another appmanager set?
256 // Is there already another appmanager set?
257 if (m_appManager) {
257 if (m_appManager) {
258 // Disconnect any signals
258 // Disconnect any signals
259− disconnect(this, SLOT(applicationAdded(QModelIndex,int)));
259+ disconnect(this, &LauncherModel::applicationAdded, 0, nullptr);
260− disconnect(this, SLOT(applicationRemoved(QModelIndex,int)));
260+ disconnect(this, &LauncherModel::applicationRemoved, 0, nullptr);
261− disconnect(this, SLOT(focusedAppIdChanged()));
261+ disconnect(this, &LauncherModel::focusedAppIdChanged, 0, nullptr);
262
262
263 // remove any recent/running apps from the launcher
263 // remove any recent/running apps from the launcher
264 QList<int> recentAppIndices;
264 QList<int> recentAppIndices;
@@ -278,9 +278,9 @@ void LauncherModel::setApplicationManager(unity::shell::application::Application
278 }
278 }
279
279
280 m_appManager = appManager;
280 m_appManager = appManager;
281− connect(m_appManager, SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(applicationAdded(QModelIndex,int)));
281+ connect(m_appManager, &ApplicationManagerInterface::rowsInserted, this, &LauncherModel::applicationAdded);
282− connect(m_appManager, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), SLOT(applicationRemoved(QModelIndex,int)));
282+ connect(m_appManager, &ApplicationManagerInterface::rowsAboutToBeRemoved, this, &LauncherModel::applicationRemoved);
283− connect(m_appManager, SIGNAL(focusedApplicationIdChanged()), SLOT(focusedAppIdChanged()));
283+ connect(m_appManager, &ApplicationManagerInterface::focusedApplicationIdChanged, this, &LauncherModel::focusedAppIdChanged);
284
284
285 Q_EMIT applicationManagerChanged();
285 Q_EMIT applicationManagerChanged();
286
286
plugins/Utils/qlimitproxymodelqml.cpp+15−15
@@ -28,9 +28,9 @@ QLimitProxyModelQML::QLimitProxyModelQML(QObject *parent)
28 , m_dataChangedBegin(-1)
28 , m_dataChangedBegin(-1)
29 , m_dataChangedEnd(-1)
29 , m_dataChangedEnd(-1)
30{
30{
31− connect(this, SIGNAL(modelReset()), SIGNAL(countChanged()));
31+ connect(this, &QLimitProxyModelQML::modelReset, this, &QLimitProxyModelQML::countChanged);
32− connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), SIGNAL(countChanged()));
32+ connect(this, &QLimitProxyModelQML::rowsInserted, this, &QLimitProxyModelQML::countChanged);
33− connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), SIGNAL(countChanged()));
33+ connect(this, &QLimitProxyModelQML::rowsRemoved, this, &QLimitProxyModelQML::countChanged);
34}
34}
35
35
36QHash<int, QByteArray> QLimitProxyModelQML::roleNames() const
36QHash<int, QByteArray> QLimitProxyModelQML::roleNames() const
@@ -50,20 +50,20 @@ QLimitProxyModelQML::setModel(QAbstractItemModel *itemModel)
50
50
51 if (sourceModel() != nullptr) {
51 if (sourceModel() != nullptr) {
52 // Disconnect the QIdentityProxyModel handling for rows removed/added...
52 // Disconnect the QIdentityProxyModel handling for rows removed/added...
53− disconnect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, nullptr);
53+ disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted, this, nullptr);
54− disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, nullptr);
54+ disconnect(sourceModel(), &QAbstractItemModel::rowsInserted, this, nullptr);
55− disconnect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, nullptr);
55+ disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved, this, nullptr);
56− disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, nullptr);
56+ disconnect(sourceModel(), &QAbstractItemModel::rowsRemoved, this, nullptr);
57
57
58 // ... and use our own
58 // ... and use our own
59− connect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
59+ connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted,
60− this, SLOT(sourceRowsAboutToBeInserted(QModelIndex,int,int)));
60+ this, &QLimitProxyModelQML::sourceRowsAboutToBeInserted);
61− connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
61+ connect(sourceModel(), &QAbstractItemModel::rowsInserted,
62− this, SLOT(sourceRowsInserted(QModelIndex,int,int)));
62+ this, &QLimitProxyModelQML::sourceRowsInserted);
63− connect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
63+ connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved,
64− this, SLOT(sourceRowsAboutToBeRemoved(QModelIndex,int,int)));
64+ this, &QLimitProxyModelQML::sourceRowsAboutToBeRemoved);
65− connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
65+ connect(sourceModel(), &QAbstractItemModel::rowsRemoved,
66− this, SLOT(sourceRowsRemoved(QModelIndex,int,int)));
66+ this, &QLimitProxyModelQML::sourceRowsRemoved);
67 }
67 }
68 Q_EMIT modelChanged();
68 Q_EMIT modelChanged();
69 }
69 }
plugins/Utils/unitysortfilterproxymodelqml.cpp+3−3
@@ -24,9 +24,9 @@ UnitySortFilterProxyModelQML::UnitySortFilterProxyModelQML(QObject *parent)
24 : QSortFilterProxyModel(parent)
24 : QSortFilterProxyModel(parent)
25 , m_invertMatch(false)
25 , m_invertMatch(false)
26{
26{
27− connect(this, SIGNAL(modelReset()), SIGNAL(countChanged()));
27+ connect(this, &UnitySortFilterProxyModelQML::modelReset, this, &UnitySortFilterProxyModelQML::countChanged);
28− connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), SIGNAL(countChanged()));
28+ connect(this, &UnitySortFilterProxyModelQML::rowsInserted, this, &UnitySortFilterProxyModelQML::countChanged);
29− connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), SIGNAL(countChanged()));
29+ connect(this, &UnitySortFilterProxyModelQML::rowsRemoved, this, &UnitySortFilterProxyModelQML::countChanged);
30}
30}
31
31
32/*
32/*
plugins/Wizard/System.cpp+1−2
@@ -34,8 +34,7 @@ System::System()
34 qDBusRegisterMetaType<QMap<QString,QString>>();
34 qDBusRegisterMetaType<QMap<QString,QString>>();
35
35
36 m_fsWatcher.addPath(wizardEnabledPath());
36 m_fsWatcher.addPath(wizardEnabledPath());
37− connect(&m_fsWatcher, SIGNAL(fileChanged(const QString &)),
37+ connect(&m_fsWatcher, &QFileSystemWatcher::fileChanged, this, &System::wizardEnabledChanged);
38− this, SIGNAL(wizardEnabledChanged()));
39}
38}
40
39
41QString System::wizardEnabledPath()
40QString System::wizardEnabledPath()
src/libunity8-private/unitydbusobject.cpp+1−1
@@ -29,7 +29,7 @@ UnityDBusObject::UnityDBusObject(const QString &path, const QString &service, bo
29{
29{
30 if (async) {
30 if (async) {
31 // Use a zero-timer to let Qml finish loading before we announce on DBus
31 // Use a zero-timer to let Qml finish loading before we announce on DBus
32− QTimer::singleShot(0, this, SLOT(registerObject()));
32+ QTimer::singleShot(0, this, &UnityDBusObject::registerObject);
33 } else {
33 } else {
34 registerObject();
34 registerObject();
35 }
35 }
src/libunity8-private/unitydbusvirtualobject.cpp+1−1
@@ -28,7 +28,7 @@ UnityDBusVirtualObject::UnityDBusVirtualObject(const QString &path, const QStrin
28{
28{
29 if (async) {
29 if (async) {
30 // Use a zero-timer to let Qml finish loading before we announce on DBus
30 // Use a zero-timer to let Qml finish loading before we announce on DBus
31− QTimer::singleShot(0, this, SLOT(registerObject()));
31+ QTimer::singleShot(0, this, &UnityDBusVirtualObject::registerObject);
32 } else {
32 } else {
33 registerObject();
33 registerObject();
34 }
34 }
src/main.cpp+1−1
@@ -116,7 +116,7 @@ int main(int argc, const char *argv[])
116 view->engine()->setNetworkAccessManagerFactory(managerFactory);
116 view->engine()->setNetworkAccessManagerFactory(managerFactory);
117
117
118 view->setSource(source);
118 view->setSource(source);
119− QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit()));
119+ QObject::connect(view->engine(), &QQmlEngine::quit, application, &QGuiApplication::quit);
120
120
121 if (isMirServer || parser.hasFullscreen()) {
121 if (isMirServer || parser.hasFullscreen()) {
122 view->showFullScreen();
122 view->showFullScreen();
tests/mocks/LightDM/liblightdm/Greeter.cpp+1−1
@@ -127,7 +127,7 @@ void Greeter::authenticate(const QString &username)
127 d->authenticated = false;
127 d->authenticated = false;
128 d->authenticationUser = username;
128 d->authenticationUser = username;
129 d->twoFactorDone = false;
129 d->twoFactorDone = false;
130− QTimer::singleShot(0, this, SLOT(delayedAuthentication()));
130+ QTimer::singleShot(0, this, &Greeter::delayedAuthentication);
131}
131}
132
132
133void Greeter::delayedAuthentication()
133void Greeter::delayedAuthentication()
tests/mocks/MeeGo/QOfono/MockQOfonoManager.cpp+7−7
@@ -23,12 +23,12 @@ MockQOfonoManager::MockQOfonoManager(QObject *parent)
23 m_modemsSet(false),
23 m_modemsSet(false),
24 m_startedSet(false)
24 m_startedSet(false)
25{
25{
26− connect(MockQOfono::instance(), SIGNAL(availableChanged()),
26+ connect(MockQOfono::instance(), &MockQOfono::availableChanged,
27− this, SIGNAL(availableChanged()));
27+ this, &MockQOfonoManager::availableChanged);
28− connect(MockQOfono::instance(), SIGNAL(readyChanged()),
28+ connect(MockQOfono::instance(), &MockQOfono::readyChanged,
29− this, SLOT(checkReady()));
29+ this, &MockQOfonoManager::checkReady);
30− connect(MockQOfono::instance(), SIGNAL(modemsChanged()),
30+ connect(MockQOfono::instance(), &MockQOfono::modemsChanged,
31− this, SLOT(maybeModemsChanged()));
31+ this, &MockQOfonoManager::maybeModemsChanged);
32
32
33 checkReady();
33 checkReady();
34}
34}
@@ -55,7 +55,7 @@ void MockQOfonoManager::checkReady()
55 if (!m_startedSet && MockQOfono::instance()->ready()) {
55 if (!m_startedSet && MockQOfono::instance()->ready()) {
56 m_startedSet = true;
56 m_startedSet = true;
57 // Simulate QOfono's asynchronous initialization
57 // Simulate QOfono's asynchronous initialization
58− QTimer::singleShot(1, this, SLOT(setModems()));
58+ QTimer::singleShot(1, this, &MockQOfonoManager::setModems);
59 }
59 }
60}
60}
61
61
tests/mocks/QtMultimedia/audio.cpp+1−1
@@ -24,7 +24,7 @@ Audio::Audio(QObject* parent):
24{
24{
25 qsrand(time(nullptr));
25 qsrand(time(nullptr));
26 m_timer.setInterval(1000);
26 m_timer.setInterval(1000);
27− connect(&m_timer, SIGNAL(timeout()), SLOT(timerEvent()));
27+ connect(&m_timer, &QTimer::timeout, this, &Audio::timerEvent);
28}
28}
29
29
30QUrl Audio::source() const
30QUrl Audio::source() const
tests/mocks/Unity/Application/ApplicationInfo.cpp+2−2
@@ -96,7 +96,7 @@ void ApplicationInfo::setSession(Session* session)
96 this, &ApplicationInfo::onSessionSurfaceChanged);
96 this, &ApplicationInfo::onSessionSurfaceChanged);
97
97
98 if (!m_manualSurfaceCreation) {
98 if (!m_manualSurfaceCreation) {
99− QTimer::singleShot(500, m_session, SLOT(createSurface()));
99+ QTimer::singleShot(500, m_session, &Session::createSurface);
100 }
100 }
101 }
101 }
102
102
@@ -165,7 +165,7 @@ void ApplicationInfo::setState(State value)
165 Q_EMIT stateChanged(value);
165 Q_EMIT stateChanged(value);
166
166
167 if (!m_manualSurfaceCreation && !m_session && m_state == ApplicationInfo::Starting) {
167 if (!m_manualSurfaceCreation && !m_session && m_state == ApplicationInfo::Starting) {
168− QTimer::singleShot(500, this, SLOT(createSession()));
168+ QTimer::singleShot(500, this, &ApplicationInfo::createSession);
169 } else if (m_state == ApplicationInfo::Stopped) {
169 } else if (m_state == ApplicationInfo::Stopped) {
170 Session *session = m_session;
170 Session *session = m_session;
171 setSession(nullptr);
171 setSession(nullptr);
tests/mocks/Unity/Indicators/fakeindicatorsmodel.cpp+3−3
@@ -24,9 +24,9 @@ FakeIndicatorsModel::FakeIndicatorsModel(QObject *parent)
24 : QAbstractListModel(parent),
24 : QAbstractListModel(parent),
25 m_profile("phone")
25 m_profile("phone")
26{
26{
27− QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
27+ QObject::connect(this, &FakeIndicatorsModel::rowsInserted, this, &FakeIndicatorsModel::countChanged);
28− QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
28+ QObject::connect(this, &FakeIndicatorsModel::rowsRemoved, this, &FakeIndicatorsModel::countChanged);
29− QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
29+ QObject::connect(this, &FakeIndicatorsModel::modelReset, this, &FakeIndicatorsModel::countChanged);
30}
30}
31
31
32/*! \internal */
32/*! \internal */
tests/mocks/Unity/fake_navigation.cpp+3−3
@@ -30,9 +30,9 @@ Navigation::Navigation(const QString& navigationId, const QString& label, const
30 , m_loaded(false)
30 , m_loaded(false)
31 , m_scope(scope)
31 , m_scope(scope)
32{
32{
33− QTimer::singleShot(1500, this, SLOT(slotLoaded()));
33+ QTimer::singleShot(1500, this, &Navigation::slotLoaded);
34− connect(scope, SIGNAL(currentNavigationIdChanged()), this, SLOT(slotCurrentNavigationChanged()));
34+ connect(scope, &Scope::currentNavigationIdChanged, this, &Navigation::slotCurrentNavigationChanged);
35− connect(scope, SIGNAL(currentAltNavigationIdChanged()), this, SLOT(slotCurrentNavigationChanged()));
35+ connect(scope, &Scope::currentAltNavigationIdChanged, this, &Navigation::slotCurrentNavigationChanged);
36}
36}
37
37
38QString Navigation::navigationId() const
38QString Navigation::navigationId() const
tests/mocks/Unity/fake_previewmodel.cpp+1−2
@@ -37,8 +37,7 @@ PreviewModel::PreviewModel(QObject* parent, Scope* scope)
37 // we have one column by default
37 // we have one column by default
38 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
38 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
39 m_previewWidgetModels.append(columnModel);
39 m_previewWidgetModels.append(columnModel);
40− connect(this, SIGNAL(triggered(QString const&, QString const&, QVariantMap const&)),
40+ connect(this, &PreviewModel::triggered, this, &PreviewModel::triggeredSlot);
41− this, SLOT(triggeredSlot(QString const&, QString const&, QVariantMap const&)));
42}
41}
43
42
44void PreviewModel::setWidgetColumnCount(int count)
43void PreviewModel::setWidgetColumnCount(int count)
tests/mocks/Unity/fake_scopes.cpp+4−4
@@ -34,11 +34,11 @@ Scopes::Scopes(QObject *parent)
34{
34{
35 timer.setSingleShot(true);
35 timer.setSingleShot(true);
36 timer.setInterval(100);
36 timer.setInterval(100);
37− QObject::connect(&timer, SIGNAL(timeout()), this, SLOT(updateScopes()));
37+ QObject::connect(&timer, &QTimer::timeout, this, &Scopes::updateScopes);
38
38
39− QObject::connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
39+ QObject::connect(this, &Scopes::rowsInserted, this, &Scopes::countChanged);
40− QObject::connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SIGNAL(countChanged()));
40+ QObject::connect(this, &Scopes::rowsRemoved, this, &Scopes::countChanged);
41− QObject::connect(this, SIGNAL(modelReset()), this, SIGNAL(countChanged()));
41+ QObject::connect(this, &Scopes::modelReset, this, &Scopes::countChanged);
42
42
43 load();
43 load();
44}
44}
tests/mocks/libusermetrics/UserMetrics.cpp+2−4
@@ -405,10 +405,8 @@ UserMetrics::UserMetrics(QObject *parent) :
405 d_ptr->generateFakeData();
405 d_ptr->generateFakeData();
406 setUsername("");
406 setUsername("");
407
407
408− connect(this, SIGNAL(nextDataSource()), this, SLOT(nextDataSourceSlot()),
408+ connect(this, &UserMetrics::nextDataSource, this, &UserMetrics::nextDataSourceSlot, Qt::QueuedConnection);
409− Qt::QueuedConnection);
410− connect(this, SIGNAL(readyForDataChange()), this,
411− SLOT(readyForDataChangeSlot()), Qt::QueuedConnection);
409+ connect(this, &UserMetrics::readyForDataChange, this, &UserMetrics::readyForDataChangeSlot, Qt::QueuedConnection);
412}
410}
413
411
414UserMetrics::~UserMetrics()
412UserMetrics::~UserMetrics()
tests/plugins/Unity/Indicators/UnityMenuModelStackTest.cpp+3−3
@@ -48,7 +48,7 @@ private Q_SLOTS:
48 void testHeadOnSetHead()
48 void testHeadOnSetHead()
49 {
49 {
50 UnityMenuModelStack stack;
50 UnityMenuModelStack stack;
51− connect(&stack, SIGNAL(headChanged(UnityMenuModel*)), this, SLOT(onHeadChanged()));
51+ connect(&stack, &UnityMenuModelStack::headChanged, this, &UnityMenuModelStackTest::onHeadChanged);
52 stack.setHead(m_model);
52 stack.setHead(m_model);
53
53
54 QCOMPARE(stack.head(), m_model);
54 QCOMPARE(stack.head(), m_model);
@@ -58,7 +58,7 @@ private Q_SLOTS:
58 void testTailOnSetHead()
58 void testTailOnSetHead()
59 {
59 {
60 UnityMenuModelStack stack;
60 UnityMenuModelStack stack;
61− connect(&stack, SIGNAL(tailChanged(UnityMenuModel*)), this, SLOT(onTailChanged()));
61+ connect(&stack, &UnityMenuModelStack::tailChanged, this, &UnityMenuModelStackTest::onTailChanged);
62 stack.setHead(m_model);
62 stack.setHead(m_model);
63
63
64 QCOMPARE(stack.tail(), m_model);
64 QCOMPARE(stack.tail(), m_model);
@@ -84,7 +84,7 @@ private Q_SLOTS:
84 m_model->setModelData(recuseAddMenu(subMenuCount, menuDepth));
84 m_model->setModelData(recuseAddMenu(subMenuCount, menuDepth));
85
85
86 UnityMenuModelStack stack;
86 UnityMenuModelStack stack;
87− connect(&stack, SIGNAL(tailChanged(UnityMenuModel*)), this, SLOT(onTailChanged()));
87+ connect(&stack, &UnityMenuModelStack::tailChanged, this, &UnityMenuModelStackTest::onTailChanged);
88
88
89 QList<UnityMenuModel*> models;
89 QList<UnityMenuModel*> models;
90
90
tests/plugins/Utils/ModelTest.cpp+22−40
@@ -59,48 +59,30 @@ ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject (
59 if (!model)
59 if (!model)
60 qFatal("%s: model must not be null", Q_FUNC_INFO);
60 qFatal("%s: model must not be null", Q_FUNC_INFO);
61
61
62− connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
62+ connect(model, &QAbstractItemModel::columnsAboutToBeInserted, this, &ModelTest::runAllTests);
63− this, SLOT(runAllTests()) );
64− connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
63+ connect(model, &QAbstractItemModel::columnsAboutToBeRemoved, this, &ModelTest::runAllTests);
65− this, SLOT(runAllTests()) );
66− connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
64+ connect(model, &QAbstractItemModel::columnsInserted, this, &ModelTest::runAllTests);
67− this, SLOT(runAllTests()) );
68− connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
65+ connect(model, &QAbstractItemModel::columnsRemoved, this, &ModelTest::runAllTests);
69− this, SLOT(runAllTests()) );
66+ connect(model, &QAbstractItemModel::dataChanged, this, &ModelTest::runAllTests);
70− connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
71− this, SLOT(runAllTests()) );
72− connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
67+ connect(model, &QAbstractItemModel::headerDataChanged, this, &ModelTest::runAllTests);
73− this, SLOT(runAllTests()) );
74− connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests()) );
68+ connect(model, &QAbstractItemModel::layoutAboutToBeChanged, this, &ModelTest::runAllTests);
75− connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests()) );
69+ connect(model, &QAbstractItemModel::layoutChanged, this, &ModelTest::runAllTests);
76− connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests()) );
70+ connect(model, &QAbstractItemModel::modelReset, this, &ModelTest::runAllTests);
77− connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
71+ connect(model, &QAbstractItemModel::rowsAboutToBeInserted, this, &ModelTest::runAllTests);
78− this, SLOT(runAllTests()) );
79− connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
72+ connect(model, &QAbstractItemModel::rowsAboutToBeRemoved, this, &ModelTest::runAllTests);
80− this, SLOT(runAllTests()) );
81− connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
73+ connect(model, &QAbstractItemModel::rowsInserted, this, &ModelTest::runAllTests);
82− this, SLOT(runAllTests()) );
83− connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
74+ connect(model, &QAbstractItemModel::rowsRemoved, this, &ModelTest::runAllTests);
84− this, SLOT(runAllTests()) );
85
75
86 // Special checks for changes
76 // Special checks for changes
87− connect(model, SIGNAL(layoutAboutToBeChanged()),
77+ connect(model, &QAbstractItemModel::layoutAboutToBeChanged, this, &ModelTest::layoutAboutToBeChanged);
88− this, SLOT(layoutAboutToBeChanged()) );
89− connect(model, SIGNAL(layoutChanged()),
78+ connect(model, &QAbstractItemModel::layoutChanged, this, &ModelTest::layoutChanged);
90− this, SLOT(layoutChanged()) );
79+
91−
92− connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
80+ connect(model, &QAbstractItemModel::rowsAboutToBeInserted, this, &ModelTest::rowsAboutToBeInserted);
93− this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)) );
94− connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
81+ connect(model, &QAbstractItemModel::rowsAboutToBeRemoved, this, &ModelTest::rowsAboutToBeRemoved);
95− this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)) );
96− connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
82+ connect(model, &QAbstractItemModel::rowsInserted, this, &ModelTest::rowsInserted);
97− this, SLOT(rowsInserted(QModelIndex,int,int)) );
98− connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
83+ connect(model, &QAbstractItemModel::rowsRemoved, this, &ModelTest::rowsRemoved);
99− this, SLOT(rowsRemoved(QModelIndex,int,int)) );
84+ connect(model, &QAbstractItemModel::dataChanged, this, &ModelTest::dataChanged);
100− connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
85+ connect(model, &QAbstractItemModel::headerDataChanged, this, &ModelTest::headerDataChanged);
101− this, SLOT(dataChanged(QModelIndex,QModelIndex)) );
102− connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
103− this, SLOT(headerDataChanged(Qt::Orientation,int,int)) );
104
86
105 runAllTests();
87 runAllTests();
106}
88}
tests/plugins/Utils/QLimitProxyModelTest.cpp+3−3
@@ -102,9 +102,9 @@ class MirrorModel : public QObject
102public:
102public:
103 MirrorModel(QAbstractItemModel *model) : m_mirror(model)
103 MirrorModel(QAbstractItemModel *model) : m_mirror(model)
104 {
104 {
105− connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)));
105+ connect(model, &QAbstractItemModel::rowsInserted, this, &MirrorModel::rowsInserted);
106− connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int)));
106+ connect(model, &QAbstractItemModel::rowsRemoved, this, &MirrorModel::rowsRemoved);
107− connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(dataChanged(QModelIndex,QModelIndex)));
107+ connect(model, &QAbstractItemModel::dataChanged, this, &MirrorModel::dataChanged);
108 }
108 }
109
109
110 void check()
110 void check()
tests/uqmlscene/main.cpp+3−3
@@ -222,8 +222,8 @@ static int displayOptionsDialog(Options *options)
222 QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
222 QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
223 Qt::Horizontal,
223 Qt::Horizontal,
224 &dialog);
224 &dialog);
225− QObject::connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
225+ QObject::connect(buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
226− QObject::connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
226+ QObject::connect(buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
227
227
228 layout->addRow("Qml file:", qmlFileComboBox);
228 layout->addRow("Qml file:", qmlFileComboBox);
229 layout->addWidget(originalCheckBox);
229 layout->addWidget(originalCheckBox);
@@ -498,7 +498,7 @@ int main(int argc, char ** argv)
498#endif
498#endif
499 loadDummyDataFiles(engine, fi.path());
499 loadDummyDataFiles(engine, fi.path());
500 }
500 }
501− QObject::connect(&engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
501+ QObject::connect(&engine, &QQmlEngine::quit, QCoreApplication::instance(), &QCoreApplication::quit);
502
502
503 qmlRegisterSingletonType<QObject>("Qt.test.qtestroot", 1, 0, "QTestRootObject", testRootObject);
503 qmlRegisterSingletonType<QObject>("Qt.test.qtestroot", 1, 0, "QTestRootObject", testRootObject);
504
504