Only quit the loop on ENOENT to try and load next themes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23805 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-02-01 03:54:01 +00:00
parent ef01092096
commit 1258015bc1
2 changed files with 7 additions and 6 deletions

View File

@ -87,7 +87,7 @@ status_t BeThemeImporter::ImportNextTheme(BMessage **theme)
return err;
err = settingsDir.SetTo(&dir, "Settings");
if (err < 0)
return err;
return B_ERROR;
PRINT(("BeThemeImporter: importing from '%s'\n", path.Path()));
BMessage global(Z_THEME_MESSAGE_WHAT);
@ -105,7 +105,7 @@ status_t BeThemeImporter::ImportNextTheme(BMessage **theme)
err = file.SetTo(&settingsDir, "Description", B_READ_ONLY);
if (err < B_OK)
return err;
return B_ERROR;
BString str;
char *buff;
buff = str.LockBuffer(1024);
@ -120,7 +120,7 @@ status_t BeThemeImporter::ImportNextTheme(BMessage **theme)
err = file.SetTo(&settingsDir, "Deskbar", B_READ_ONLY);
if (err < B_OK)
return err;
return B_ERROR;
str = "";
buff = str.LockBuffer(1024);
memset(buff, 0, 1024);
@ -151,7 +151,7 @@ status_t BeThemeImporter::ImportNextTheme(BMessage **theme)
err = file.SetTo(&settingsDir, "WorkSpaces", B_READ_ONLY);
if (err < B_OK)
return err;
return B_ERROR;
buff = str.LockBuffer(1024);
memset(buff, 0, 1024);
file.Read(buff, 1024);

View File

@ -990,8 +990,9 @@ status_t ThemeManager::ImportThemesFor(int32 index, const char *path)
err = importer->FetchThemes();
if (err < 0)
return err;
while ((importer->ImportNextTheme(&theme)) >= 0) {
AddTheme(theme);
while ((err = importer->ImportNextTheme(&theme)) != ENOENT) {
if (err >= 0)
AddTheme(theme);
}
importer->EndImports();