Bug 386314 - install to a custom location doesn't work correctly
Summary: install to a custom location doesn't work correctly
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-29 06:58 UTC by Nikita Melnichenko
Modified: 2018-05-06 00:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshots (23.21 KB, image/png)
2017-10-29 06:58 UTC, Nikita Melnichenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Melnichenko 2017-10-29 06:58:33 UTC
Created attachment 108622 [details]
screenshots

"arrow-up" and "exchange-positions" buttons become missing on master branch. The regression is introduced in 03d2b961ef5f77c4f7491123b1a46487a50edd27. At d101866a0fca114236f89a8c6e2f5b0ec550bff9 the buttons are still visible.

Console output after opening krusader contains:

23:39:25.410-warning default unknown@0 # layout: no such widget: "inlineRefreshCancelButton"
23:39:25.410-warning default unknown@0 # layout: no such widget: "popupPositionBtn"
23:39:25.410-warning default unknown@0 # layout: no such widget: "popupBtn"
23:39:25.410-warning default unknown@0 # widget "cancelProgressButton" was not added to the layout
23:39:25.410-warning default unknown@0 # widget "sidebarPositionButton" was not added to the layout
23:39:25.410-warning default unknown@0 # widget "sidebarButton" was not added to the layout
23:39:25.410-warning default unknown@0 # widget "cancelQuickSizeCalcButton" was not added to the layout
23:39:25.410-warning default unknown@0 # widget "quickSizeCalcProgress" was not added to the layout
Comment 1 Alex Bikadorov 2017-10-29 15:04:57 UTC
>git show 03d2b9 --stat | grep "\.xml"
You have to remove/overwrite the layout.xml with the new version.
Path: <home_dir>/.local/share/krusader/layout.xml
Comment 2 Nikita Melnichenko 2017-10-31 06:02:17 UTC
(In reply to Alex Bikadorov from comment #1)
> You have to remove/overwrite the layout.xml with the new version.
> Path: <home_dir>/.local/share/krusader/layout.xml

I'm not sure why you marked this as invalid. For dev branch it's fine, but I think almost every user of 2.6.0 will be affected once the next version is released. How will they know that they need to update the layout.xml in some folder? Would it be a popup with config upgrade instructions? Why not make this automatic?
Comment 3 Nikita Melnichenko 2017-11-30 05:11:01 UTC
Due to no response I'm changing status as it seems to be a release blocker. IMO, for an unstable branch it's fine, however the issue should be addressed before the release is stabilized.
Comment 4 Alex Bikadorov 2018-01-07 18:43:18 UTC
Sorry for the late reply. 
The layout.xml under ~./local should normally not exist. I can't ad hoc say when it is created but if you are using distro packages or correctly installing from source, it should not be there.
Comment 5 Nikita Melnichenko 2018-01-28 07:43:45 UTC
Actually, the layout.xml under ~./local is not a problem. The app reads /usr/share/krusader/layout.xml which is from old 2.6.0 version. The file is installed by a package manager.

In the code it comes from QStandardPaths::DataLocation - I'm not sure how to overcome the problem properly. Is this supposed to be sensitive to install prefix? CMAKE_INSTALL_PREFIX="/usr/local" doesn't solve the problem. Any hints are appreciated.
Comment 6 Nikita Melnichenko 2018-02-18 22:13:37 UTC
Based on the additional discussion at https://phabricator.kde.org/D9975 (Allow rootless 'make install' with non-standard CMAKE_INSTALL_PREFIX), I decided to reopen and change the title from the "Sidebar (Popup panel previously) buttons are missing" to "install to a custom location doesn't work correctly".

The known issue is in layout.xml loader that ignores custom install location set by CMAKE_INSTALL_PREFIX, however there could be other resources I'm not aware of.

Just want us to track this problem, because there are environments where privileged access is not an option.
Comment 7 Nikita Melnichenko 2018-04-10 05:10:43 UTC
Git commit 21b8a447187bcbdfee06aa967cef8b368f18f62d by Nikita Melnichenko.
Committed on 10/04/2018 at 05:09.
Pushed by melnichenko into branch 'master'.

Changed loading of layout.xml from resource system only

layout.xml is a static file, so it's safe to load it from resource.
In the same time, if layout.xml is changed like it happened after v2.6,
this way doesn't introduce problems with loading incorrect layout.
Incorrect layout was loaded if v2.6 is installed through
a package manager and we run locally compiled / installed exe.

FIXED: [ 386314 ] Install to a custom location doesn't work correctly

Differential Revision: https://phabricator.kde.org/D12061

M  +4    -12   krusader/Panel/krlayoutfactory.cpp
M  +1    -1    krusader/Panel/krlayoutfactory.h

https://commits.kde.org/krusader/21b8a447187bcbdfee06aa967cef8b368f18f62d