1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

synchronization with multidirs branch

This commit is contained in:
Nikolay Pultsin 2012-05-03 23:31:40 +01:00
parent 0b290e65d0
commit 064a86be50
5 changed files with 11 additions and 7 deletions

View file

@ -49,7 +49,7 @@ public class FixBooksDirectoryActivity extends Activity {
textView.setText(resource.getResource("text").getValue()); textView.setText(resource.getResource("text").getValue());
final EditText directoryView = (EditText)findViewById(R.id.books_directory_fix_directory); final EditText directoryView = (EditText)findViewById(R.id.books_directory_fix_directory);
directoryView.setText(Paths.BooksDirectoryOption().getValue()); directoryView.setText(Paths.mainBookDirectory());
final View buttonsView = findViewById(R.id.books_directory_fix_buttons); final View buttonsView = findViewById(R.id.books_directory_fix_buttons);
final Button okButton = (Button)buttonsView.findViewById(R.id.ok_button); final Button okButton = (Button)buttonsView.findViewById(R.id.ok_button);

View file

@ -19,10 +19,10 @@
package org.geometerplus.fbreader; package org.geometerplus.fbreader;
import org.geometerplus.zlibrary.core.options.ZLStringOption;
import android.os.Environment; import android.os.Environment;
import org.geometerplus.zlibrary.core.options.ZLStringOption;
public abstract class Paths { public abstract class Paths {
public static String cardDirectory() { public static String cardDirectory() {
return Environment.getExternalStorageDirectory().getPath(); return Environment.getExternalStorageDirectory().getPath();
@ -40,8 +40,12 @@ public abstract class Paths {
return new ZLStringOption("Files", "WallpapersDirectory", cardDirectory() + "/Wallpapers"); return new ZLStringOption("Files", "WallpapersDirectory", cardDirectory() + "/Wallpapers");
} }
public static String mainBookDirectory() {
return BooksDirectoryOption().getValue();
}
public static String cacheDirectory() { public static String cacheDirectory() {
return BooksDirectoryOption().getValue() + "/.FBReader"; return mainBookDirectory() + "/.FBReader";
} }
public static String networkCacheDirectory() { public static String networkCacheDirectory() {

View file

@ -188,7 +188,7 @@ public class Book {
final int index = fileName.lastIndexOf('.'); final int index = fileName.lastIndexOf('.');
setTitle(index > 0 ? fileName.substring(0, index) : fileName); setTitle(index > 0 ? fileName.substring(0, index) : fileName);
} }
final String demoPathPrefix = Paths.BooksDirectoryOption().getValue() + java.io.File.separator + "Demos" + java.io.File.separator; final String demoPathPrefix = Paths.mainBookDirectory() + "/Demos/";
if (File.getPath().startsWith(demoPathPrefix)) { if (File.getPath().startsWith(demoPathPrefix)) {
final String demoTag = LibraryUtil.resource().getResource("demo").getValue(); final String demoTag = LibraryUtil.resource().getResource("demo").getValue();
setTitle(getTitle() + " (" + demoTag + ")"); setTitle(getTitle() + " (" + demoTag + ")");

View file

@ -65,7 +65,7 @@ public class BookUrlInfo extends UrlInfo {
path.insert(0, "Demos"); path.insert(0, "Demos");
path.insert(0, File.separator); path.insert(0, File.separator);
} }
path.insert(0, Paths.BooksDirectoryOption().getValue()); path.insert(0, Paths.mainBookDirectory());
int index = path.length(); int index = path.length();
path.append(uri.getPath()); path.append(uri.getPath());

View file

@ -51,7 +51,7 @@ public final class ZLKeyBindings {
// ignore // ignore
} }
try { try {
new Reader(keys).readQuietly(ZLFile.createFileByPath(Paths.BooksDirectoryOption().getValue() + "/keymap.xml")); new Reader(keys).readQuietly(ZLFile.createFileByPath(Paths.mainBookDirectory() + "/keymap.xml"));
} catch (Exception e) { } catch (Exception e) {
// ignore // ignore
} }