From 4c6ed49e7da1885d9bbfbf4d3abe48af51682760 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 29 Mar 2017 17:52:08 +0200 Subject: [PATCH] fix #130 - mini explorer, flash icon to open folder, plasma 5, smb preffix --- src/ce_common.pas | 6 ++++-- src/ce_miniexplorer.lfm | 5 ++--- src/ce_miniexplorer.pas | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ce_common.pas b/src/ce_common.pas index 20e3aa63..b149a649 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -208,7 +208,7 @@ type (** * Lets the shell open a file. *) - function shellOpen(const fname: string; wait: boolean = true): boolean; + function shellOpen(fname: string; wait: boolean = true): boolean; (** * Returns true if anExeName can be spawn without its full path. @@ -895,7 +895,7 @@ begin {$ENDIF} end; -function shellOpen(const fname: string; wait: boolean = true): boolean; +function shellOpen(fname: string; wait: boolean = true): boolean; begin {$IFDEF WINDOWS} result := ShellExecute(0, 'OPEN', PChar(fname), nil, nil, SW_SHOW) > 32; @@ -904,6 +904,8 @@ begin try {$IFDEF LINUX} Executable := 'xdg-open'; + if (fname.length > 1) and (fname[1..2] = '//') then + fname := fname[2..fname.length]; {$ELSE} {$IFDEF DARWIN} Executable := 'open'; diff --git a/src/ce_miniexplorer.lfm b/src/ce_miniexplorer.lfm index 8a5a0b61..1460cb59 100644 --- a/src/ce_miniexplorer.lfm +++ b/src/ce_miniexplorer.lfm @@ -28,7 +28,7 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget Align = alTop Columns = < item - Width = 331 + Width = 333 end> ReadOnly = True ScrollBars = ssAutoBoth @@ -63,7 +63,6 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget Top = 0 Width = 335 Align = alTop - DefaultItemHeight = 16 Images = imgList ReadOnly = True ScrollBars = ssAutoBoth @@ -90,7 +89,7 @@ inherited CEMiniExplorerWidget: TCEMiniExplorerWidget AutoSort = False Columns = < item - Width = 331 + Width = 333 end> DragMode = dmAutomatic ReadOnly = True diff --git a/src/ce_miniexplorer.pas b/src/ce_miniexplorer.pas index db701bfd..969f0850 100644 --- a/src/ce_miniexplorer.pas +++ b/src/ce_miniexplorer.pas @@ -541,7 +541,7 @@ begin if lstFav.Selected.Data.isNil then exit; fname := PString(lstFav.Selected.Data)^; end; - if fname.fileExists or fname.dirExists then if not shellOpen(fname) then + if (fname.fileExists or fname.dirExists) and not shellOpen(fname) then getMessageDisplay.message((format('the shell failed to open "%s"', [shortenPath(fname, 25)])), nil, amcMisc, amkErr); end;