Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
95fdd8d6
Unverified
Commit
95fdd8d6
authored
Dec 12, 2025
by
Eva H
Committed by
GitHub
Dec 12, 2025
Browse files
fix: select and update models folder in settings (#13412)
parent
9f782285
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
30 deletions
+38
-30
app/dialog/cocoa/dlg.m
app/dialog/cocoa/dlg.m
+37
-27
app/server/server.go
app/server/server.go
+1
-3
No files found.
app/dialog/cocoa/dlg.m
View file @
95fdd8d6
...
...
@@ -169,37 +169,47 @@ DlgResult fileDlg(FileDlgParams* params) {
}
NSArray
*
urls
=
[
panel
URLs
];
if
(
self
->
params
->
allowMultiple
&&
[
urls
count
]
>=
1
)
{
if
([
urls
count
]
==
0
)
{
return
DLG_CANCEL
;
}
if
(
self
->
params
->
allowMultiple
)
{
// For multiple files, we need to return all paths separated by null bytes
char
*
bufPtr
=
self
->
params
->
buf
;
int
remainingBuf
=
self
->
params
->
nbuf
;
// Calculate total required buffer size first
int
totalSize
=
0
;
for
(
NSURL
*
url
in
urls
)
{
char
tempBuf
[
PATH_MAX
];
if
(
!
[
url
getFileSystemRepresentation
:
tempBuf
maxLength
:
PATH_MAX
])
{
return
DLG_URLFAIL
;
}
totalSize
+=
strlen
(
tempBuf
)
+
1
;
// +1 for null terminator
}
totalSize
+=
1
;
// Final null terminator
if
(
totalSize
>
self
->
params
->
nbuf
)
{
// Not enough buffer space
return
DLG_URLFAIL
;
}
// Now actually copy the paths (we know we have space)
bufPtr
=
self
->
params
->
buf
;
for
(
NSURL
*
url
in
urls
)
{
char
tempBuf
[
PATH_MAX
];
[
url
getFileSystemRepresentation
:
tempBuf
maxLength
:
PATH_MAX
];
int
pathLen
=
strlen
(
tempBuf
);
strcpy
(
bufPtr
,
tempBuf
);
bufPtr
+=
pathLen
+
1
;
}
*
bufPtr
=
'\0'
;
// Final null terminator
// Calculate total required buffer size first
int
totalSize
=
0
;
for
(
NSURL
*
url
in
urls
)
{
char
tempBuf
[
PATH_MAX
];
if
(
!
[
url
getFileSystemRepresentation
:
tempBuf
maxLength
:
PATH_MAX
])
{
return
DLG_URLFAIL
;
}
totalSize
+=
strlen
(
tempBuf
)
+
1
;
// +1 for null terminator
}
totalSize
+=
1
;
// Final null terminator
if
(
totalSize
>
self
->
params
->
nbuf
)
{
// Not enough buffer space
return
DLG_URLFAIL
;
}
// Now actually copy the paths (we know we have space)
bufPtr
=
self
->
params
->
buf
;
for
(
NSURL
*
url
in
urls
)
{
char
tempBuf
[
PATH_MAX
];
[
url
getFileSystemRepresentation
:
tempBuf
maxLength
:
PATH_MAX
];
int
pathLen
=
strlen
(
tempBuf
);
strcpy
(
bufPtr
,
tempBuf
);
bufPtr
+=
pathLen
+
1
;
}
*
bufPtr
=
'\0'
;
// Final null terminator
}
else
{
// Single file/directory selection - write path to buffer
NSURL
*
url
=
[
urls
firstObject
];
if
(
!
[
url
getFileSystemRepresentation
:
self
->
params
->
buf
maxLength
:
self
->
params
->
nbuf
])
{
return
DLG_URLFAIL
;
}
}
return
DLG_OK
;
...
...
app/server/server.go
View file @
95fdd8d6
...
...
@@ -224,9 +224,7 @@ func (s *Server) cmd(ctx context.Context) (*exec.Cmd, error) {
if
_
,
err
:=
os
.
Stat
(
settings
.
Models
);
err
==
nil
{
env
[
"OLLAMA_MODELS"
]
=
settings
.
Models
}
else
{
slog
.
Warn
(
"models path not accessible, clearing models setting"
,
"path"
,
settings
.
Models
,
"err"
,
err
)
settings
.
Models
=
""
s
.
store
.
SetSettings
(
settings
)
slog
.
Warn
(
"models path not accessible, using default"
,
"path"
,
settings
.
Models
,
"err"
,
err
)
}
}
if
settings
.
ContextLength
>
0
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment