summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/services/genericunix/qgenericunixservices.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move UNIX services into QtGuiFriedemann Kleint2020-06-181-374/+0
| | | | | | Task-number: QTBUG-83255 Change-Id: I95cd25c6e18ffb46955acc76d6cab551d1c8f5ae Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix URL opening in snap sandboxIlya Fedin2020-05-011-1/+1
| | | | | | | | For some reason, snapd doesn't allow dbus activating of xdg-desktop-portal and returns AccessDenied to any request. Qt checks the returned error and if it is not ServiceUnknown, Qt doesn't try to open URL through xdg-open, which encounters into situation that URLs doesn't open until some other app tries to access xdg-desktop-portal. Fixes: QTBUG-83837 Change-Id: I9e600f734401bd4295d97e2b5686b916c6c7f762 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix UB in QProcess deprecation warning fixesJoerg Bornemann2020-03-061-1/+5
| | | | | | | | The commits e1e08629 and 66e905b1 introduced undefined behavior. Fix this by assigning the result of takeFirst to a temporary. Change-Id: I9e29412cf632d4836b95d47e12d8c07ab0645fbb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix deprecation warning in QGenericUnixServicesJoerg Bornemann2020-03-051-1/+2
| | | | | | | Do not use the deprecated method QProcess::start(QString) anymore. Change-Id: I09eae2c8a1dbb53fd2de004e5030da9bb3c07b14 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* XDG Portal: quick optimization to avoid dup/close of a file descriptorThiago Macieira2019-03-051-2/+2
| | | | | | | | Just gift it to QDBusUnixFileDescriptor. Change-Id: Ifa822ecdaaa241968ed7fffd158799041653cf78 Reviewed-by: Jan Grulich <jgrulich@redhat.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* XDG Portal: allow the portal not to be runningThiago Macieira2019-03-051-16/+32
| | | | | | | | | For some reason, it may be missing with SNAP. Fixes: QTBUG-74112 Change-Id: Ifa822ecdaaa241968ed7fffd1587966cbd30dcbd Reviewed-by: Jan Grulich <jgrulich@redhat.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-191-1/+3
|\ | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
| * Modernize the "settings" featureLiang Qi2018-11-151-1/+3
| | | | | | | | | | | | Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Make flatpak portal support to be used also by Snap applicationsJan Grulich2018-09-021-12/+12
| | | | | | | | | | | | | | | | | | Snap now uses xdg-desktop-portal for portal support. Add check for apps running in Snap and make them use portals by default. We also should be using different name for the platform theme used by sandboxed apps. Change-Id: Ibaa35b7549b3d94775d7edb937f729a300d071b6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix unused parameter warningRobert Griebl2018-06-151-0/+2
| | | | | | | | | | | | Task-number: QTBUG-68804 Change-Id: Id40ea045237e5ceafc04d86629f2264eecc084c1 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Add support for opening files in OpenURI flatpak portalJan Grulich2018-04-131-0/+39
|/ | | | | | | | | | Adds support for opening files in applications outside sandbox. To prove we have access to given file, we have to pass it as file descriptor. The user then gets a dialog with list of application which can be used to open given file. Change-Id: Ifb4cf3dece15d0792b8eb1b90a240da2d3f3c89e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for flatpak portalsJan Grulich2017-11-141-1/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for OpenURI and Email Flatpak portals. To support them we just do specific DBus calls, which are then caught and forwarded by xdg-desktop-portal daemon/service. This is needed for Qt applications running in sandbox, otherwise they cannot open links or email clients inside sandbox. Other portal support, like for opening files can be added into a platform theme, but adding support for OpenURI and Email portal requires writing custom platform services plugin and this is only possible when you write complete platform plugin, thus we want to have this support directly in Qt. Support for other portals will most likely follow soon, but at this moment we have to get rid of creating our custom platform plugin to just have our own platform services for flatpak support. [ChangeLog][Platform Specific Changes][Linux] Added support for flatpak portals. Flatpak is a software utility for software deployment and package management. It provides a sandbox environment in which users can run applications in isolation from the rest of the system. To communicate with the system flatpak uses portals, which are designed to be a bridge between sandboxed applications and desktop/system running on user's computer. Flatpak runs automatically this as service, called xdg-desktop-portal, which exports portals on DBus and which are by default visible to all applications running under Flatpak. Change-Id: Ice57ad120d30a3154b133172c79d8e9d6e61bd4c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update detection of $DESKTOP_SESSIONThiago Macieira2017-04-271-4/+24
| | | | | | | | | | | | | I don't know how widespread this use is, but apparently sddm seems to set DESKTOP_SESSION to be the .desktop file that it used to launch the session (minus the .desktop extension). In that case, we should read the DesktopName entry from the file to get the actual desktop type. And since the desktop detection from QGenericUnixServices should suffice, we don't need to repeat the same code in QGenericUnixThemes. Change-Id: I0e1a09998253489388abfffd14b5eeefbd7fe740 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix warning for -no-feature-multiprocessTasuku Suzuki2017-04-251-0/+2
| | | | | | Change-Id: Ifa3382098c8f7c2cb1750b7ac5e583ddd71895e2 Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Properly use the "process" featureUlf Hermann2017-02-271-2/+4
| | | | | | | | | | | | Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess headers, exclude the sources from compilation when switched off, guard header inclusions in places where compilation without QProcess seems supported, drop some unused includes, and fix some tests that were apparently designed to work with QT_NO_PROCESS but failed to. Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Don't set platform specific QT_NO_FOO defines in qglobal.hLars Knoll2016-11-241-1/+2
| | | | | | | | | They should be enabled/disabled through the configuration system. Remove some unused defines, and move one define from qglobal.h to a proper feature definition in Qt Gui. Change-Id: Ie8d5bff9712ba745af60b42ceca3f0440bed2706 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QStringLiteral more judiciouslyAnton Kudryavtsev2016-07-081-2/+2
| | | | | | | | | | | | | | | Replace it with QL1S in QStringBuilder expressions and in overloaded functions. Replace patterns 'QString::number() + QStringLiteral' and 'QStringLiteral + QString::number()' with QString::asprintf. Saves some text size. Change-Id: Ib39b2332264dfc3df04e77f2c101b47a1030cef4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Remove use of system() when QT_NO_MULTIPROCESS is defined.Rolland Dudemaine2015-12-041-0/+22
| | | | | | | | Some systems, like INTEGRITY, may support Posix/unix but lack system() in certain configurations. Change-Id: I8ef09fac03f8d16d791cdf1073f32b1c7c911776 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-2/+2
| | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-131-1/+1
| | | | | | | | ...where passing them by value was not intentional. Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-1/+1
| | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Improve desktop environment detection.David Faure2013-04-241-9/+17
| | | | | | | | | | | | | | | UNKNOWN now means generic unix theme, rather than Gtk: there are other KDE/Qt-based desktops, and there's also the case of no desktop at all (e.g. bare Xvfb, as used by automated builds). To make this correct for GTK-based desktops, this commits improves the detection of the current desktop environment. Change-Id: Ib696624de39d5024527880df7adc26c65b838d15 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Detect Unity by checking XDG_CURRENT_DESKTOP and use Gnome theme.Friedemann Kleint2012-11-201-0/+4
| | | | | | | | | | Fallback to Gtk for unknown desktops, which should be suitable for most cases like XFCE. Task-number: QTCREATORBUG-8254 Change-Id: Iaf9959f75852e03a83b5af7d0dead01ef657d678 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QtGui: use new qEnvironmentVariableIsEmpty()Marc Mutz2012-08-141-2/+2
| | | | | | | | In particular, static bool showRasterOverlay is safer. Change-Id: I9df6c9a9a56d2e61b13391b6889c0ac6e259e801 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove widgets lib dependency on platformsupport.Frederik Gladhorn2012-06-081-13/+9
| | | | | | | | Instead of the dependency add the one needed function as virtual to the QPlatformServices in QtGui. Change-Id: Ia4455f5ac88ec4d0480bd81635cebba62bbd8ac5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add palette() and further hints to QtGui/QPlatformTheme.Friedemann Kleint2012-02-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | - Move palette() from deprecated QtWidgets/QGuiPlatformPlugin to QtGui/QPlatformTheme, Make it return a const * since QPalette does not have isNull(). - Initialize QGuiApplication::palette() and QApplication::systemPalette() from it. - Do not initialize QPalette from QGuiApplication::palette() unless app_pal is non-null (default to Qt::black if it is 0). This avoids initialization order crashes/recursions in the QPA plugin. Streamline initialization function. - Remove styleName(), systemIconThemeName() and iconSearchPaths() from QGuiPlatformPlugin and re-add them as QPlatformTheme::themeHint(). - Remove styleHint() from QGuiPlatformPlugin, add it to QPlatformTheme::themeHint(). - Add UNIX themes with factory function (Generic, KDE, Gnome), taking it from Qt 4.8 code (stripping the KDE 3 code). - Implement Windows palettes. Task-number: QTBUG-24204 Change-Id: Ie27ec035df4f84c42deaffc4816b2e53ce705462 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add QPlatformServices class.Friedemann Kleint2012-02-101-0/+151
- Add QPlatformServices as back-end for QDesktopServices. - Bring back UNIX/Linux desktop detection in platformsupport as a generic implementation. - Add Windows implementation. Reviewed-by: Morten Johan Sorvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org> Change-Id: If94bb65755df4f849edd83c57143ee2c73002137 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>