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
0a6c007f
Commit
0a6c007f
authored
Sep 19, 2018
by
Laurent Montel
Browse files
Use KDEFrameworkCompilerSettings
parent
e4a788d8
Changes
7
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
0a6c007f
...
...
@@ -15,7 +15,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_
include
(
KDEInstallDirs
)
include
(
KDECMakeSettings
)
include
(
KDECompilerSettings NO_POLICY_SCOPE
)
include
(
KDE
Framework
CompilerSettings NO_POLICY_SCOPE
)
include
(
FeatureSummary
)
...
...
@@ -70,8 +70,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
)
add_definitions
(
-DQT_DISABLE_DEPRECATED_BEFORE=0
)
add_definitions
(
-DQT_USE_FAST_OPERATOR_PLUS
)
remove_definitions
(
-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY
)
add_subdirectory
(
data
)
add_subdirectory
(
src
)
...
...
src/appchooserdialog.cpp
View file @
0a6c007f
...
...
@@ -51,7 +51,7 @@ AppChooserDialog::AppChooserDialog(const QStringList &choices, const QString &de
label
->
setOpenExternalLinks
(
false
);
connect
(
label
,
&
QLabel
::
linkActivated
,
this
,
[]
()
{
KProcess
::
startDetached
(
"plasma-discover"
);
KProcess
::
startDetached
(
QStringLiteral
(
"plasma-discover"
)
)
;
});
vboxLayout
->
addWidget
(
label
);
...
...
src/filechooser.cpp
View file @
0a6c007f
...
...
@@ -29,10 +29,10 @@
Q_LOGGING_CATEGORY
(
XdgDesktopPortalKdeFileChooser
,
"xdp-kde-file-chooser"
)
// Keep in sync with qflatpakfiledialog from flatpak-platform-plugin
Q_DECLARE_METATYPE
(
FileChooserPortal
::
Filter
)
;
Q_DECLARE_METATYPE
(
FileChooserPortal
::
Filters
)
;
Q_DECLARE_METATYPE
(
FileChooserPortal
::
FilterList
)
;
Q_DECLARE_METATYPE
(
FileChooserPortal
::
FilterListList
)
;
Q_DECLARE_METATYPE
(
FileChooserPortal
::
Filter
)
Q_DECLARE_METATYPE
(
FileChooserPortal
::
Filters
)
Q_DECLARE_METATYPE
(
FileChooserPortal
::
FilterList
)
Q_DECLARE_METATYPE
(
FileChooserPortal
::
FilterListList
)
QDBusArgument
&
operator
<<
(
QDBusArgument
&
arg
,
const
FileChooserPortal
::
Filter
&
filter
)
{
...
...
@@ -147,7 +147,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
}
if
(
!
filterStrings
.
isEmpty
())
{
nameFilters
<<
QString
(
"%1 (%2)"
).
arg
(
filterList
.
userVisibleName
).
arg
(
filterStrings
.
join
(
QLatin1String
(
" "
)));
nameFilters
<<
QString
Literal
(
"%1 (%2)"
).
arg
(
filterList
.
userVisibleName
).
arg
(
filterStrings
.
join
(
QLatin1String
(
" "
)));
}
}
}
...
...
@@ -219,11 +219,11 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
}
if
(
options
.
contains
(
QLatin1String
(
"current_folder"
)))
{
currentFolder
=
options
.
value
(
QLatin1String
(
"current_folder"
)).
toByteArray
();
currentFolder
=
QString
::
fromUtf8
(
options
.
value
(
QLatin1String
(
"current_folder"
)).
toByteArray
()
)
;
}
if
(
options
.
contains
(
QLatin1String
(
"current_file"
)))
{
currentFile
=
options
.
value
(
QLatin1String
(
"current_file"
)).
toByteArray
();
currentFile
=
QString
::
fromUtf8
(
options
.
value
(
QLatin1String
(
"current_file"
)).
toByteArray
()
)
;
}
if
(
options
.
contains
(
QLatin1String
(
"filters"
)))
{
...
...
@@ -239,7 +239,7 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
}
if
(
!
filterStrings
.
isEmpty
())
{
nameFilters
<<
QString
(
"%1 (%2)"
).
arg
(
filterList
.
userVisibleName
).
arg
(
filterStrings
.
join
(
QLatin1String
(
" "
)));
nameFilters
<<
QString
Literal
(
"%1 (%2)"
).
arg
(
filterList
.
userVisibleName
).
arg
(
filterStrings
.
join
(
QLatin1String
(
" "
)));
}
}
}
...
...
src/notification.cpp
View file @
0a6c007f
...
...
@@ -88,7 +88,7 @@ void NotificationPortal::AddNotification(const QString &app_id,
connect
(
notify
,
&
KNotification
::
closed
,
this
,
&
NotificationPortal
::
notificationClosed
);
notify
->
sendEvent
();
m_notifications
.
insert
(
QString
(
"%1:%2"
).
arg
(
app_id
,
id
),
notify
);
m_notifications
.
insert
(
QString
Literal
(
"%1:%2"
).
arg
(
app_id
,
id
),
notify
);
}
void
NotificationPortal
::
notificationActivated
(
uint
action
)
...
...
@@ -121,7 +121,7 @@ void NotificationPortal::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
,
id
));
KNotification
*
notify
=
m_notifications
.
take
(
QString
Literal
(
"%1:%2"
).
arg
(
app_id
,
id
));
if
(
notify
)
{
notify
->
close
();
notify
->
deleteLater
();
...
...
@@ -139,6 +139,6 @@ void NotificationPortal::notificationClosed()
const
QString
appId
=
notify
->
property
(
"app_id"
).
toString
();
const
QString
id
=
notify
->
property
(
"id"
).
toString
();
m_notifications
.
remove
(
QString
(
"%1:%2"
).
arg
(
appId
,
id
));
m_notifications
.
remove
(
QString
Literal
(
"%1:%2"
).
arg
(
appId
,
id
));
notify
->
deleteLater
();
}
src/print.cpp
View file @
0a6c007f
...
...
@@ -633,7 +633,7 @@ uint PrintPortal::PreparePrint(const QDBusObjectPath &handle,
resultingSettings
.
insert
(
QLatin1String
(
"print-pages"
),
QLatin1String
(
"current"
));
}
else
if
(
printer
->
printRange
()
==
QPrinter
::
PageRange
)
{
resultingSettings
.
insert
(
QLatin1String
(
"print-pages"
),
QLatin1String
(
"ranges"
));
resultingSettings
.
insert
(
QLatin1String
(
"page-ranges"
),
QString
(
"%1-%2"
).
arg
(
printer
->
fromPage
()).
arg
(
printer
->
toPage
()));
resultingSettings
.
insert
(
QLatin1String
(
"page-ranges"
),
QString
Literal
(
"%1-%2"
).
arg
(
printer
->
fromPage
()).
arg
(
printer
->
toPage
()));
}
// Set cups specific properties
const
QStringList
cupsOptions
=
printer
->
printEngine
()
->
property
(
PPK_CupsOptions
).
toStringList
();
...
...
src/screenshot.cpp
View file @
0a6c007f
...
...
@@ -34,7 +34,7 @@
Q_LOGGING_CATEGORY
(
XdgDesktopPortalKdeScreenshot
,
"xdp-kde-screenshot"
)
// Keep in sync with qflatpakcolordialog from Qt flatpak platform theme
Q_DECLARE_METATYPE
(
ScreenshotPortal
::
ColorRGB
)
;
Q_DECLARE_METATYPE
(
ScreenshotPortal
::
ColorRGB
)
QDBusArgument
&
operator
<<
(
QDBusArgument
&
arg
,
const
ScreenshotPortal
::
ColorRGB
&
color
)
{
...
...
src/screenshotdialog.cpp
View file @
0a6c007f
...
...
@@ -72,7 +72,7 @@ static QImage readImage(int pipeFd)
QImage
image
;
ds
>>
image
;
return
image
;
}
;
}
ScreenshotDialog
::
ScreenshotDialog
(
QDialog
*
parent
,
Qt
::
WindowFlags
flags
)
:
QDialog
(
parent
,
flags
)
...
...
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