summaryrefslogtreecommitdiffstats
path: root/audio/easymp3gain/patches/02_filechooser.patch
blob: 386602804fe6e037eb850d3a64d1066ddb00ac6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Ignore some files after selecting a directory.
 Hidden or not writeable files cause easyMp3Gain to crash sometimes.
Forwarded: yes
Author: Matthias Klumpp <matthias@nlinux.org>
Last-Update: 2010-06-28

--- a/unitmain.pas
+++ b/unitmain.pas
@@ -263,6 +263,10 @@
     begin
       if (ExtractFileExt(SR.Name)='.'+Extension[i]) and
         not ((faDirectory and SR.Attr)=faDirectory) then
+        {$IFDEF Unix}
+        //Check if file is writeable and not hidden
+        if (SR.Name[1]<>'.')and(fpaccess(FilePath + SR.Name ,W_OK)=0) then
+        {$ENDIF}
         ListBox.Add(FilePath + SR.Name);
     end;
     if (SubLevelMax>0) and (((faDirectory or faSymLink) and SR.Attr)=faDirectory) then  //Directories
@@ -670,6 +674,7 @@
   sublevels: Byte;
 begin
   if not SelectDirectoryDialog.Execute then exit;
+  if not DirectoryExists(SelectDirectoryDialog.FileName) then exit;
   Application.ProcessMessages;
   if Sender=mnuFileAddFolderRecursive then
     sublevels := MediaGainOptions.SubLevelCount