Commit graph

19 commits

Author SHA1 Message Date
Friedrich W. H. Kossebau ed2d352c42 Add explicit moc includes to sources for moc-covered headers
* speeds up incremental builds as changes to a header will not always
  need the full mocs_compilation.cpp for all the target's headers rebuild,
  while having a moc file sourced into a source file only adds minor
  extra costs, due to small own code and the used headers usually
  already covered by the source file, being for the same class/struct
* seems to not slow down clean builds, due to empty mocs_compilation.cpp
  resulting in those quickly processed, while the minor extra cost of the
  sourced moc files does not outweigh that in summary.
  Measured times actually improved by some percent points.
  (ideally CMake would just skip empty mocs_compilation.cpp & its object
  file one day)
* enables compiler to see all methods of a class in same compilation unit
  to do some sanity checks
* potentially more inlining in general, due to more in the compilation unit
* allows to keep using more forward declarations in the header, as with the
  moc code being sourced into the cpp file there definitions can be ensured
  and often are already for the needs of the normal class methods
2023-07-05 07:59:18 +00:00
Serg Podtynnyi 38c34eeca3 Add clang-format and format code as in Frameworks 2023-02-05 12:45:38 +07:00
Nicolas Fella 6c19e73367 Fix Wayland window activation when attaching to an existing instance
The application launching Dolphin passes a token via the XDG_ACTIVATION_TOKEN environment variable

We need to pass that to the running instance so that it can use it to raise itself
2022-10-14 14:46:29 +00:00
Laurent Montel e19aa49a08 Remove unused includes 2022-09-26 08:17:13 +02:00
Andrey Butirsky 5e84fffd6e DBus activation with filemanager iface
In Dolphin on wayland currently, if you right clicks a file and create a
zip file from it, Dolphin makes a new window.
What we want to happen is Dolphin to focus the window we have with the
file selected.

This patches Dolphin's dbusinterface.cpp to call
KWindowSystem::setCurrentXdgActivationToken()
with the startupID
2021-08-25 14:45:55 +00:00
Alex Richardson 531de16cd0 Avoid crashing on startup if DBus isn't running
I am trying to run Dolphin on a minimal FreeBSD CHERI-RISC-V QEMU
instance and I haven't got DBus running. Without this change, I get
crashes because QDBusConnection::sessionBus().interface() returns NULL
if DBus isn't running.
2021-07-10 20:18:28 +00:00
Marco Martin dbabe22249 Add SortOrderForUrl method to DBus interface
adds a method to ask what's the sorting strategy (column and order) for a particular Url, as Dolphin can have directory-specific sorting strategies

This makes possible for other apps that have lists of files, like Gwenview to use the same sorting when invoked from dolphin, ie opening an image

CCBUG:236059
2021-06-04 12:04:14 +00:00
Elvis Angelaccio 954e8c4790 Output of licensedigger + manual cleanup afterwards.
Unfortunately licensedigger does not strip the trailing * characters.
While at it, use a common style for all source files.
2020-08-25 17:07:38 +00:00
Elvis Angelaccio fa806d48da Exclude daemonized processes from Dolphin::attachToExistingInstance()
Summary:
`dolphin --daemon` does not have the `/dolphin/Dolphin_1` dbus path,
because it doesn't have any DolphinMainWindow.

Instead of working around this issue (as we did in D21666 and D25510),
just exclude these processes from the list of dbus instances checked by
`Dolphin::attachToExistingInstance()`.

CCBUG: 408244

Test Plan: Same test plan as in D21666 and D25510

Reviewers: #dolphin

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D26213
2020-03-16 22:38:40 +01:00
Elvis Angelaccio 16a3aea6a6 Remove unnecessary semicolons after Q_UNUSED
GIT_SILENT
2019-11-09 22:09:16 +01:00
Alexander Saoutkin 2647dc47d4 Adding option to open externally called folder in a new tab
Summary:
Adds an option to open externally called folder in a new tab.

By default this option is enabled

Test Plan:
If option selected:
1. All valid arguments passed to Dolphin should be opened in tabs of an instance(s) (if it exists). Duplicate tabs just change activation to current tab.

If option not selected:
1. All calls to Dolphin result in a new instance being opened

This option does not require Dolphin to be restarted to take effect.

Reviewers: #dolphin, elvisangelaccio, ngraham

Reviewed By: #dolphin, ngraham

