Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KDE Portal for XDG Desktop
Commits
db7a622b
Commit
db7a622b
authored
May 12, 2017
by
Jan Grulich
Browse files
Fix minor issues spotted by Lamarque
parent
e43bb963
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/appchooser.cpp
View file @
db7a622b
...
...
@@ -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"
)).
to
Bool
();
heading
=
options
.
value
(
QLatin1String
(
"heading"
)).
to
String
();
}
if
(
options
.
contains
(
QLatin1String
(
"last_choice"
)))
{
...
...
@@ -86,6 +86,7 @@ uint AppChooser::chooseApplication(const QDBusObjectPath& handle,
appDialog
->
deleteLater
();
return
0
;
}
appDialog
->
deleteLater
();
return
1
;
}
src/appchooser.h
View file @
db7a622b
...
...
@@ -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
:
...
...
src/appchooserdialog.h
View file @
db7a622b
...
...
@@ -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
;
...
...
src/filechooser.cpp
View file @
db7a622b
...
...
@@ -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
;
}
src/notification.cpp
View file @
db7a622b
...
...
@@ -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
();
}
src/print.cpp
View file @
db7a622b
...
...
@@ -687,6 +687,7 @@ uint Print::preparePrint(const QDBusObjectPath &handle,
printDialog
->
deleteLater
();
return
0
;
}
else
{
printDialog
->
deleteLater
();
return
1
;
}
...
...
src/print.h
View file @
db7a622b
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment