Commit db7a622b authored by Jan Grulich's avatar Jan Grulich
Browse files

Fix minor issues spotted by Lamarque

parent e43bb963
......@@ -36,12 +36,12 @@ AppChooser::~AppChooser()
{
}
uint AppChooser::chooseApplication(const QDBusObjectPath& handle,
const QString& app_id,
const QString& parent_window,
const QStringList& choices,
const QVariantMap& options,
QVariantMap& results)
uint AppChooser::chooseApplication(const QDBusObjectPath &handle,
const QString &app_id,
const QString &parent_window,
const QStringList &choices,
const QVariantMap &options,
QVariantMap &results)
{
qCDebug(XdgDesktopPortalKdeAppChooser) << "ChooseApplication called with parameters:";
qCDebug(XdgDesktopPortalKdeAppChooser) << " handle: " << handle.path();
......@@ -60,7 +60,7 @@ uint AppChooser::chooseApplication(const QDBusObjectPath& handle,
}
if (options.contains(QLatin1String("heading"))) {
heading = options.value(QLatin1String("heading")).toBool();
heading = options.value(QLatin1String("heading")).toString();
}
if (options.contains(QLatin1String("last_choice"))) {
......@@ -86,6 +86,7 @@ uint AppChooser::chooseApplication(const QDBusObjectPath& handle,
appDialog->deleteLater();
return 0;
}
appDialog->deleteLater();
return 1;
}
......@@ -29,7 +29,7 @@ class AppChooser : public QObject
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.AppChooser")
public:
AppChooser(QObject *parent = 0);
AppChooser(QObject *parent = nullptr);
~AppChooser();
public Q_SLOTS:
......
......@@ -33,7 +33,7 @@ class AppChooserDialog : public QDialog
{
Q_OBJECT
public:
AppChooserDialog(const QStringList &choices, QDialog* parent = 0, Qt::WindowFlags flags = 0);
AppChooserDialog(const QStringList &choices, QDialog *parent = nullptr, Qt::WindowFlags flags = 0);
~AppChooserDialog();
QString selectedApplication() const;
......
......@@ -177,6 +177,7 @@ uint FileChooser::openFile(const QDBusObjectPath &handle,
return 0;
}
fileDialog->deleteLater();
return 1;
}
......@@ -284,6 +285,7 @@ uint FileChooser::saveFile(const QDBusObjectPath &handle,
return 0;
}
fileDialog->deleteLater();
return 1;
}
......@@ -26,7 +26,6 @@
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeNotification, "xdg-desktop-portal-kde-notification")
Notification::Notification(QObject *parent)
: QObject(parent)
{
......@@ -88,7 +87,7 @@ void Notification::addNotification(const QString &app_id,
connect(notify, &KNotification::closed, this, &Notification::notificationClosed);
notify->sendEvent();
m_notifications.insert(QString("%1:%2").arg(app_id).arg(id), notify);
m_notifications.insert(QString("%1:%2").arg(app_id, id), notify);
}
void Notification::notificationActivated(uint action)
......@@ -121,7 +120,7 @@ void Notification::removeNotification(const QString &app_id,
qCDebug(XdgDesktopPortalKdeNotification) << " app_id: " << app_id;
qCDebug(XdgDesktopPortalKdeNotification) << " id: " << id;
KNotification *notify = m_notifications.take(QString("%1:%2").arg(app_id).arg(id));
KNotification *notify = m_notifications.take(QString("%1:%2").arg(app_id, id));
if (notify) {
notify->close();
notify->deleteLater();
......@@ -139,6 +138,6 @@ void Notification::notificationClosed()
const QString appId = notify->property("app_id").toString();
const QString id = notify->property("id").toString();
m_notifications.remove(QString("%1:%2").arg(appId).arg(id));
m_notifications.remove(QString("%1:%2").arg(appId, id));
notify->deleteLater();
}
......@@ -687,6 +687,7 @@ uint Print::preparePrint(const QDBusObjectPath &handle,
printDialog->deleteLater();
return 0;
} else {
printDialog->deleteLater();
return 1;
}
......
......@@ -32,7 +32,7 @@ class Print : public QObject
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.Print")
public:
Print(QObject *parent = 0);
Print(QObject *parent = nullptr);
~Print();
public Q_SLOTS:
......
Markdown is supported
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