View Issue Details

IDProjectCategoryView StatusLast Update
0037157LazarusLCLpublic2020-06-02 10:37
ReporterJoeny Ang Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.1 (SVN) 
Summary0037157: [Patch] GTK2 OpenDocument() function does not open folders
DescriptionGTK2 OpenDocument() function does nothing if a folder is passed as parameter. The "Open folder" popupmenu item of the IDE's source editor and project inspector does not work.
TagsNo tags attached.
Fixed in Revisionr63276
LazTarget-
WidgetsetGTK 2
Attached Files

Activities

Joeny Ang

2020-06-01 05:48

reporter  

gtk2-opendocument-does-not-open-folders.patch (368 bytes)   
--- lcl/include/sysenvapis_unix.inc.orig
+++ lcl/include/sysenvapis_unix.inc
@@ -37,7 +37,7 @@
   end;
 
   Result := True;
-  if not FileExistsUTF8(APath) then exit(false);
+  if not FileExistsUTF8(APath) and not DirectoryExistsUTF8(APath) then exit(false);
 
   lApp:=FindFilenameOfCmd('xdg-open'); // Portland OSDL/FreeDesktop standard on Linux
   if lApp='' then

Juha Manninen

2020-06-01 23:38

developer   ~0123170

Indeed it idoes not work now.
It used to work. Do you know which revision broke it?

Joeny Ang

2020-06-02 03:49

reporter   ~0123174

I believe it's in FPC r43111, where the function FileExists() in rtl/unix/sysutils.pp was modified to return False for directories. This function used to return True if a directory was passed, thus the FileExistsUTF8(APath) check in lcl/include/sysenvapis_unix.inc will return True for directories.

Juha Manninen

2020-06-02 08:58

developer   ~0123181

Last edited: 2020-06-02 09:38

View 2 revisions

Yes, incidentally I also use FPC trunk now from maybe 2 months ago. Thanks for the patch.

BTW, this was related to OS (Unix and such), not to widgetset.

Joeny Ang

2020-06-02 10:37

reporter   ~0123188

Ok, Thanks :)

Issue History

Date Modified Username Field Change
2020-06-01 05:48 Joeny Ang New Issue
2020-06-01 05:48 Joeny Ang File Added: gtk2-opendocument-does-not-open-folders.patch
2020-06-01 23:38 Juha Manninen Note Added: 0123170
2020-06-02 03:49 Joeny Ang Note Added: 0123174
2020-06-02 07:00 Juha Manninen Assigned To => Juha Manninen
2020-06-02 07:00 Juha Manninen Status new => assigned
2020-06-02 08:58 Juha Manninen Status assigned => resolved
2020-06-02 08:58 Juha Manninen Resolution open => fixed
2020-06-02 08:58 Juha Manninen Fixed in Revision => r63276
2020-06-02 08:58 Juha Manninen LazTarget => -
2020-06-02 08:58 Juha Manninen Widgetset GTK 2 => GTK 2
2020-06-02 08:58 Juha Manninen Note Added: 0123181
2020-06-02 09:38 Juha Manninen Note Edited: 0123181 View Revisions
2020-06-02 10:37 Joeny Ang Note Added: 0123188