Commit dd15322e authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Add QT_NO_KEYWORDS definition

Test Plan: Builds

Reviewers: drosca, broulik, davidedmundson, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14157
parent ed0c5863
......@@ -11,7 +11,7 @@ set(KF5_MIN_VERSION "5.42.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_pulseaudio\")
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_pulseaudio\" -DQT_NO_KEYWORDS)
include(FeatureSummary)
include(KDEInstallDirs)
......
......@@ -39,7 +39,7 @@ void Card::update(const pa_card_info *info)
QString infoName = QString::fromUtf8(info->name);
if (m_name != infoName) {
m_name = infoName;
emit nameChanged();
Q_EMIT nameChanged();
}
qDeleteAll(m_profiles);
......@@ -52,8 +52,8 @@ void Card::update(const pa_card_info *info)
m_activeProfileIndex = m_profiles.length() - 1;
}
}
emit profilesChanged();
emit activeProfileIndexChanged();
Q_EMIT profilesChanged();
Q_EMIT activeProfileIndexChanged();
qDeleteAll(m_ports);
m_ports.clear();
......@@ -62,7 +62,7 @@ void Card::update(const pa_card_info *info)
port->update(*it);
m_ports.append(port);
}
emit portsChanged();
Q_EMIT portsChanged();
}
QString Card::name() const
......
......@@ -63,12 +63,12 @@ public:
Q_ASSERT(value);
m_properties.insert(QString::fromUtf8(key), QString::fromUtf8(value));
}
emit propertiesChanged();
Q_EMIT propertiesChanged();
}
QVariantMap properties() const { return m_properties; }
signals:
Q_SIGNALS:
void propertiesChanged();
private:
......@@ -93,7 +93,7 @@ public:
void setActiveProfileIndex(quint32 profileIndex);
QList<QObject *> ports() const;
signals:
Q_SIGNALS:
void nameChanged();
void profilesChanged();
void activeProfileIndexChanged();
......
......@@ -41,7 +41,7 @@ void Client::update(const pa_client_info *info)
QString infoName = QString::fromUtf8(info->name);
if (m_name != infoName) {
m_name = infoName;
emit nameChanged();
Q_EMIT nameChanged();
}
}
......
......@@ -42,7 +42,7 @@ public:
QString name() const;
signals:
Q_SIGNALS:
void nameChanged();
private:
......
......@@ -63,23 +63,23 @@ public:
if (m_name != info->name) {
m_name = info->name;
emit nameChanged();
Q_EMIT nameChanged();
}
if (m_description != info->description) {
m_description = info->description;
emit descriptionChanged();
Q_EMIT descriptionChanged();
}
const char *form_factor = pa_proplist_gets(info->proplist, PA_PROP_DEVICE_FORM_FACTOR);
if (form_factor) {
QString formFactor = QString::fromUtf8(form_factor);
if (m_formFactor != formFactor) {
m_formFactor = formFactor;
emit formFactorChanged();
Q_EMIT formFactorChanged();
}
}
m_cardIndex = info->card;
emit cardIndexChanged();
Q_EMIT cardIndexChanged();
// TODO: this rebuilds the entire port list on every update. would be
// nicer if it actually removed what needs removing updates what needs
......@@ -95,19 +95,19 @@ public:
m_activePortIndex = m_ports.length() - 1;
}
}
emit portsChanged();
emit activePortIndexChanged();
Q_EMIT portsChanged();
Q_EMIT activePortIndexChanged();
State infoState = stateFromPaState(info->state);
if (infoState != m_state) {
m_state = infoState;
emit stateChanged();
Q_EMIT stateChanged();
}
const bool isVirtual = !(info->flags & 4); // PA_X_HARDWARE
if (m_virtualDevice != isVirtual) {
m_virtualDevice = isVirtual;
emit virtualDeviceChanged();
Q_EMIT virtualDeviceChanged();
}
}
......@@ -123,7 +123,7 @@ public:
virtual void setDefault(bool enable) = 0;
bool isVirtualDevice() const;
signals:
Q_SIGNALS:
void stateChanged();
void nameChanged();
void descriptionChanged();
......
......@@ -37,7 +37,7 @@ public:
KCMPulseAudio(QObject *parent, const QVariantList &args);
~KCMPulseAudio() override;
public slots:
public Q_SLOTS:
void defaults() final;
void load() final;
void save() final;
......
......@@ -55,7 +55,7 @@ public:
virtual QObject *objectAt(int index) const = 0;
virtual int indexOfObject(QObject *object) const = 0;
signals:
Q_SIGNALS:
void aboutToBeAdded(int index);
void added(int index);
void aboutToBeRemoved(int index);
......@@ -120,10 +120,10 @@ public:
modelIndex++;
}
emit aboutToBeAdded(modelIndex);
Q_EMIT aboutToBeAdded(modelIndex);
m_data.insert(object->index(), object);
Q_ASSERT(modelIndex == m_data.keys().indexOf(object->index()));
emit added(modelIndex);
Q_EMIT added(modelIndex);
}
// Context is passed in as parent because context needs to include the maps
......@@ -155,9 +155,9 @@ public:
m_pendingRemovals.insert(index);
} else {
const int modelIndex = m_data.keys().indexOf(index);
emit aboutToBeRemoved(modelIndex);
Q_EMIT aboutToBeRemoved(modelIndex);
delete m_data.take(index);
emit removed(modelIndex);
Q_EMIT removed(modelIndex);
}
}
......
......@@ -39,12 +39,12 @@ void Module::update(const pa_module_info *info)
const QString infoName = QString::fromUtf8(info->name);
if (m_name != infoName) {
m_name = infoName;
emit nameChanged();
Q_EMIT nameChanged();
}
const QString infoArgument = QString::fromUtf8(info->argument);
if (m_argument != infoArgument) {
m_argument = infoArgument;
emit argumentChanged();
Q_EMIT argumentChanged();
}
}
......
......@@ -45,7 +45,7 @@ public:
QString name() const;
QString argument() const;
signals:
Q_SIGNALS:
void nameChanged();
void argumentChanged();
......
......@@ -57,7 +57,7 @@ public:
quint32 priority() const;
Availability availability() const;
signals:
Q_SIGNALS:
void nameChanged();
void descriptionChanged();
void priorityChanged();
......@@ -72,23 +72,23 @@ protected:
QString infoName = QString::fromUtf8(info->name);
if (m_name != infoName) {
m_name = infoName;
emit nameChanged();
Q_EMIT nameChanged();
}
if (info->description) {
QString infoDescription = QString::fromUtf8(info->description);
if (m_description != infoDescription) {
m_description = infoDescription;
emit descriptionChanged();
Q_EMIT descriptionChanged();
}
}
if (m_priority != info->priority) {
m_priority = info->priority;
emit priorityChanged();
Q_EMIT priorityChanged();
}
if (m_availability != newAvailability) {
m_availability = newAvailability;
emit availabilityChanged();
Q_EMIT availabilityChanged();
}
}
......
......@@ -191,7 +191,7 @@ void AbstractModel::propertyChanged()
}
int index = m_map->indexOfObject(sender());
qCDebug(PLASMAPA) << "PROPERTY CHANGED (" << index << ") :: " << role << roleNames().value(role);
emit dataChanged(createIndex(index, 0), createIndex(index, 0), {role});
Q_EMIT dataChanged(createIndex(index, 0), createIndex(index, 0), {role});
}
void AbstractModel::onDataAdded(int index)
......@@ -200,7 +200,7 @@ void AbstractModel::onDataAdded(int index)
const QMetaObject *mo = data->metaObject();
// We have all the data changed notify signals already stored
auto keys = m_signalIndexToProperties.keys();
foreach (int index, keys) {
Q_FOREACH (int index, keys) {
QMetaMethod meth = mo->method(index);
connect(data, meth, this, propertyChangedMetaMethod());
}
......@@ -231,7 +231,7 @@ SinkModel::SinkModel(QObject *parent)
connect(context()->server(), &Server::defaultSinkChanged, this, [this]() {
updatePreferredSink();
emit defaultSinkChanged();
Q_EMIT defaultSinkChanged();
});
}
......@@ -279,7 +279,7 @@ void SinkModel::updatePreferredSink()
if (sink != m_preferredSink) {
qCDebug(PLASMAPA) << "Changing preferred sink to" << sink << (sink ? sink->name() : "");
m_preferredSink = sink;
emit preferredSinkChanged();
Q_EMIT preferredSinkChanged();
}
}
......
......@@ -51,7 +51,7 @@ protected:
void initRoleNames(const QMetaObject &qobjectMetaObject);
Context *context() const;
private slots:
private Q_SLOTS:
void propertyChanged();
private:
......@@ -93,7 +93,7 @@ public:
Sink *preferredSink() const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
signals:
Q_SIGNALS:
void defaultSinkChanged();
void preferredSinkChanged();
......@@ -127,7 +127,7 @@ public:
Source *defaultSource() const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
signals:
Q_SIGNALS:
void defaultSourceChanged();
};
......
......@@ -55,14 +55,14 @@ public:
Q_ASSERT(value);
m_properties.insert(QString::fromUtf8(key), QString::fromUtf8(value));
}
emit propertiesChanged();
Q_EMIT propertiesChanged();
}
quint32 index() const;
QString iconName() const;
QVariantMap properties() const;
signals:
Q_SIGNALS:
void propertiesChanged();
protected:
......
......@@ -39,7 +39,7 @@ QString GlobalActionCollection::name() const
void GlobalActionCollection::setName(const QString &name)
{
m_name = name;
emit nameChanged();
Q_EMIT nameChanged();
}
QString GlobalActionCollection::displayName() const
......@@ -50,12 +50,12 @@ QString GlobalActionCollection::displayName() const
void GlobalActionCollection::setDisplayName(const QString &displayName)
{
m_displayName = displayName;
emit displayNameChanged();
Q_EMIT displayNameChanged();
}
void GlobalActionCollection::componentComplete()
{
foreach (QObject *item, children()) {
Q_FOREACH (QObject *item, children()) {
GlobalAction *action = qobject_cast<GlobalAction *>(item);
if (!action) {
continue;
......
......@@ -45,7 +45,7 @@ public:
QString displayName() const;
void setDisplayName(const QString &displayName);
signals:
Q_SIGNALS:
void nameChanged();
void displayNameChanged();
......
......@@ -36,7 +36,7 @@ public:
bool isValid() const;
public slots:
public Q_SLOTS:
void play(quint32 sinkIndex);
};
......
......@@ -29,7 +29,7 @@ class VolumeOSD : public QObject
public:
explicit VolumeOSD(QObject *parent = nullptr);
public slots:
public Q_SLOTS:
void show(int percent);
void showMicrophone(int percent);
void showText(const QString &iconName, const QString &text);
......
......@@ -66,12 +66,12 @@ void Server::reset()
{
if (m_defaultSink) {
m_defaultSink = nullptr;
emit defaultSinkChanged(m_defaultSink);
Q_EMIT defaultSinkChanged(m_defaultSink);
}
if (m_defaultSource) {
m_defaultSource = nullptr;
emit defaultSourceChanged(m_defaultSource);
Q_EMIT defaultSourceChanged(m_defaultSource);
}
}
......@@ -110,13 +110,13 @@ void Server::updateDefaultDevices()
if (m_defaultSink != sink) {
qCDebug(PLASMAPA) << "Default sink changed" << sink;
m_defaultSink = sink;
emit defaultSinkChanged(m_defaultSink);
Q_EMIT defaultSinkChanged(m_defaultSink);
}
if (m_defaultSource != source) {
qCDebug(PLASMAPA) << "Default source changed" << source;
m_defaultSource = source;
emit defaultSourceChanged(m_defaultSource);
Q_EMIT defaultSourceChanged(m_defaultSource);
}
}
......
......@@ -47,7 +47,7 @@ public:
void reset();
void update(const pa_server_info *info);
signals:
Q_SIGNALS:
void defaultSinkChanged(Sink *sink);
void defaultSourceChanged(Source *source);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment