Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Link to the directory #432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JProof opened this issue Oct 3, 2020 · 24 comments
Closed

Link to the directory #432

JProof opened this issue Oct 3, 2020 · 24 comments

Comments

@JProof
Copy link

JProof commented Oct 3, 2020

Hi,
is it possible to insert a link to the already stored file in the edit-tab.
may be its easier to take the shooted file per drag&drop from the directory.

Now, if i want a file i do
"File" -> "Open" and look for the file.

thank you

@DamirPorobic
Copy link
Member

DamirPorobic commented Oct 3, 2020

I have this feature that I'm personally interested in #331

I was thinking about having a context menu that allows you to copy that path to clipboard and maybe open the parent folder.

Is that what you are looking for?

@JProof
Copy link
Author

JProof commented Oct 7, 2020

Hi Damir,
both is similar.
Copy the path -> paste the path in explorer -> enter
vs.
Click the path -> opens in explorer

Saves one ore two additional clicks/steps/task.
The ksnip is cool, i like it. my wish is only a productivity whish.

thank you

@DamirPorobic
Copy link
Member

Have you checked out latest version from continuous build? Both should be in there for tabs (Tab Context Menu).

@JProof
Copy link
Author

JProof commented Oct 7, 2020

Looks nice

my current Version is from the about tab
Version: 1.8.0
Build:

Using:
......

right click "copy path" works as expected.
right click "Open directory" does not work.

i use ubuntu, latest, logged in with a regular user(not root)

@DamirPorobic
Copy link
Member

You using Wayland or X11? What version of Ubuntu?

@JProof
Copy link
Author

JProof commented Oct 7, 2020

lsb_release -a => Ubuntu 20.04.1 LTS
echo $XDG_SESSION_TYPE => x11

@DamirPorobic
Copy link
Member

I was able to reproduce this issue only with snap. @JProof by any chance you're installing ksnip as snap?

@LyzardKing we might be missing some permissions again. Ksnip can now open the parent directory of a saved image but it doesn't work with the snap. I've tried with AppImage on Ubuntu, build from Source on openSUSE and exe on Windows, works.

@JProof
Copy link
Author

JProof commented Oct 10, 2020

@DamirPorobic yes, i have installed via snap.
should i build from source your "testversion" or an other snap?

sudo snap find ksnip
Name Version Herausgeber Hinweise Zusammenfassung
ksnip 1.7.2 dporobic - Qt based cross-platform screenshot tool that provides many annotation features for your screenshots.

@DamirPorobic
Copy link
Member

The open directory feature is only in the 1.8.0 version (edge). Version 1.7.2 is finished and there are no new features getting into this version. If you want for yourself to test this feature, you can build from source or even simpler, run the AppImage. In the snap version it's still not working, probably a missing permission from the snap build file. Hopefully we'll get that fixed quickly.

@LyzardKing
Copy link
Contributor

I'll look into it.
I'm using the snap and the copy path works, I had never seen the open folder option

@JProof
Copy link
Author

JProof commented Oct 10, 2020

hm tricky

cmake .. && make
CMake Error at CMakeLists.txt:37 (find_package):
Could not find a package configuration file provided by "ECM" with any of
the following names:

ECMConfig.cmake
ecm-config.cmake

Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR"
to a directory containing one of the above files. If "ECM" provides a
separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!
See also "/home/***/ksnip/build/CMakeFiles/CMakeOutput.log".

@JProof
Copy link
Author

JProof commented Oct 10, 2020

Hehe ...coool
Version: 1.8.0-continuous
Build: 1480-0d587cb

https://github.com/ksnip/ksnip/releases/download/continuous/ksnip-1.8.0-continuous-x86_64.AppImage

"Open Directory" will be active after first save.
opens the directory

Thank you ;-)

@JProof JProof closed this as completed Oct 10, 2020
@LyzardKing
Copy link
Contributor

@DamirPorobic In the snap it might work if you use os::system(“xdg-open url”) instead of the regular openUrl function, since it is missing a portal that would automate it. I believe it'll be included in future versions, but a fallback could be useful for now.

@LyzardKing
Copy link
Contributor

Apparently it's a bug in Qt (https://forum.snapcraft.io/t/xdg-open-or-gvfs-open-qdesktopservices-openurl-file-somelocation-file-txt-wont-open-the-file/16824/12)
In the confined app portal, the OpenURI will not work with local files, for that there's the OpenFile function, but Qt has to implement it
https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.portal.OpenURI

@DamirPorobic
Copy link
Member

Any workaround for that? I'm not sure what kind of call os::system(“xdg-open url”) is and where to use it?

@LyzardKing
Copy link
Contributor

In the place of this line...https://github.com/ksnip/ksnip/blob/master/src/gui/desktopService/DesktopServiceAdapter.cpp#L24
That is where the open Directory function is implemented, right?

@LyzardKing
Copy link
Contributor

url is the path.. I forgot to edit it

@LyzardKing
Copy link
Contributor

The function would become something like:

void DesktopServiceAdapter::openFile(const QString &path)
{
	if (PlatformChecker::instance()->isSnap()) {
		os::system(“xdg-open ” + path);
	}
	else {
		QDesktopServices::openUrl(QUrl::fromLocalFile(path));
	}
}

@DamirPorobic
Copy link
Member

My issue here is that I don't know where this os comes from. Quickly googling I see this only popping up as python library.
Can you share the link where you found the suggestion to use it?

@DamirPorobic
Copy link
Member

The related Qt bug is https://bugreports.qt.io/browse/QTBUG-83939, just for docu.

@DamirPorobic
Copy link
Member

Pushed a fix with a workaround, let's wait for the snap store to build the snaps and then test.

@DamirPorobic
Copy link
Member

@LyzardKing my fix seems to be not working yet. It involves starting a process for xdg-open passing the path that needs to be opened. Could it be that we need to allow xdg-open to be allowed as it's own process?

@LyzardKing
Copy link
Contributor

It works for me in the latest edge snap...

@DamirPorobic
Copy link
Member

oh, ok, thats great. Maybe I have tested wrong. Thanks anyways :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants