diff --git a/jni/NativeFormats/JavaNativeFormatPlugin.cpp b/jni/NativeFormats/JavaNativeFormatPlugin.cpp index cd30a2345..ef360c66c 100644 --- a/jni/NativeFormats/JavaNativeFormatPlugin.cpp +++ b/jni/NativeFormats/JavaNativeFormatPlugin.cpp @@ -94,7 +94,7 @@ static void fillLanguageAndEncoding(JNIEnv* env, jobject javaBook, Book &book) { } extern "C" -JNIEXPORT jint JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readMetaInfoNative(JNIEnv* env, jobject thiz, jobject javaBook) { +JNIEXPORT jint JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readMetainfoNative(JNIEnv* env, jobject thiz, jobject javaBook) { shared_ptr plugin = findCppPlugin(thiz); if (plugin.isNull()) { return 1; @@ -102,7 +102,7 @@ JNIEXPORT jint JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin shared_ptr book = Book::loadFromJavaBook(env, javaBook); - if (!plugin->readMetaInfo(*book)) { + if (!plugin->readMetainfo(*book)) { return 2; } diff --git a/jni/NativeFormats/fbreader/src/formats/FormatPlugin.h b/jni/NativeFormats/fbreader/src/formats/FormatPlugin.h index adfe5b762..7123a73dc 100644 --- a/jni/NativeFormats/fbreader/src/formats/FormatPlugin.h +++ b/jni/NativeFormats/fbreader/src/formats/FormatPlugin.h @@ -58,7 +58,7 @@ public: //virtual FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file); virtual const std::string &tryOpen(const ZLFile &file) const; - virtual bool readMetaInfo(Book &book) const = 0; + virtual bool readMetainfo(Book &book) const = 0; virtual std::vector > readEncryptionInfos(Book &book) const; virtual bool readUids(Book &book) const = 0; virtual bool readLanguageAndEncoding(Book &book) const = 0; diff --git a/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.cpp b/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.cpp index 3c60f5249..c7d9b8c1a 100644 --- a/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.cpp @@ -30,7 +30,7 @@ DocMetaInfoReader::DocMetaInfoReader(Book &book) : myBook(book) { myBook.removeAllTags(); } -bool DocMetaInfoReader::readMetaInfo() { +bool DocMetaInfoReader::readMetainfo() { myBook.removeAllAuthors(); myBook.setTitle(myBook.file().name(true)); myBook.removeAllTags(); diff --git a/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.h b/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.h index a16ff6f9f..0b8b2e3a3 100644 --- a/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.h +++ b/jni/NativeFormats/fbreader/src/formats/doc/DocMetaInfoReader.h @@ -29,7 +29,7 @@ class DocMetaInfoReader { public: DocMetaInfoReader(Book &book); ~DocMetaInfoReader(); - bool readMetaInfo(); + bool readMetainfo(); /* void startElementHandler(int tag, const char **attributes); diff --git a/jni/NativeFormats/fbreader/src/formats/doc/DocPlugin.cpp b/jni/NativeFormats/fbreader/src/formats/doc/DocPlugin.cpp index 7195b411d..d3fb640f1 100644 --- a/jni/NativeFormats/fbreader/src/formats/doc/DocPlugin.cpp +++ b/jni/NativeFormats/fbreader/src/formats/doc/DocPlugin.cpp @@ -48,8 +48,8 @@ bool DocPlugin::acceptsFile(const ZLFile &file) const { return file.extension() == "doc"; } -bool DocPlugin::readMetaInfo(Book &book) const { - if (!DocMetaInfoReader(book).readMetaInfo()) { +bool DocPlugin::readMetainfo(Book &book) const { + if (!DocMetaInfoReader(book).readMetainfo()) { return false; } diff --git a/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.cpp b/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.cpp index b146bd734..9a5bdbaf2 100644 --- a/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.cpp @@ -213,7 +213,7 @@ void FB2MetaInfoReader::endElementHandler(int tag) { } } -bool FB2MetaInfoReader::readMetaInfo() { +bool FB2MetaInfoReader::readMetainfo() { myReadState = READ_NOTHING; myBuffer.erase(); for (int i = 0; i < 3; ++i) { diff --git a/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.h b/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.h index 4c17d9bdc..d9ecf95b5 100644 --- a/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.h +++ b/jni/NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.h @@ -30,7 +30,7 @@ class FB2MetaInfoReader : public FB2Reader { public: FB2MetaInfoReader(Book &book); - bool readMetaInfo(); + bool readMetainfo(); void startElementHandler(int tag, const char **attributes); void endElementHandler(int tag); diff --git a/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.cpp b/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.cpp index 13ad7fdb6..1d422a75e 100644 --- a/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.cpp +++ b/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.cpp @@ -30,8 +30,8 @@ const std::string FB2Plugin::supportedFileType() const { return "fb2"; } -bool FB2Plugin::readMetaInfo(Book &book) const { - return FB2MetaInfoReader(book).readMetaInfo(); +bool FB2Plugin::readMetainfo(Book &book) const { + return FB2MetaInfoReader(book).readMetainfo(); } bool FB2Plugin::readUids(Book &book) const { diff --git a/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.h b/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.h index 525e6ac63..a5873dfbc 100644 --- a/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.h +++ b/jni/NativeFormats/fbreader/src/formats/fb2/FB2Plugin.h @@ -29,7 +29,7 @@ public: ~FB2Plugin(); bool providesMetaInfo() const; const std::string supportedFileType() const; - bool readMetaInfo(Book &book) const; + bool readMetainfo(Book &book) const; bool readUids(Book &book) const; bool readLanguageAndEncoding(Book &book) const; bool readModel(BookModel &model) const; diff --git a/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.cpp b/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.cpp index afd5f4358..6e882255b 100644 --- a/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.cpp +++ b/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.cpp @@ -34,7 +34,7 @@ const std::string HtmlPlugin::supportedFileType() const { return "HTML"; } -bool HtmlPlugin::readMetaInfo(Book &book) const { +bool HtmlPlugin::readMetainfo(Book &book) const { shared_ptr stream = book.file().inputStream(); if (stream.isNull()) { return false; diff --git a/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.h b/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.h index 52d9df38b..a2f02516f 100644 --- a/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.h +++ b/jni/NativeFormats/fbreader/src/formats/html/HtmlPlugin.h @@ -29,7 +29,7 @@ public: ~HtmlPlugin(); bool providesMetaInfo() const; const std::string supportedFileType() const; - bool readMetaInfo(Book &book) const; + bool readMetainfo(Book &book) const; bool readUids(Book &book) const; bool readLanguageAndEncoding(Book &book) const; bool readModel(BookModel &model) const; diff --git a/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.cpp b/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.cpp index dea19abc5..633b95c0b 100644 --- a/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.cpp @@ -154,7 +154,7 @@ void OEBMetaInfoReader::endElementHandler(const char *tag) { myReadState = READ_METADATA; } -bool OEBMetaInfoReader::readMetaInfo(const ZLFile &file) { +bool OEBMetaInfoReader::readMetainfo(const ZLFile &file) { myReadState = READ_NONE; if (!readDocument(file)) { ZLLogger::Instance().println("epub", "Failure while reading info from " + file.path()); diff --git a/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.h b/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.h index e87691345..473e55701 100644 --- a/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.h +++ b/jni/NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.h @@ -30,7 +30,7 @@ class OEBMetaInfoReader : public OPFReader { public: OEBMetaInfoReader(Book &book); - bool readMetaInfo(const ZLFile &file); + bool readMetainfo(const ZLFile &file); void startElementHandler(const char *tag, const char **attributes); void endElementHandler(const char *tag); diff --git a/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.cpp b/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.cpp index 047bd7bdc..7865595d6 100644 --- a/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.cpp +++ b/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.cpp @@ -124,9 +124,9 @@ ZLFile OEBPlugin::opfFile(const ZLFile &oebFile) { return ZLFile::NO_FILE; } -bool OEBPlugin::readMetaInfo(Book &book) const { +bool OEBPlugin::readMetainfo(Book &book) const { const ZLFile &file = book.file(); - return OEBMetaInfoReader(book).readMetaInfo(opfFile(file)); + return OEBMetaInfoReader(book).readMetainfo(opfFile(file)); } std::vector > OEBPlugin::readEncryptionInfos(Book &book) const { diff --git a/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.h b/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.h index 72a7d439b..509ef7167 100644 --- a/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.h +++ b/jni/NativeFormats/fbreader/src/formats/oeb/OEBPlugin.h @@ -32,7 +32,7 @@ public: ~OEBPlugin(); bool providesMetaInfo() const; const std::string supportedFileType() const; - bool readMetaInfo(Book &book) const; + bool readMetainfo(Book &book) const; virtual std::vector > readEncryptionInfos(Book &book) const; bool readUids(Book &book) const; bool readLanguageAndEncoding(Book &book) const; diff --git a/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.cpp b/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.cpp index 49c49a75a..412275e8d 100644 --- a/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.cpp +++ b/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.cpp @@ -37,7 +37,7 @@ const std::string RtfPlugin::supportedFileType() const { return "rtf"; } -bool RtfPlugin::readMetaInfo(Book &book) const { +bool RtfPlugin::readMetainfo(Book &book) const { if (!RtfDescriptionReader(book).readDocument(book.file())) { return false; } diff --git a/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.h b/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.h index 3fa066a87..e9055b172 100644 --- a/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.h +++ b/jni/NativeFormats/fbreader/src/formats/rtf/RtfPlugin.h @@ -27,7 +27,7 @@ class RtfPlugin : public FormatPlugin { public: bool providesMetaInfo() const; const std::string supportedFileType() const; - bool readMetaInfo(Book &book) const; + bool readMetainfo(Book &book) const; bool readUids(Book &book) const; bool readLanguageAndEncoding(Book &book) const; bool readModel(BookModel &model) const; diff --git a/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.cpp b/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.cpp index 1958c3eac..28ecb59e6 100644 --- a/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.cpp +++ b/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.cpp @@ -38,7 +38,7 @@ const std::string TxtPlugin::supportedFileType() const { return "plain text"; } -bool TxtPlugin::readMetaInfo(Book &/*book*/) const { +bool TxtPlugin::readMetainfo(Book &/*book*/) const { return true; } diff --git a/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.h b/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.h index 65969bc71..ee99b3772 100644 --- a/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.h +++ b/jni/NativeFormats/fbreader/src/formats/txt/TxtPlugin.h @@ -28,7 +28,7 @@ public: ~TxtPlugin(); bool providesMetaInfo() const; const std::string supportedFileType() const; - bool readMetaInfo(Book &book) const; + bool readMetainfo(Book &book) const; bool readUids(Book &book) const; bool readLanguageAndEncoding(Book &book) const; bool readModel(BookModel &model) const; diff --git a/jni/NativeFormats/fbreader/src/library/Book.cpp b/jni/NativeFormats/fbreader/src/library/Book.cpp index 7d1a4b0ab..e19667b78 100644 --- a/jni/NativeFormats/fbreader/src/library/Book.cpp +++ b/jni/NativeFormats/fbreader/src/library/Book.cpp @@ -65,7 +65,7 @@ shared_ptr Book::loadFromFile(const ZLFile &file) { } shared_ptr book = new Book(file, 0); - if (!plugin->readMetaInfo(*book)) { + if (!plugin->readMetainfo(*book)) { return 0; } diff --git a/src/org/geometerplus/fbreader/book/Book.java b/src/org/geometerplus/fbreader/book/Book.java index 3e6cc585c..0c232baa0 100644 --- a/src/org/geometerplus/fbreader/book/Book.java +++ b/src/org/geometerplus/fbreader/book/Book.java @@ -76,7 +76,7 @@ public class Book extends TitledEntity { myId = -1; final FormatPlugin plugin = getPlugin(file); File = plugin.realBookFile(file); - readMetaInfo(plugin); + readMetainfo(plugin); myIsSaved = false; } @@ -157,7 +157,7 @@ public class Book extends TitledEntity { public void reloadInfoFromFile() { try { - readMetaInfo(); + readMetainfo(); } catch (BookReadingException e) { // ignore } @@ -175,11 +175,11 @@ public class Book extends TitledEntity { return getPlugin(File); } - void readMetaInfo() throws BookReadingException { - readMetaInfo(getPlugin()); + void readMetainfo() throws BookReadingException { + readMetainfo(getPlugin()); } - private void readMetaInfo(FormatPlugin plugin) throws BookReadingException { + private void readMetainfo(FormatPlugin plugin) throws BookReadingException { myEncoding = null; myLanguage = null; setTitle(null); @@ -190,7 +190,7 @@ public class Book extends TitledEntity { myIsSaved = false; - plugin.readMetaInfo(this); + plugin.readMetainfo(this); if (myUids == null || myUids.isEmpty()) { plugin.readUids(this); } diff --git a/src/org/geometerplus/fbreader/book/BookCollection.java b/src/org/geometerplus/fbreader/book/BookCollection.java index eb4286586..a938c9eb2 100644 --- a/src/org/geometerplus/fbreader/book/BookCollection.java +++ b/src/org/geometerplus/fbreader/book/BookCollection.java @@ -109,7 +109,7 @@ public class BookCollection extends AbstractBookCollection { if (book == null) { book = new Book(bookFile); } else { - book.readMetaInfo(); + book.readMetainfo(); } } catch (BookReadingException e) { return null; @@ -151,7 +151,7 @@ public class BookCollection extends AbstractBookCollection { fileInfos.save(); try { - book.readMetaInfo(); + book.readMetainfo(); // loaded from db addBook(book, false); return book; @@ -508,7 +508,7 @@ public class BookCollection extends AbstractBookCollection { } if (!fileInfos.check(file, true)) { try { - book.readMetaInfo(); + book.readMetainfo(); saveBook(book); } catch (BookReadingException e) { doAdd = false; @@ -611,7 +611,7 @@ public class BookCollection extends AbstractBookCollection { final Book book = orphanedBooksByFileId.get(fileId); if (book != null) { if (doReadMetaInfo) { - book.readMetaInfo(); + book.readMetainfo(); } newBooks.add(book); return; diff --git a/src/org/geometerplus/fbreader/formats/FormatPlugin.java b/src/org/geometerplus/fbreader/formats/FormatPlugin.java index da726e5aa..88da28c0e 100644 --- a/src/org/geometerplus/fbreader/formats/FormatPlugin.java +++ b/src/org/geometerplus/fbreader/formats/FormatPlugin.java @@ -48,7 +48,7 @@ public abstract class FormatPlugin { public List readEncryptionInfos(Book book) { return Collections.emptyList(); } - public abstract void readMetaInfo(Book book) throws BookReadingException; + public abstract void readMetainfo(Book book) throws BookReadingException; public abstract void readUids(Book book) throws BookReadingException; public abstract void readModel(BookModel model) throws BookReadingException; public abstract void detectLanguageAndEncoding(Book book) throws BookReadingException; diff --git a/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java b/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java index 01416d234..c41eecddc 100644 --- a/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java +++ b/src/org/geometerplus/fbreader/formats/NativeFormatPlugin.java @@ -51,8 +51,8 @@ public class NativeFormatPlugin extends FormatPlugin { } @Override - synchronized public void readMetaInfo(Book book) throws BookReadingException { - final int code = readMetaInfoNative(book); + synchronized public void readMetainfo(Book book) throws BookReadingException { + final int code = readMetainfoNative(book); if (code != 0) { throw new BookReadingException( "nativeCodeFailure", @@ -62,7 +62,7 @@ public class NativeFormatPlugin extends FormatPlugin { } } - private native int readMetaInfoNative(Book book); + private native int readMetainfoNative(Book book); @Override public List readEncryptionInfos(Book book) { diff --git a/src/org/geometerplus/fbreader/formats/fb2/FB2MetaInfoReader.java b/src/org/geometerplus/fbreader/formats/fb2/FB2MetaInfoReader.java index 16369796e..9d8e62e31 100644 --- a/src/org/geometerplus/fbreader/formats/fb2/FB2MetaInfoReader.java +++ b/src/org/geometerplus/fbreader/formats/fb2/FB2MetaInfoReader.java @@ -56,7 +56,7 @@ public class FB2MetaInfoReader extends ZLXMLReaderAdapter { return true; } - public void readMetaInfo() throws BookReadingException { + public void readMetainfo() throws BookReadingException { myReadState = READ_NOTHING; myAuthorNames[0] = ""; myAuthorNames[1] = ""; diff --git a/src/org/geometerplus/fbreader/formats/fb2/FB2Plugin.java b/src/org/geometerplus/fbreader/formats/fb2/FB2Plugin.java index f1f349837..f5e76d236 100644 --- a/src/org/geometerplus/fbreader/formats/fb2/FB2Plugin.java +++ b/src/org/geometerplus/fbreader/formats/fb2/FB2Plugin.java @@ -43,8 +43,8 @@ public class FB2Plugin extends JavaFormatPlugin { } @Override - public void readMetaInfo(Book book) throws BookReadingException { - new FB2MetaInfoReader(book).readMetaInfo(); + public void readMetainfo(Book book) throws BookReadingException { + new FB2MetaInfoReader(book).readMetainfo(); } @Override diff --git a/src/org/geometerplus/fbreader/formats/oeb/OEBMetaInfoReader.java b/src/org/geometerplus/fbreader/formats/oeb/OEBMetaInfoReader.java index f0888d7bc..aec3593f2 100644 --- a/src/org/geometerplus/fbreader/formats/oeb/OEBMetaInfoReader.java +++ b/src/org/geometerplus/fbreader/formats/oeb/OEBMetaInfoReader.java @@ -44,7 +44,7 @@ class OEBMetaInfoReader extends ZLXMLReaderAdapter implements XMLNamespaces { myBook.setLanguage(null); } - void readMetaInfo(ZLFile file) throws BookReadingException { + void readMetainfo(ZLFile file) throws BookReadingException { myReadState = ReadState.Nothing; mySeriesTitle = ""; mySeriesIndex = null; diff --git a/src/org/geometerplus/fbreader/formats/oeb/OEBPlugin.java b/src/org/geometerplus/fbreader/formats/oeb/OEBPlugin.java index 36f2a1372..50153f857 100644 --- a/src/org/geometerplus/fbreader/formats/oeb/OEBPlugin.java +++ b/src/org/geometerplus/fbreader/formats/oeb/OEBPlugin.java @@ -57,8 +57,8 @@ public class OEBPlugin extends JavaFormatPlugin { } @Override - public void readMetaInfo(Book book) throws BookReadingException { - new OEBMetaInfoReader(book).readMetaInfo(getOpfFile(book.File)); + public void readMetainfo(Book book) throws BookReadingException { + new OEBMetaInfoReader(book).readMetainfo(getOpfFile(book.File)); } @Override diff --git a/src/org/geometerplus/fbreader/formats/pdb/MobipocketPlugin.java b/src/org/geometerplus/fbreader/formats/pdb/MobipocketPlugin.java index 880a2aa1d..fe9791b29 100644 --- a/src/org/geometerplus/fbreader/formats/pdb/MobipocketPlugin.java +++ b/src/org/geometerplus/fbreader/formats/pdb/MobipocketPlugin.java @@ -40,7 +40,7 @@ public class MobipocketPlugin extends JavaFormatPlugin { } @Override - public void readMetaInfo(Book book) throws BookReadingException { + public void readMetainfo(Book book) throws BookReadingException { InputStream stream = null; try { stream = book.File.getInputStream();