Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
08017d0a
Commit
08017d0a
authored
14 years ago
by
callum
Browse files
Options
Downloads
Patches
Plain Diff
Addenum to EXP-94 Disable local file system access - also handle dir picker selection too
parent
ad440a68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/lldirpicker.cpp
+39
-1
39 additions, 1 deletion
indra/newview/lldirpicker.cpp
indra/newview/lldirpicker.h
+1
-0
1 addition, 0 deletions
indra/newview/lldirpicker.h
with
40 additions
and
1 deletion
indra/newview/lldirpicker.cpp
+
39
−
1
View file @
08017d0a
...
...
@@ -35,6 +35,7 @@
#include
"llframetimer.h"
#include
"lltrans.h"
#include
"llwindow.h"
// beforeDialog()
#include
"llviewercontrol.h"
#if LL_LINUX || LL_SOLARIS
# include "llfilepicker.h"
...
...
@@ -53,6 +54,23 @@ LLDirPicker LLDirPicker::sInstance;
//
// Implementation
//
// utility function to check if access to local file system via file browser
// is enabled and if not, tidy up and indicate we're not allowed to do this.
bool
LLDirPicker
::
check_local_file_access_enabled
()
{
// if local file browsing is turned off, return without opening dialog
bool
local_file_system_browsing_enabled
=
gSavedSettings
.
getBOOL
(
"LocalFileSystemBrowsingEnabled"
);
if
(
!
local_file_system_browsing_enabled
)
{
mDir
.
clear
();
// Windows
mFileName
=
NULL
;
// Mac/Linux
return
false
;
}
return
true
;
}
#if LL_WINDOWS
LLDirPicker
::
LLDirPicker
()
:
...
...
@@ -72,6 +90,13 @@ BOOL LLDirPicker::getDir(std::string* filename)
{
return
FALSE
;
}
// if local file browsing is turned off, return without opening dialog
if
(
check_local_file_access_enabled
()
==
false
)
{
return
FALSE
;
}
BOOL
success
=
FALSE
;
// Modal, so pause agent
...
...
@@ -231,7 +256,13 @@ BOOL LLDirPicker::getDir(std::string* filename)
if
(
mLocked
)
return
FALSE
;
BOOL
success
=
FALSE
;
OSStatus
error
=
noErr
;
// if local file browsing is turned off, return without opening dialog
if
(
check_local_file_access_enabled
()
==
false
)
{
return
FALSE
;
}
mFileName
=
filename
;
// mNavOptions.saveFileName
...
...
@@ -289,6 +320,13 @@ void LLDirPicker::reset()
BOOL
LLDirPicker
::
getDir
(
std
::
string
*
filename
)
{
reset
();
// if local file browsing is turned off, return without opening dialog
if
(
check_local_file_access_enabled
()
==
false
)
{
return
FALSE
;
}
if
(
mFilePicker
)
{
GtkWindow
*
picker
=
mFilePicker
->
buildFilePicker
(
false
,
true
,
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lldirpicker.h
+
1
−
0
View file @
08017d0a
...
...
@@ -75,6 +75,7 @@ class LLDirPicker
};
void
buildDirname
(
void
);
bool
check_local_file_access_enabled
();
#if LL_DARWIN
NavDialogCreationOptions
mNavOptions
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment