mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 704490 - Add API to get directory for any given profile (r=mfinkle)
And make it public to be accessible from other packages.
This commit is contained in:
parent
0240070f42
commit
4bb7890251
@ -723,17 +723,21 @@ abstract public class GeckoApp
|
||||
});
|
||||
}
|
||||
|
||||
File getProfileDir() {
|
||||
public File getProfileDir() {
|
||||
// XXX: TO-DO read profiles.ini to get the default profile
|
||||
return getProfileDir("default");
|
||||
}
|
||||
|
||||
public File getProfileDir(final String profileName) {
|
||||
if (mProfileDir == null && !mUserDefinedProfile) {
|
||||
File mozDir = new File(GeckoAppShell.sHomeDir, "mozilla");
|
||||
File[] profiles = mozDir.listFiles(new FileFilter() {
|
||||
public boolean accept(File pathname) {
|
||||
return pathname.getName().endsWith(".default");
|
||||
return pathname.getName().endsWith("." + profileName);
|
||||
}
|
||||
});
|
||||
if (profiles.length == 1)
|
||||
mProfileDir = profiles[0];
|
||||
// XXX: TO-DO read profiles.ini to get the default profile
|
||||
}
|
||||
return mProfileDir;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user