Changeset View
Changeset View
Standalone View
Standalone View
src/app/qml/PeruseMain.qml
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 46 | function showBook(filename, currentPage) { | |||
---|---|---|---|---|---|
49 | } | 49 | } | ||
50 | mainWindow.pageStack.layers.push(bookViewer, { focus: true, file: filename, currentPage: currentPage }) | 50 | mainWindow.pageStack.layers.push(bookViewer, { focus: true, file: filename, currentPage: currentPage }) | ||
51 | peruseConfig.bookOpened(filename); | 51 | peruseConfig.bookOpened(filename); | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | Peruse.BookListModel { | 54 | Peruse.BookListModel { | ||
55 | id: contentList; | 55 | id: contentList; | ||
56 | contentModel: ContentList { | 56 | contentModel: ContentList { | ||
57 | autoSearch: false | ||||
58 | | ||||
57 | onSearchCompleted: { | 59 | onSearchCompleted: { | ||
58 | mainWindow.isLoading = false; | 60 | mainWindow.isLoading = false; | ||
59 | mainWindow.globalDrawer.actions = globalDrawerActions; | 61 | mainWindow.globalDrawer.actions = globalDrawerActions; | ||
60 | } | 62 | } | ||
63 | | ||||
64 | ContentQuery { | ||||
65 | type: ContentQuery.Comics | ||||
66 | locations: peruseConfig.bookLocations | ||||
67 | } | ||||
61 | } | 68 | } | ||
62 | onCacheLoadedChanged: { | 69 | onCacheLoadedChanged: { | ||
63 | if(!cacheLoaded) { | 70 | if(!cacheLoaded) { | ||
64 | return; | 71 | return; | ||
65 | } | 72 | } | ||
66 | | ||||
67 | var bookLocations = peruseConfig.bookLocations; | | |||
68 | for(var i = 0; i < bookLocations.length; ++i) { | | |||
69 | contentList.contentModel.addLocation(bookLocations[i]); | | |||
70 | } | | |||
71 | contentList.contentModel.setSearchString("cbz OR cbr OR cb7 OR cbt OR cba OR chm OR djvu OR epub OR pdf"); | | |||
72 | contentList.contentModel.addMimetype("application/x-cbz"); | | |||
73 | contentList.contentModel.addMimetype("application/x-cbr"); | | |||
74 | contentList.contentModel.addMimetype("application/x-cb7"); | | |||
75 | contentList.contentModel.addMimetype("application/x-cbt"); | | |||
76 | contentList.contentModel.addMimetype("application/x-cba"); | | |||
77 | contentList.contentModel.addMimetype("application/vnd.comicbook+zip"); | | |||
78 | contentList.contentModel.addMimetype("application/vnd.comicbook+rar"); | | |||
79 | contentList.contentModel.addMimetype("application/vnd.ms-htmlhelp"); | | |||
80 | contentList.contentModel.addMimetype("image/vnd.djvu"); | | |||
81 | contentList.contentModel.addMimetype("image/x-djvu"); | | |||
82 | contentList.contentModel.addMimetype("application/epub+zip"); | | |||
83 | contentList.contentModel.addMimetype("application/pdf"); | | |||
84 | contentList.contentModel.setKnownFiles(contentList.knownBookFiles()); | 73 | contentList.contentModel.setKnownFiles(contentList.knownBookFiles()); | ||
85 | contentList.contentModel.startSearch(); | 74 | contentList.contentModel.startSearch() | ||
86 | } | 75 | } | ||
87 | } | 76 | } | ||
88 | 77 | | |||
89 | Peruse.Config { | 78 | Peruse.Config { | ||
90 | id: peruseConfig; | 79 | id: peruseConfig; | ||
91 | } | 80 | } | ||
92 | function homeDir() { | 81 | function homeDir() { | ||
93 | return peruseConfig.homeDir(); | 82 | return peruseConfig.homeDir(); | ||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |