c++ - open file folder in the directory -
I want my C ++ application to implement the functionality of "open file folders" like my Firefox and download manager . This is the code that I have come up with.
int file :: openTempFile (std :: string temp_file_dir) {std :: string file_path = temp_file_dir + "/"; File_path = file_path + this- & gt; Additional_info; // If you already have a temporary file, delete it // if (temporary_file! = "") {//: TODO: open temporary file stack // // when app deinit we remove those // (Temporary_file.c_str ()); } / * Write temporary file * / file * fp = fopen (file_path.c_str (), "w"); If returned (fp == NULL) wrong; Filitt (m_data, 1, m_size, fp); Fclose (fp); // Now open it using Netlus / Four * Permalink [] = {strdup ("nautilus"), strdup (file_path.c_str ())}; Int pid; If ((pid = fork ()) == -1) Pillar ("Kanka Fail"); If (pd == 0) {int a = execvp ("notilis", permliext); Printf ("exevp failed to load temporary file"); } Temporary_file = file_path; Return TRUE; }
But instead of a Nautilus window, it opens up 3 windows.What is the reason for any idea? And instead of showing it, how can Nautilus open "dialogue" on the directory?
When opening a folder, I will call xdg-open
Opens the specified folder with the specified desktop manager for.
When I am running KDE
, then to display it dolphin calls
, and xfce4
It invokes thunar
, because it is the preferred file manager according to my settings. I do not want to use notilis
because the interface is different from my favorite app, widgets In terms of style, other applications do not look consistent - and 'T group my taskbar There is only one.
It also uses different preferences for my default open-in settings, and struggles with my workflow.
Additionally, Nautilus
is not necessarily guaranteed on my system, for example, on some of my older systems, where I have encountered
On the custom Jeju system, where I am compelled by RAM or HDD space, only me to emerge
D twm
and xfce4
, hence the Nautilus
is not present.
As far as Nautilus-specific behavior is concerned, I have similar problems with Nautilus, which creates a desktop on initial invitations (as I ran the twm
Application options: -C, - Check self-test trials. Set up quick. Show version of version --version -g, --geometry = geometry Create initial window with given geometry -w, --new-window Always open a new window to browse a specified URI- n, --no-default-window Clearly specified URI To create Windows only - no-desktop desktop should never be managed (g settings ignore priority). --force-desktop Always manage the desktop (ignore GSettings preferences) -k, - Skip some Nautilus -s, - Select the specified URI in the original folder. Unfortunately, I can not help you use the "Open with ..." dialog, especially Nautilus
, though
code> Xdg-open A file is specified when the default application will be used. Probably the voting configuration (which can be in one of the many cascading override locations within the mimeapps.list
file: User-Desktop, User, Sysadmin-Desktop, Sysadmin, Default-Desktop, and Default ).
Comments
Post a Comment