Merge lp:~ballogy/gloobus-preview/fix-unoconv into lp:gloobus-preview

Proposed by Balló György
Status: Merged
Merged at revision: 292
Proposed branch: lp:~ballogy/gloobus-preview/fix-unoconv
Merge into: lp:gloobus-preview
Diff against target: 47 lines (+9/-3)
2 files modified
src/plugin-pdf/office-loader.cpp (+2/-2)
src/plugin-pdf/office-plugin.h (+7/-1)
To merge this branch: bzr merge lp:~ballogy/gloobus-preview/fix-unoconv
Reviewer Review Type Date Requested Status
Gloobus Developers Pending
Review via email: mp+245280@code.launchpad.net

Description of the change

Fix unoconv parameters, add more supported file types

In recent unoconv versions, the command line parameters are changed. Also, add some more supported file formats (e.g. OpenDocument presentation).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin-pdf/office-loader.cpp'
2--- src/plugin-pdf/office-loader.cpp 2011-11-01 02:03:33 +0000
3+++ src/plugin-pdf/office-loader.cpp 2014-12-20 21:13:54 +0000
4@@ -87,7 +87,7 @@
5
6 if( NULL == uri && Utils::isProgramAvailable("unoconv") ) {
7 gchar *path = g_file_get_path(file);
8- gchar *cmd = g_strdup_printf("unoconv --stdout \"%s\" > \"%s\"", path, tmp);
9+ gchar *cmd = g_strdup_printf("unoconv -f pdf -o \"%s\" \"%s\"", tmp, path);
10
11 if( system(cmd) == 0) {
12 uri = pathToUri(tmp);
13@@ -123,4 +123,4 @@
14 {
15 path = "file://" + path;
16 return g_uri_escape_string(path.c_str(), G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, false);
17-}
18\ No newline at end of file
19+}
20
21=== modified file 'src/plugin-pdf/office-plugin.h'
22--- src/plugin-pdf/office-plugin.h 2011-10-30 20:42:38 +0000
23+++ src/plugin-pdf/office-plugin.h 2014-12-20 21:13:54 +0000
24@@ -6,15 +6,21 @@
25 PluginManager::register_plugin("office");
26
27 PluginManager::register_filetype("application/vnd.oasis.opendocument.text", 1);
28+PluginManager::register_filetype("application/vnd.openxmlformats-officedocument.wordprocessingml.document", 1);
29 PluginManager::register_filetype("application/msword", 1);
30 PluginManager::register_filetype("application/rtf", 1);
31 PluginManager::register_filetype("application/vnd.ms-excel", 1);
32 PluginManager::register_filetype("application/vnd.oasis.opendocument.spreadsheet", 1);
33+PluginManager::register_filetype("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", 1);
34 PluginManager::register_filetype("application/vnd.ms-powerpoint", 1);
35+PluginManager::register_filetype("application/vnd.oasis.opendocument.presentation", 1);
36+PluginManager::register_filetype("application/vnd.openxmlformats-officedocument.presentationml.presentation", 1);
37 PluginManager::register_filetype("application/vnd.sun.xml.calc", 1);
38+PluginManager::register_filetype("application/vnd.oasis.opendocument.graphics", 1);
39+
40
41 // TODO: add more filetypes supported by abiword and/or OpenOffice
42
43 #endif
44
45-#endif /* OFFICE_PLUGIN_H */
46\ No newline at end of file
47+#endif /* OFFICE_PLUGIN_H */

Subscribers

People subscribed via source and target branches