Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5f6c37b1
Kaydet (Commit)
5f6c37b1
authored
Eki 02, 2011
tarafından
Pierre-André Jacquod
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cppcheck reduce scope of var in shell/...gconfaccess.cxx
üst
b88e1f5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
82 deletions
+70
-82
gconfaccess.cxx
shell/source/backends/gconfbe/gconfaccess.cxx
+70
-82
No files found.
shell/source/backends/gconfbe/gconfaccess.cxx
Dosyayı görüntüle @
5f6c37b1
...
...
@@ -109,7 +109,6 @@ static OUString xdg_user_dir_lookup (const char *type)
{
char
*
config_home
;
char
*
p
;
int
relative
;
bool
bError
=
false
;
osl
::
Security
aSecurity
;
...
...
@@ -121,112 +120,101 @@ static OUString xdg_user_dir_lookup (const char *type)
if
(
!
aSecurity
.
getHomeDir
(
aHomeDirURL
)
)
{
osl
::
FileBase
::
getFileURLFromSystemPath
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/tmp"
)),
aDocumentsDirURL
);
return
aDocumentsDirURL
;
osl
::
FileBase
::
getFileURLFromSystemPath
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/tmp"
)),
aDocumentsDirURL
);
return
aDocumentsDirURL
;
}
config_home
=
getenv
(
"XDG_CONFIG_HOME"
);
if
(
config_home
==
NULL
||
config_home
[
0
]
==
0
)
{
aConfigFileURL
=
OUString
(
aHomeDirURL
);
aConfigFileURL
+=
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/.config/user-dirs.dirs"
));
aConfigFileURL
=
OUString
(
aHomeDirURL
);
aConfigFileURL
+=
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/.config/user-dirs.dirs"
));
}
else
{
aConfigFileURL
=
OUString
::
createFromAscii
(
config_home
);
aConfigFileURL
+=
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/user-dirs.dirs"
));
aConfigFileURL
=
OUString
::
createFromAscii
(
config_home
);
aConfigFileURL
+=
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"/user-dirs.dirs"
));
}
if
(
osl_File_E_None
==
osl_openFile
(
aConfigFileURL
.
pData
,
&
handle
,
osl_File_OpenFlag_Read
))
{
rtl
::
ByteSequence
seq
;
while
(
osl_File_E_None
==
osl_readLine
(
handle
,
(
sal_Sequence
**
)
&
seq
))
{
/* Remove newline at end */
int
len
=
seq
.
getLength
();
if
(
len
>
0
&&
seq
[
len
-
1
]
==
'\n'
)
seq
[
len
-
1
]
=
0
;
p
=
(
char
*
)
seq
.
getArray
();
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
strncmp
(
p
,
"XDG_"
,
4
)
!=
0
)
continue
;
p
+=
4
;
if
(
strncmp
(
p
,
type
,
strlen
(
type
))
!=
0
)
continue
;
p
+=
strlen
(
type
);
if
(
strncmp
(
p
,
"_DIR"
,
4
)
!=
0
)
continue
;
p
+=
4
;
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
*
p
!=
'='
)
continue
;
p
++
;
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
*
p
!=
'"'
)
continue
;
p
++
;
relative
=
0
;
if
(
strncmp
(
p
,
"$HOME/"
,
6
)
==
0
)
{
p
+=
6
;
relative
=
1
;
}
else
if
(
*
p
!=
'/'
)
continue
;
if
(
relative
)
{
aUserDirBuf
=
OUStringBuffer
(
aHomeDirURL
);
aUserDirBuf
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"/"
)
);
}
else
{
aUserDirBuf
=
OUStringBuffer
();
}
while
(
*
p
&&
*
p
!=
'"'
)
rtl
::
ByteSequence
seq
;
while
(
osl_File_E_None
==
osl_readLine
(
handle
,
(
sal_Sequence
**
)
&
seq
))
{
if
((
*
p
==
'\\'
)
&&
(
*
(
p
+
1
)
!=
0
))
/* Remove newline at end */
int
relative
=
0
;
int
len
=
seq
.
getLength
();
if
(
len
>
0
&&
seq
[
len
-
1
]
==
'\n'
)
seq
[
len
-
1
]
=
0
;
p
=
(
char
*
)
seq
.
getArray
();
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
strncmp
(
p
,
"XDG_"
,
4
)
!=
0
)
continue
;
p
+=
4
;
if
(
strncmp
(
p
,
type
,
strlen
(
type
))
!=
0
)
continue
;
p
+=
strlen
(
type
);
if
(
strncmp
(
p
,
"_DIR"
,
4
)
!=
0
)
continue
;
p
+=
4
;
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
*
p
!=
'='
)
continue
;
p
++
;
aUserDirBuf
.
append
((
sal_Unicode
)
*
p
++
);
}
}
osl_closeFile
(
handle
);
while
(
*
p
==
' '
||
*
p
==
'\t'
)
p
++
;
if
(
*
p
!=
'"'
)
continue
;
p
++
;
if
(
strncmp
(
p
,
"$HOME/"
,
6
)
==
0
)
{
p
+=
6
;
relative
=
1
;
}
else
if
(
*
p
!=
'/'
)
continue
;
if
(
relative
)
{
aUserDirBuf
=
OUStringBuffer
(
aHomeDirURL
);
aUserDirBuf
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"/"
)
);
}
else
{
aUserDirBuf
=
OUStringBuffer
();
}
while
(
*
p
&&
*
p
!=
'"'
)
{
if
((
*
p
==
'\\'
)
&&
(
*
(
p
+
1
)
!=
0
))
p
++
;
aUserDirBuf
.
append
((
sal_Unicode
)
*
p
++
);
}
}
//end of while
osl_closeFile
(
handle
);
}
else
bError
=
true
;
bError
=
true
;
if
(
aUserDirBuf
.
getLength
()
>
0
&&
!
bError
)
{
aDocumentsDirURL
=
aUserDirBuf
.
makeStringAndClear
();
osl
::
Directory
aDocumentsDir
(
aDocumentsDirURL
);
if
(
osl
::
FileBase
::
E_None
==
aDocumentsDir
.
open
()
)
return
aDocumentsDirURL
;
aDocumentsDirURL
=
aUserDirBuf
.
makeStringAndClear
();
osl
::
Directory
aDocumentsDir
(
aDocumentsDirURL
);
if
(
osl
::
FileBase
::
E_None
==
aDocumentsDir
.
open
()
)
return
aDocumentsDirURL
;
}
/* Special case desktop for historical compatibility */
if
(
strcmp
(
type
,
"DESKTOP"
)
==
0
)
{
aUserDirBuf
=
OUStringBuffer
(
aHomeDirURL
);
aUserDirBuf
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"/Desktop"
)
);
return
aUserDirBuf
.
makeStringAndClear
();
aUserDirBuf
=
OUStringBuffer
(
aHomeDirURL
);
aUserDirBuf
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"/Desktop"
)
);
return
aUserDirBuf
.
makeStringAndClear
();
}
else
{
aUserDirBuf
=
OUStringBuffer
(
aHomeDirURL
);
aUserDirBuf
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"/Documents"
)
);
return
aUserDirBuf
.
makeStringAndClear
();
aUserDirBuf
=
OUStringBuffer
(
aHomeDirURL
);
aUserDirBuf
.
appendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"/Documents"
)
);
return
aUserDirBuf
.
makeStringAndClear
();
}
}
...
...
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