Commit graph

152 commits

Author SHA1 Message Date
Kai Uwe Broulik 90770d305a Create thumbnails with scene devicePixelRatio 2023-11-21 13:54:25 +01:00
Nate Graham 70e20a310a Make "don't run me with sudo/kdesu" message informative
We tell users what not to do, but we don't tell then what to do instead.
At one point we told them to just use Dolphin normally and the polkit
integration would kick in, but that work ended up being reverted and
abandoned. Instead, tell them to use kio-admin, which exists as a
released product and will hopefully not get removed anytime soon.

CCBUG: 467948
2023-04-05 16:17:56 +00:00
Serg Podtynnyi 38c34eeca3 Add clang-format and format code as in Frameworks 2023-02-05 12:45:38 +07:00
Bharadwaj Raju 3c48004086 Fix sudo message
We don't have KIO PolKit support yet
2023-01-29 10:46:12 +00:00
Nicolas Fella 6d21deb6e4 Properly use X11 startup ids
When one instance of Dolphin activates another it passes a startupId (X11) / activation token (wayland) along.

On X11 this is passed using the DESKTOP_STARTUP_ID environment variable. The code tries to read that through KStartupInfo::startupId().

That doesn't work though, since Qt at startup reads the environment variable afterwards. However, it is nice enough to allow us to access
it through QX11Info::nextStartupId(). Use that to read the token in the first instance and pass it to the second instance like we do on Wayland

The user-facing impact of this is minimal since KStartupInfo::setNewStartupId internally falls back to KWindowSystem::forceActiveWindow when no
startupId is passed.
2022-12-30 12:33:01 +00:00
ivan tkachenko a19f29f4e5
Ensure there's a dot at the end of each --help options description
It will help make --help output more uniform, which in turn will be used
in Tab-completions for zsh.
2022-12-12 21:19:41 +03: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
Elvis Angelaccio 19cd2364a9 Update copyright and maintainership info 2022-08-05 17:40:20 +02:00
Ahmad Samir 28a74d1780 Use cmakedefine01
This way we get a build time warning if the var isn't defined at all, e.g.
a missing check_include_files() CMake call.
2022-06-15 11:28:42 +02:00
Ahmad Samir 8a0003bfbc Use one config-dolphin.h.cmake configuration file 2022-06-15 11:27:55 +02:00
Laurent Montel 6ee1e01eb0 It's enabled by default in qt6 2022-05-31 21:13:09 +02:00
Ahmad Samir 5d3774aa17 Kdelibs4ConfigMigrator is deprecated in KF6 2022-05-31 14:25:13 +00:00
Claudio Cambra 3abc4cfcd4 Add Flatpak patches to Dolphin depending on CMake definition
When Dolphin gets packaged as a flatpak, this patch gets applied:

https://invent.kde.org/packaging/flatpak-kde-applications/-/blob/master/dolphinpatch.patch

That's not really an ideal solution, so this is probably a better idea -- to upstream the patches and apply them depending on a CMake definition
2022-01-04 21:53:44 +00:00
Nate Graham 28ecfd5a34 Improve sudo/kdesu error message
Now that you can get elevated privileges while using the app, we can
display a more useful and descriptive error message when people try to
run Dolphin using `sudo` or `kdesu`.

Also bump the frameworks dependency to 5.90 since that's the KIO
version that includes this change, so we can be sure that the message is
always accurate.
2021-12-31 10:38:19 -07:00
Nate Graham d472cb2a25 Merge branch 'release/21.08' 2021-08-02 10:32:31 -06:00
Jordan Bucklin f190ae1cf8 Fix how --select treats files
Previously, when passing file URLs with the --select option,
Dolphin would open the file in its corresponding application, as
well as opening an empty tab in Dolphin as if the file were a
directory. This happens specifically when trying to restore a
session.

This commit prevents Dolphin from opening a file in an application
and from opening an empty tab while passing the --select option,
and selects the URLs instead.

BUG: 436584
2021-08-01 15:54:08 -07:00
Nate Graham ea7d4f059d Revert "Don't session-restore invalid paths"
This reverts commit c733b3aa97.

There are people who prefer the old behavior of session-restoring all
paths including the ones which are currently inaccessible. The idea is
that Dolphin is like a web browser; if a website is not currently
available, the browser tells you that instead of silently discarding the
URL and showing you the homepage. Doing this can be considered a form
of data loss.

In addition, the reason for the change was to prevent Dolphin from
showing invalid paths on launch for unmounted removable disks, but that
specific case was fixed separately by switching to ~ for any tabs/views
that were showing locations on a just-unmounted removable disk. So you
will never run into the problem if yo unmount a disk in Dolphin and then
close it.

Accordingly, let's revert the change because it causes more problems than
it resolves.

BUG: 439864
CCBUG: 427619
FIXED-IN: 21.08
2021-07-28 12:59:29 -06:00
Méven Car 6f632283d0 Allow to have HiDpi previews
BUG: 401170
2021-07-16 06:53:32 +00:00
Alex Richardson 3fdd93db97 Don't exit immediately 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, KDBusService
causes dolphin to exit immediately since the default behaviour is to
exit if it can't connect to DBus.
2021-07-10 20:18:28 +00:00
Nicolas Fella 9e8e58147e Port away from KInit
KInit is planned to go away

https://phabricator.kde.org/T14298
2021-03-28 17:11:36 +02:00
Felix Ernst 50ca5af7e0 Allow having the UrlNavigators below the tab bar
This commit restores the possibility to have the UrlNavigators below
the tab bar. This will happen automatically whenever the UrlNavigator
is removed from the toolbar.

It is also now again possible to have the toolbar on the side. This
option is disabled while the toolbar contains the UrlNavigators.

This commit makes no changes to the new default which is having the
UrlNavigators in the toolbar but makes sure that upgrading users won't
be affected.
2020-11-19 21:22:27 +00:00
Felix Ernst 37327c9b0a Make UrlNavigators in the toolbar the only option
The UrlNavigators will be automatically added to the toolbar. The Sort By
action is removed from the default toolbar to make space.

Remove all options to have UrlNavigators outside the toolbar and remove
those code paths.

Make it so the new NavigatorsWidgetAction contains two UrlNavigators when
in split view mode. Spacing was also added to align these UrlNavigators
with the ViewContainers when enough space is available.

Force the toolbar to be either at the top or bottom of the window.

Set a sane sizeHint for DolphinUrlNavigator. It would be better to do this
in KUrlNavigator in the future.

This commit also contains a changes which should be moved to a separate
merge requests before this gets merged:
- Add an expansion animation when split view is enabled by the user
2020-11-09 23:49:07 +01:00
Elvis Angelaccio 465e06138e Add support for KUserFeedback
This commit introduces KUserFeedback in dolphin with some basic data
sources and with a settings page to configure the telemetry values.

There are also a couple custom data sources as proof of concept: a bunch
of settings and the count of available network shares as listed by Solid.

The settings page is shown only if the user feedback framework is
enabled, but currently in Plasma we don't have a global kill switch to
disable it.

At the moment we never show an encouragement message. We need to connect
to the `Provider::showEncouragementMessage()` signal, but first we
should agree to a common way to show a non-annoying message to the users.
2020-11-05 18:31:28 +00:00
Nate Graham bf11c835eb Disable session management for daemon
We don't need to autostart the daemon if it was running at logout.

BUG: 417219
FIXED-IN: 20.12
2020-10-29 15:00:39 -06:00
Nate Graham c733b3aa97 Don't session-restore invalid paths
When session restore is populating the main window, it's unconditional;
you'll get whatever was there before. This can be a problem if any of
those things are now missing. For example, maybe you were browsing files
on a removable disk, then quit Dolphin, and finally removed the disk. The
next time you launch Dolphin again, it will try to show you the
view from the now-missing removable disk.

To prevent this, we now look at all the URLs in all of the view
containers that were created after session-restore has finished doing
its thing; if any of them are invalid local URLs, we change the URL to
the home folder instead to avoid showing the user a view with an invalid
location in it.

BUG: 427619
FIXED-IN: 20.12
2020-10-23 17:00:09 +00:00
Nate Graham 4937992e93 When restoring former window state, append any URLs passed as args
Before, when Dolphin was closed but opened with any URLs, it would open
a new window with only those URLs, rather than restoring any window
state (if the user has this feature enabled).

Now, Dolphin will first restore state (if enabled) and then append any
URLs, rather than replacing the existing set of URLs.

The "new instance" case was previously handled automatically and now
needs to be explictly handled by checking for it, to make sure that new
instances give you a clean window rather than a state-restored window.

BUG: 427274
FIXED-IN: 20.12
2020-10-11 17:02:49 +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
Antonio Rojas ce981c3e4a Fix "Show folders, tabs, and window state from last time" feature
We were using the DBus interface before declaring it, oops.

BUG: 422300
FIXED-IN: 20.08.0
2020-07-19 08:03:56 -06:00
Nate Graham caf2fe1c43 Add an option to show tabs from last time when Dolphin starts
Summary:
All modern web browsers offer a function to show tabs from last time when a browser starts, and many apps today
restore their prior state when they're launched. This patch implements thatfunctionality as an option and turns it on by default.

The settings window is accordingly adjusted to be clear about what applies when:

{F7681752}

FEATURE: 413564
FIXED-IN: 20.08.0

Depends on D25106
Depends on D25219

Test Plan:
With the new setting turned off:
- No behavioral changes at all

With the new setting turned on:
- When launched from the GUI or CLI without any URLs, dolphin restores session
- When rebooting with Dolphin open, it restores session normally after the system comes back (i.e. no behavioral change here)
- When launched with URLs, Dolphin window is opened showing those URLs instead of restoring session
- When Dolphin is already running and a new window is opened, that new window shows a single tab with the same URL as was visible in the previously-open Dolphin instance (i.e. no behavioral change here)
- "Open Containing folder" functionality in other apps works regardless of whether or not Dolphin is running

Reviewers: #dolphin, #vdg, feverfew, meven, elvisangelaccio, ndavis

Reviewed By: #dolphin, #vdg, feverfew, elvisangelaccio, ndavis

Subscribers: davidedmundson, ndavis, intika, feverfew, kfm-devel, ngraham, broulik, #dolphin

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D11382
2020-04-26 12:14:56 -06: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
Nate Graham 2310e33b7a Correct invalid homepage URL
BUG: 414901
FIXED-IN: 19.12.1
2019-12-06 12:41:33 -07:00
Christoph Cullmann 0caab3c0a2 properly enable hi-dpi support 2019-10-13 18:33:53 +02:00
Alexander Saoutkin 56b3059f77 Making sure that DBus objects are all created before the service
Summary:
Currently the DBus service is created before the MainWindow DBus object is
created. This can cause hangs if another service makes calls to a a method
in an object that's not been initialised, when the service is already published.
This patch defers the creation of the service until all DBus objects are
created.

Test Plan:
Tested in KDevelop. Have "open new folders in tabs" feature enabled.
Open several folders with Dolphin at once. Before this patch
there would be noticeable hanging. With this patch all tabs instantly open with
no hanging.

Reviewers: elvisangelaccio, ngraham

Reviewed By: elvisangelaccio

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D23672
2019-09-02 23:13:53 +02:00
Alexander Saoutkin 91709cb6fe Fixing bug where split view opens with no URLs
Summary:
BUG: 411193
FIXED-IN: 19.08.1

Test Plan:
Reproduce steps as given in bug report. Observe the exected result.
Used qdbusviewer and ShowFolders method to observe that no regressions occured
in the "open new folders in tabs" feature.