Subscribers: broulik, ngraham, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D21736
2019-06-23 13:27:25 +02:00
Alexander Saoutkin 27e3907a3d Open externally called files/directories in new tabs
Summary:
FEATURE: 183429
FIXED-IN: 19.08.0
GUI: new cli argument --new-window

Externally called files/directories are opened in a a new tab of an instance of Dolphin that already exists. If any of the given URIs are already open in a tab, then those tabs are activated instead of a new tab being opened.  If there is no instance then the files/directories are opened in a new window. The newly opened file/directory has its tab activated, and consequently, the window is also activated.

When the user clicks "Open In New Window" or "Detach Tab", the files/directories are opened in a new window.

Test Plan:
[Manual]
Before testing, set the default file manager in system settings as the newly built Dolphin executable.
One must also include the new dolphin executable in the $PATH, otherwise some functions will attempt to open the system dolphin instead of the new one.

Furthermore, running two different versions of Dolphin (in particular, where one does not have this patch included) can result in bugs appearing, in particular, new tabs not opening as old instances will not recognise the DBus commands sent to it. However, I see no reason why a user will have two different versions of Dolphin (apart from people like us :D).

Open directories with the help of auxillary programs (i.e. a browser). The files/directories should appear in a new window if an instance does not exist. If an existence already exists, then a new tab should be opened and activated in that instance and the window activated.
Use QDBusViewer to open folders/items by calling the ShowFolders/ShowItems methods in org.freedesktop.FileManager1 of the Dolphin instance.
When a user chooses to "Open In New Window"/"Detach Tab" then the files/directories should be opened in a new window.

Reviewers: #dolphin, elvisangelaccio

Subscribers: zzag, dfaure, fvogt, fikrim, magar, fbg13, davidedmundson, kwin, ngraham, elvisangelaccio, anthonyfieroni, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D16648
2019-05-30 22:40:08 +02:00
David Edmundson cb6c71ae1b Keep org.freedesktop.FileManager1 registered across processes
Summary:
Currently if someone starts 2 dolphins, the second cannot register
org.freedesktop.FileManager1 meaning and when the first dolphin quits,
no-one has it registered.

It doesn't cause a huge problem right now as we just dbus-activate a new one if
needed, but it means the behaviour is a bit inconsistent and
non-optimal.

DBus has a system to queue names, meaning that as long as any dolphin is
running this name is owned by one of the processes.

Also this patch registers the service after the object which is
technically safer.

Test Plan:
Ran d-feet
Opened 2 dolphins, closed the first
Service was still registered and the PID of the owning process changed.

Reviewers: #dolphin, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Subscribers: elvisangelaccio, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D15539
2018-09-17 12:04:00 +02:00
Roman Inflianskas 48b58f830a Remove unused #include
Summary: I used CLion inspection to hunt all unused #include

Reviewers: #dolphin, elvisangelaccio, markg

Reviewed By: #dolphin, elvisangelaccio, markg

Subscribers: bcooksley, markg, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D10985
2018-03-04 21:00:47 +03:00
Kai Uwe Broulik b79ea9f5e4 Pass application name and icon to KRun
Otherwise this results in the generic executable icon as bouncy cursor.

Differential Revision: https://phabricator.kde.org/D4823
2017-03-08 16:52:15 +01:00
Kai Uwe Broulik 6bda60f1dd [DBusInterface] Use %U instead of %u to indicate multiple URLs are supported
Otherwise KRun opens a separate instance for every URL passed although Dolphin
already has logic to open different folders in tabs if neccessary.

REVIEW: 128306
2016-07-01 11:36:10 +02:00
Artur Puzio 5593c252e8 [CLAZY] Fixed all level 1 and level 2 warnings with small exceptions
REVIEW: 126771
2016-03-16 22:17:37 +01:00
Emmanuel Pescosta 44ac6bd5f8 Use KPropertiesDialog::showDialog(urls) in DBusInterface::ShowItemProperties
instead of showing a new properties dialog for each url.

REVIEW: 123524
2015-04-29 15:41:13 +02:00
Ashish Bansal 7042c6c289 Add dbus interface to dolphin
Implemented org.freedesktop.FileManager1 dbus interface in dolphin
http://www.freedesktop.org/wiki/Specifications/file-manager-interface/

REVIEW: 123313
BUG: 343016
2015-04-22 18:59:39 +05:30