Reviewers: elvisangelaccio, ngraham

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D23445
2019-08-25 10:36:07 -06:00
Alexander Saoutkin d2506ffa63 Open new instance of Dolphin if no URLs are given
Summary:
BUG: 408387
BUG: 408244
FIXED-IN: 19.08.0

Currently Dolphin only opens a new instance of itself in the following two scenarios:
1. No other Dolphin instances ( D21666 deals with not matching daemonized instances) are currently running.
2. A new instance is explicitly asked for via:  `dolphin --new-window`

A third scenario is needed to fix this bug:
3. If no URLs are passed in as arguments then open a new instance.

This patch adds this third scenario.

Test Plan:
STEPS TO REPRODUCE
1. Open Dolphin
2. Right-click on Dolphin's Task Manager Entry and click "Start New Instance"
3. A new instance is created.

As my system stuff is not built on master I am unable to replicate the bug (and can't confirm whether this fixes it), hence I'll rely on @ngraham to confirm whether this patch fixes the issue.

Reviewers: ngraham, elvisangelaccio

Reviewed By: ngraham, elvisangelaccio

Subscribers: elvisangelaccio, ngraham, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D21691
2019-06-22 15:47:00 +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
Friedrich W. H. Kossebau 1cde03cdfe Use https over http for homepage url 2019-01-04 22:22:07 +01:00
Elvis Angelaccio 23350914f6 Update copyright year in KAboutData
GIT_SILENT
2018-11-11 19:00:24 +01:00
Elvis Angelaccio e87771abec Update maintainership in KAboutData
As discussed on kfm-devel and agreed upon with Emmanuel.
2018-11-04 21:21:19 +01:00
Elvis Angelaccio 9be80423dc Drop redundant setAttribute for WA_DeleteOnClose
Every KMainWindow (which DolphinMainWindow inherits) already has this
attribute set.
2018-07-29 23:37:34 +02:00
Laurent Montel 26e629a78e Do not duplicate work of KAboutData::setupCommandLine() 2018-06-19 08:57:39 +02:00
Nathaniel Graham 40453cb627 Re-allow running Dolphin as the root user (but still not using sudo)
Summary:
Prohibiting the use of Dolphin as the actual root user (not using `sudo` or `kdesu`) breaks legitimate use cases for using the root user. An example is Kali, a distro that logs in as the root user by default as a deliberate design choice.

In such an environment, there is no additional security vulnerability beyond what you're already potentially exposing yourself to. So, let's re-enable it.

BUG: 387974
FIXED-IN: 18.08.0

Test Plan:
- Log in as normal user and run `sudo dolphin`: you get an error message.
- Log in as normal user and run `kdesu dolphin`: you get an error message.
- Log in as the root user and run dolphin normally: it works.

Reviewers: markg, elvisangelaccio, #dolphin

Reviewed By: markg

Subscribers: chinmoyr, cfeck, elvisangelaccio, mmustac, Fuchs, markg, graesslin, nicolasfella, zzag, kfm-devel, emmanuelp

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D12795
2018-05-31 12:18:18 -06: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
Roman Inflianskas 848abc5922 Remove unused #include
Summary: I used CLion inspection to hunt all unused #include

Reviewers: #dolphin, elvisangelaccio, markg

Reviewed By: #dolphin, elvisangelaccio, markg

Subscribers: markg, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D10985
2018-03-03 17:08:01 +03:00
Emmanuel Pescosta 0bdd8e0b05
Disallow executing Dolphin as root on Linux
Basically a copy of commit kate/9adcebd3c2e476c8a32e9b455cc99f46b0e12a7e which was
written by Martin Grässlin.
2017-02-19 02:39:52 +01:00
R.J.V. Bertin ded92cc32a Use the current window icon in QIcon::fromTheme()
This prevents removing the application icon when icon lookup fails, on
Mac or MS Windows.
2016-11-22 17:55:34 +01:00
Frederik Schwarzer 1649a0f890 Change wording of Directory to Folder. 2016-05-05 13:43:02 +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
Frank Reininghaus adb7c47885 Update copyright year 2016-01-14 20:45:49 +01:00